litellm - ✅(Solved) Fix Issue: "minimal" reasoning_effort not supported for gemini-3.1-flash-lite-preview [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#22889Fetched 2026-04-08 00:39:29
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
closed ×1cross-referenced ×1labeled ×1subscribed ×1

Fix Action

Fixed

PR fix notes

PR #22920: fix(gemini): handle 'minimal' reasoning_effort param for gemini-3.1-f…

Description (problem / solution / changelog)

…lash-lite-preview

Relevant issues

Fixes https://github.com/BerriAI/litellm/issues/22889

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🆕 New Feature 🐛 Bug Fix 🧹 Refactoring 📖 Documentation 🚄 Infrastructure ✅ Test

Changes

Changed files

  • litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py (modified, +3/-2)
  • tests/llm_translation/test_gemini.py (modified, +43/-0)
RAW_BUFFERClick to expand / collapse

Sending "reasoning_effort": "minimal" for gemini-3.1-flash-lite-preview, doesn't seem to map to "minimal" thinking_level, and the model thinks with "low" level. Something's missing around here: https://github.com/BerriAI/litellm/blob/9a13c76e2fa8a74ff17df959bb37624072951b63/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py#L811

extent analysis

Fix Plan

The fix involves updating the thinking_level mapping to include the "minimal" reasoning effort.

  • Update the thinking_level mapping in the vertex_and_google_ai_studio_gemini.py file:
thinking_level_mapping = {
    # ... existing mappings ...
    "minimal": "minimal",  # add this line
}
  • Ensure the reasoning_effort parameter is correctly passed to the model:
params = {
    # ... existing params ...
    "reasoning_effort": "minimal",
}
  • Verify the thinking_level is correctly set in the model:
thinking_level = thinking_level_mapping.get(params["reasoning_effort"])
print(thinking_level)  # should print "minimal"

Verification

To verify the fix, test the model with the updated thinking_level mapping and verify the output matches the expected "minimal" thinking level.

Extra Tips

  • Review the thinking_level mapping to ensure it covers all possible reasoning_effort values.
  • Consider adding error handling for unknown reasoning_effort values to prevent unexpected behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix Issue: "minimal" reasoning_effort not supported for gemini-3.1-flash-lite-preview [1 pull requests, 1 participants]