feat: Add support for reasoning_effort="none" for Gemini models #16548
+46
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title
feat: Add support for reasoning_effort="none" for Gemini models
Relevant issues
Fixes #16420
Pre-Submission checklist
tests/llm_translation/directoryType
🆕 New Feature
Changes
Summary
Adds support for
reasoning_effort="none"- the OpenAI standard parameter for disabling thinking in Gemini models.This is the official OpenAI-compatible way, as documented in Google's Gemini OpenAI guide:
Provides up to 96% cost savings when reasoning is not required.
Implementation Details
1. Model Configuration (
model_prices_and_context_window.json)"supports_reasoning": truetogemini-2.0-flash-thinking-exp-01-212. Core Logic (
vertex_and_google_ai_studio_gemini.py)reasoning_effort="none"→{thinkingBudget: 0, includeThoughts: false}3. Testing (
tests/llm_translation/test_gemini.py)test_reasoning_effort_none_mapping()unit test4. Documentation (
docs/providers/gemini.md)Performance Impact
reasoning_effort="none"reasoning_effort="disable"Usage
Why "none" or "disable"?
Both produce identical results, but "none" is the official OpenAI API specification.
Backward Compatibility
✅ Fully backward compatible - existing code continues to work unchanged.
Note
Adds support for reasoning_effort="none" for Gemini, mapping to thinkingBudget=0/includeThoughts=false, with model metadata, docs, and tests updated.
reasoning_effort="none"tothinkingConfig{"thinkingBudget": 0, "includeThoughts": false}invertex_and_google_ai_studio_gemini.py."supports_reasoning": truefor relevant Gemini models inmodel_prices_and_context_window.json.test_reasoning_effort_none_mappingto verify correct mapping.docs/providers/gemini.mdwith cost-optimization guidance, OpenAI compatibility, mapping table including"none", and note on Gemini 2.5 Pro limitations; add usage examples.Written by Cursor Bugbot for commit c977ca1. This will update automatically on new commits. Configure here.