fix: set supports_reasoning=false for Vertex AI Gemini image models - #31907
Conversation
Greptile SummaryThis PR completes the fix for Vertex AI and Gemini image models incorrectly inheriting
Confidence Score: 5/5Safe to merge — the change is purely additive JSON fields in two cost-map files with no logic changes and comprehensive test coverage. Both cost-map files (remote source and bundled backup) are fully patched for all 10 affected Gemini image models. The test class covers each model with two independent assertions and makes no network calls. The previous review's gap — missing fixes for the four non-preview sibling models — has been addressed in this revision. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | All 10 affected Gemini image models now have supports_reasoning: false — verified for both gemini/ and vertex_ai/ prefixed entries, including the 4 non-preview siblings added in this revision. |
| litellm/model_prices_and_context_window_backup.json | Backup JSON kept in sync with the main file; all 10 image model entries carry supports_reasoning: false. |
| tests/test_litellm/llms/vertex_ai/image_generation/test_vertex_ai_image_generation_transformation.py | New TestVertexAIImageModelsSupportsReasoning class covers all 10 models with two complementary assertions (cost-map field and public API); no network calls, consistent with repo test conventions. |
Reviews (2): Last reviewed commit: "fix: add supports_reasoning=false to 4 n..." | Re-trigger Greptile
| MODELS = [ | ||
| "vertex_ai/gemini-2.5-flash-image", | ||
| "vertex_ai/gemini-3-pro-image-preview", | ||
| "vertex_ai/gemini-3.1-flash-image-preview", | ||
| "gemini/gemini-3-pro-image-preview", | ||
| "gemini/gemini-3.1-flash-image-preview", | ||
| ] |
There was a problem hiding this comment.
The
MODELS list only covers the five models that received the JSON fix. The four non-preview siblings — vertex_ai/gemini-3-pro-image, vertex_ai/gemini-3.1-flash-image, gemini/gemini-3-pro-image, and gemini/gemini-3.1-flash-image — are absent, so the test suite currently passes while those models still incorrectly return supports_reasoning=True.
| MODELS = [ | |
| "vertex_ai/gemini-2.5-flash-image", | |
| "vertex_ai/gemini-3-pro-image-preview", | |
| "vertex_ai/gemini-3.1-flash-image-preview", | |
| "gemini/gemini-3-pro-image-preview", | |
| "gemini/gemini-3.1-flash-image-preview", | |
| ] | |
| MODELS = [ | |
| "vertex_ai/gemini-2.5-flash-image", | |
| "vertex_ai/gemini-3-pro-image", | |
| "vertex_ai/gemini-3-pro-image-preview", | |
| "vertex_ai/gemini-3.1-flash-image", | |
| "vertex_ai/gemini-3.1-flash-image-preview", | |
| "gemini/gemini-2.5-flash-image", | |
| "gemini/gemini-3-pro-image", | |
| "gemini/gemini-3-pro-image-preview", | |
| "gemini/gemini-3.1-flash-image", | |
| "gemini/gemini-3.1-flash-image-preview", | |
| ] |
| assert result is False, ( | ||
| f"{model}: litellm.supports_reasoning() returned {result!r}, expected False" | ||
| ) |
There was a problem hiding this comment.
The file is missing a trailing newline. Most linters and editors will flag this.
| assert result is False, ( | |
| f"{model}: litellm.supports_reasoning() returned {result!r}, expected False" | |
| ) | |
| assert result is False, ( | |
| f"{model}: litellm.supports_reasoning() returned {result!r}, expected False" | |
| ) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ac12d46 to
d7b1715
Compare
|
@greptileai re-review Addressed the incomplete fix flagged in the previous review - added |
2ceb5fc to
d7b1715
Compare
…nd add missing non-preview variants
d7b1715 to
77fb31c
Compare
… fix/vertex-ai-image-models-supports-reasoning
Relevant issues
Fixes #31758
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewScreenshots / Proof of Fix
Bug is purely a missing field in the cost map JSON — no LLM calls needed.
Verified with pytest before submitting:
Type
🐛 Bug Fix
✅ Test
Changes
"supports_reasoning": falseto 5 Vertex AI / Gemini image modelentries in both
model_prices_and_context_window.jsonand the bundled backupTestVertexAIImageModelsSupportsReasoningwith 2 tests confirming thefix via the local cost map — no network calls