Skip to content

fix(litellm): forward thinking_config to litellm reasoning params - #7361

Open
chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:fix/litellm-thinking-config-7360
Open

chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:fix/litellm-thinking-config-7360

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Closes #7360

LiteLlm._get_completion_inputs used a fixed allow-list of GenerateContentConfig fields and silently dropped thinking_config.

  • thinking_level (other than unspecified) is now forwarded as reasoning_effort (lowercased: minimal/low/medium/high).
  • Otherwise a positive thinking_budget is forwarded as thinking={"type": "enabled", "budget_tokens": N}.
  • include_thoughts is not mapped, because litellm has no provider-neutral equivalent.

Tests: two new tests in tests/unittests/models/test_litellm.py. Both fail without the fix (generation_params is None). With the fix, pytest tests/unittests/models/test_litellm.py gives 484 passed.

AI-assisted (Claude Code); reviewed and tested by the author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants