fix(model-map): add supports_output_config to claude-sonnet-4-5 and claude-opus-4-1 entries

The model cost map entries for claude-sonnet-4-5, claude-sonnet-4-5-20250929,
claude-opus-4-1, and claude-opus-4-1-20250805 were missing the
supports_output_config flag. This caused response_format routing to
fall through to tool-call emulation instead of the native output_format
path after switching from the hardcoded substring set to the capability
flag lookup.

Also adds local_model_cost_map fixture to structured output tests so
they use the local model map data rather than the remote main branch
URL, which may not have the latest flags.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Krrish Dholakia 2026-07-01 15:00:14 +00:00
parent 16b47d8491
commit ce69aa17cc
3 changed files with 12 additions and 4 deletions

View file

@ -10438,6 +10438,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},
@ -10469,6 +10470,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_web_search": true
@ -10585,6 +10587,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},
@ -10612,6 +10615,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},

View file

@ -10438,6 +10438,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},
@ -10469,6 +10470,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_web_search": true
@ -10585,6 +10587,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},
@ -10612,6 +10615,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_output_config": true,
"supports_tool_choice": true,
"supports_vision": true
},

View file

@ -919,7 +919,7 @@ def test_anthropic_chat_transform_request_includes_context_management():
assert result["context_management"] == _sample_context_management_payload()
def test_anthropic_structured_output_beta_header():
def test_anthropic_structured_output_beta_header(local_model_cost_map):
from litellm.types.utils import CallTypes
from litellm.utils import return_raw_request
@ -966,7 +966,7 @@ def test_anthropic_structured_output_beta_header():
"claude-opus-4.5-20251101",
],
)
def test_opus_uses_native_structured_output(model_name):
def test_opus_uses_native_structured_output(model_name, local_model_cost_map):
"""
Test that Opus 4.5 and 4.6 models use native Anthropic structured outputs
(output_format) rather than the tool-based workaround.
@ -1008,7 +1008,7 @@ def test_opus_uses_native_structured_output(model_name):
assert optional_params.get("json_mode") is True
def test_non_structured_output_model_uses_tool_workaround():
def test_non_structured_output_model_uses_tool_workaround(local_model_cost_map):
"""
Test that models NOT in the native structured output list still use the
tool-based workaround for response_format.
@ -5739,7 +5739,7 @@ def test_top_k_forwarded_at_transform_on_models_that_accept_it():
assert result["top_k"] == 40
def test_opus_4_8_uses_native_structured_output():
def test_opus_4_8_uses_native_structured_output(local_model_cost_map):
"""claude-opus-4-8 has supports_output_config=true in the model map,
so response_format should route to the native output_format path
rather than the tool-call emulation path"""