Skip to content

LiteLlm drops GenerateContentConfig.thinking_config; map it to litellm's reasoning_effort #7360

Closed

Description

@chriswithers-fuse

google.adk.models.lite_llm.LiteLlm._get_completion_inputs builds the litellm kwargs from a fixed allow-list of GenerateContentConfig fields (temperature, max_output_tokens, top_p, top_k, seed, stop_sequences, presence_penalty, frequency_penalty). thinking_config is present in config_dict but never forwarded, so an agent that sets e.g. ThinkingConfig(thinking_level=ThinkingLevel.LOW) gets the backend's default reasoning effort when run through LiteLlm, with no warning.

Verified on 2.8.0 and 2.10.0 (src/google/adk/models/lite_llm.py, the param_mapping / for key in (...) block, around line 3024 in v2.10.0). The only thinking handling in the file is the Anthropic thinking-block parsing on the response side.

litellm already normalises this across providers: reasoning_effort (low / medium / high, translated per provider, e.g. to Gemini thinkingConfig), and thinking={"type": "enabled", "budget_tokens": N} for budget-style providers.

Proposal: in _get_completion_inputs, map

  • thinking_config.thinking_level → reasoning_effort
  • thinking_config.thinking_budget → thinking={"type": "enabled", "budget_tokens": ...}
  • thinking_config.include_thoughts → the provider's equivalent where litellm exposes one

Related but different: #5712 (thinking blocks dropped when parsing responses), #5805 (thinking_config ignored in run_live).

Activity

  1. chelsealong commented on Sep 30, 2026

    @chelsealong
    Contributor

    Picking this one up now — opening a PR shortly. Flagging it here so nobody duplicates the work; if someone is already on it, say so and I will drop mine.

  2. changed the title [-]LiteLlm drops GenerateContentConfig.thinking_config; map it to litellm's reasoning_effort[/-] [+]`LiteLlm` drops `GenerateContentConfig.thinking_config`; map it to litellm's `reasoning_effort`[/+] on Sep 30, 2026
  3. surajksharma07 commented on Oct 1, 2026

    @surajksharma07
    Collaborator

    Reproduced this on 2.10.0 @chriswithers-fuse. temperature reaches litellm but neither thinking_level=LOW nor thinking_budget=1024 does so no release fixes it yet.

    Until #7361 lands a workaround worth trying: pass the litellm param straight to the model, e.g. LiteLlm(model="...", reasoning_effort="low") or thinking={"type": "enabled", "budget_tokens": N} for budget-style providers. Could you check that this actually changes the reasoning behaviour with your backend? Only checked the kwargs going into litellm not a real provider call.

    @chelsealong the mapping looks right. Before review could you also decide how thinking_budget=0/-1 should be handled and add a test for when a constructor reasoning_effort and thinking_config are both set (config currently wins)?

  4. added theissue type on Oct 1, 2026
  5. added
    models[Component] This issue is related to model support
    on Oct 1, 2026
  6. added a commit that references this issue on Oct 19, 2026
    dd80f8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

models[Component] This issue is related to model support

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions