Merge pull request #36597 from BerriAI/litellm_/litellm-test-failures-debug-b4200d

fix(model_prices): advertise native structured output on every Bedrock DeepSeek V3.2 and GLM 5 id
This commit is contained in:
yuneng-jiang 2026-08-11 23:41:46 -07:00 committed by GitHub
commit e5e6728c8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 0 deletions

View file

@ -9707,6 +9707,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -9830,6 +9831,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -9922,6 +9924,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10007,6 +10010,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10410,6 +10414,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10624,6 +10629,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10701,6 +10707,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -11262,6 +11269,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -35883,6 +35891,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true
},
"eu.deepseek.v3.2": {
@ -35895,6 +35904,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true
},
"us.meta.llama3-1-405b-instruct-v1:0": {
@ -46171,6 +46181,7 @@
"supports_function_calling": true,
"supports_reasoning": true,
"supports_system_messages": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -46185,6 +46196,7 @@
"supports_function_calling": true,
"supports_reasoning": true,
"supports_system_messages": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},

View file

@ -9707,6 +9707,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -9830,6 +9831,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -9922,6 +9924,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10007,6 +10010,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10410,6 +10414,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10624,6 +10629,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -10701,6 +10707,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -11262,6 +11269,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -35883,6 +35891,7 @@
"output_cost_per_token": 1.85e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true
},
"eu.deepseek.v3.2": {
@ -35895,6 +35904,7 @@
"output_cost_per_token": 2.22e-06,
"supports_function_calling": true,
"supports_reasoning": true,
"supports_native_structured_output": true,
"supports_tool_choice": true
},
"us.meta.llama3-1-405b-instruct-v1:0": {
@ -46171,6 +46181,7 @@
"supports_function_calling": true,
"supports_reasoning": true,
"supports_system_messages": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
@ -46185,6 +46196,7 @@
"supports_function_calling": true,
"supports_reasoning": true,
"supports_system_messages": true,
"supports_native_structured_output": true,
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},

View file

@ -328,6 +328,38 @@ def test_get_model_info_bedrock_models():
), f"{base_model_key} is not equal to {base_model_value} for model {k}"
def test_get_model_info_bedrock_cross_region_capability_parity():
"""
Cross-region inference profiles carry litellm_provider "bedrock_converse", so the
regional drift check above (which filters on "bedrock") never reaches them.
"""
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")
prefixes = ("us.", "eu.", "apac.", "us-gov.")
checked = 0
for k, v in litellm.model_cost.items():
if not str(v.get("litellm_provider", "")).startswith("bedrock"):
continue
base_model_key = next(
(k[len(p) :] for p in prefixes if k.startswith(p)),
None,
)
if base_model_key is None or base_model_key not in litellm.model_cost:
continue
checked += 1
for cap, base_value in litellm.model_cost[base_model_key].items():
if not cap.startswith("supports_"):
continue
assert cap in v, f"{cap} is on {base_model_key} but missing from {k}"
assert (
v[cap] == base_value
), f"{cap} is {v[cap]} on {k} but {base_value} on {base_model_key}"
assert checked > 0, "no cross-region bedrock profiles found - the filter is inert"
def test_get_model_info_huggingface_models(monkeypatch):
from litellm import Router
from litellm.types.router import ModelGroupInfo