mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
fix: set supports_reasoning=false for Vertex AI/Gemini image models and add missing non-preview variants
This commit is contained in:
parent
fad8116cdc
commit
77fb31c9e3
3 changed files with 62 additions and 0 deletions
|
|
@ -20573,6 +20573,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"gemini/gemini-2.5-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"deprecation_date": "2026-10-02",
|
||||
"input_cost_per_audio_token": 1e-06,
|
||||
|
|
@ -20624,6 +20625,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"gemini/gemini-3-pro-image": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"input_cost_per_token_batches": 1e-06,
|
||||
|
|
@ -20667,6 +20669,7 @@
|
|||
"supports_reasoning": false
|
||||
},
|
||||
"gemini/gemini-3-pro-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-06-25",
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
|
|
@ -20711,6 +20714,7 @@
|
|||
"web_search_billing_unit": "per_query"
|
||||
},
|
||||
"gemini/gemini-3.1-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"input_cost_per_token_batches": 2.5e-07,
|
||||
"litellm_provider": "gemini",
|
||||
|
|
@ -20753,6 +20757,7 @@
|
|||
"web_search_billing_unit": "per_query"
|
||||
},
|
||||
"gemini/gemini-3.1-flash-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-06-25",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"input_cost_per_token_batches": 2.5e-07,
|
||||
|
|
@ -39865,6 +39870,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/gemini-2.5-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-10-02",
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_audio_token": 1e-06,
|
||||
|
|
@ -39911,6 +39917,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"vertex_ai/gemini-3-pro-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2027-05-28",
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
|
|
@ -39928,6 +39935,7 @@
|
|||
"source": "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro-image"
|
||||
},
|
||||
"vertex_ai/gemini-3-pro-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"input_cost_per_token_batches": 1e-06,
|
||||
|
|
@ -39944,6 +39952,7 @@
|
|||
"source": "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro-image"
|
||||
},
|
||||
"vertex_ai/gemini-3.1-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2027-05-28",
|
||||
"input_cost_per_image": 0.00056,
|
||||
"input_cost_per_token": 5e-07,
|
||||
|
|
@ -39959,6 +39968,7 @@
|
|||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#gemini-models"
|
||||
},
|
||||
"vertex_ai/gemini-3.1-flash-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.00056,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
|
|
|
|||
|
|
@ -20573,6 +20573,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"gemini/gemini-2.5-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"deprecation_date": "2026-10-02",
|
||||
"input_cost_per_audio_token": 1e-06,
|
||||
|
|
@ -20624,6 +20625,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"gemini/gemini-3-pro-image": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"input_cost_per_token_batches": 1e-06,
|
||||
|
|
@ -20667,6 +20669,7 @@
|
|||
"supports_reasoning": false
|
||||
},
|
||||
"gemini/gemini-3-pro-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-06-25",
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
|
|
@ -20711,6 +20714,7 @@
|
|||
"web_search_billing_unit": "per_query"
|
||||
},
|
||||
"gemini/gemini-3.1-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"input_cost_per_token_batches": 2.5e-07,
|
||||
"litellm_provider": "gemini",
|
||||
|
|
@ -20753,6 +20757,7 @@
|
|||
"web_search_billing_unit": "per_query"
|
||||
},
|
||||
"gemini/gemini-3.1-flash-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-06-25",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"input_cost_per_token_batches": 2.5e-07,
|
||||
|
|
@ -39865,6 +39870,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/gemini-2.5-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2026-10-02",
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_audio_token": 1e-06,
|
||||
|
|
@ -39911,6 +39917,7 @@
|
|||
"supports_image_size": false
|
||||
},
|
||||
"vertex_ai/gemini-3-pro-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2027-05-28",
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
|
|
@ -39928,6 +39935,7 @@
|
|||
"source": "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro-image"
|
||||
},
|
||||
"vertex_ai/gemini-3-pro-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.0011,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"input_cost_per_token_batches": 1e-06,
|
||||
|
|
@ -39944,6 +39952,7 @@
|
|||
"source": "https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro-image"
|
||||
},
|
||||
"vertex_ai/gemini-3.1-flash-image": {
|
||||
"supports_reasoning": false,
|
||||
"deprecation_date": "2027-05-28",
|
||||
"input_cost_per_image": 0.00056,
|
||||
"input_cost_per_token": 5e-07,
|
||||
|
|
@ -39959,6 +39968,7 @@
|
|||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#gemini-models"
|
||||
},
|
||||
"vertex_ai/gemini-3.1-flash-image-preview": {
|
||||
"supports_reasoning": false,
|
||||
"input_cost_per_image": 0.00056,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "vertex_ai-language-models",
|
||||
|
|
|
|||
|
|
@ -680,3 +680,45 @@ class TestVertexAIImageGenerationIntegration:
|
|||
assert "us-central1" in url
|
||||
assert "imagegeneration@006" in url
|
||||
assert "predict" in url
|
||||
|
||||
class TestVertexAIImageModelsSupportsReasoning:
|
||||
"""Vertex AI Gemini image models must not inherit reasoning support.
|
||||
|
||||
Image generation endpoints reject reasoning_effort with a 400. The
|
||||
vertex_ai/ entries were missing an explicit supports_reasoning: false,
|
||||
causing them to silently inherit True from the provider-level fallback.
|
||||
"""
|
||||
|
||||
MODELS = [
|
||||
"vertex_ai/gemini-2.5-flash-image",
|
||||
"vertex_ai/gemini-3-pro-image-preview",
|
||||
"vertex_ai/gemini-3-pro-image",
|
||||
"vertex_ai/gemini-3.1-flash-image-preview",
|
||||
"vertex_ai/gemini-3.1-flash-image",
|
||||
"gemini/gemini-3-pro-image-preview",
|
||||
"gemini/gemini-3-pro-image",
|
||||
"gemini/gemini-3.1-flash-image-preview",
|
||||
"gemini/gemini-3.1-flash-image",
|
||||
]
|
||||
|
||||
def test_supports_reasoning_is_false_in_cost_map(self):
|
||||
"""supports_reasoning must be explicitly False in the cost map for all image models."""
|
||||
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap
|
||||
|
||||
cost_map = GetModelCostMap.load_local_model_cost_map()
|
||||
for model in self.MODELS:
|
||||
assert model in cost_map, f"{model} not found in cost map"
|
||||
assert cost_map[model].get("supports_reasoning") is False, (
|
||||
f"{model}: expected supports_reasoning=False, "
|
||||
f"got {cost_map[model].get('supports_reasoning')!r}"
|
||||
)
|
||||
|
||||
def test_supports_reasoning_returns_false(self):
|
||||
"""litellm.supports_reasoning() must return False for all affected image models."""
|
||||
import litellm
|
||||
|
||||
for model in self.MODELS:
|
||||
result = litellm.supports_reasoning(model=model)
|
||||
assert result is False, (
|
||||
f"{model}: litellm.supports_reasoning() returned {result!r}, expected False"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue