This commit is contained in:
Hamza Shah 2026-08-27 19:18:11 -05:00 committed by GitHub
commit 07f42740dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View file

@ -341,7 +341,9 @@ class AnthropicModelInfo(BaseLLMModelInfo):
prefixes: Final = (
"bedrock/converse/",
"bedrock/invoke/",
"bedrock/mantle/",
"bedrock/",
"mantle/",
"vertex_ai/",
)
deprefixed: Final = tuple(model[len(p) :] for p in prefixes if model.startswith(p))

View file

@ -427,6 +427,34 @@ def test_output_config_forwarded_for_bedrock_chat_invoke_request():
assert result["max_tokens"] == 100
def test_output_config_forwarded_for_mantle_routed_model():
"""A mantle-routed id must resolve the same capabilities as its us.* twin.
bedrock/mantle/anthropic.claude-opus-5 and bedrock/us.anthropic.claude-opus-5
are the same underlying model, but the mantle route segment was not among the
prefixes capability lookups strip, so supports_output_config and the effort
check both came back False and this path stripped output_config. The request
then went out with the legacy thinking.type=enabled shape, which Bedrock
rejects.
"""
config = AmazonAnthropicClaudeConfig()
optional_params = {
"max_tokens": 100,
"output_config": {"effort": "high"},
}
result = config.transform_request(
model="mantle/anthropic.claude-opus-5",
messages=[{"role": "user", "content": "test"}],
optional_params=optional_params,
litellm_params={},
headers={},
)
assert result.get("output_config") == {"effort": "high"}
def test_output_config_format_converted_for_bedrock_chat_invoke_request():
"""Bedrock Invoke chat path consumes ``output_config.format`` before forwarding."""
config = AmazonAnthropicClaudeConfig()