From 3c7ff62c7dd470bb7c6cdff6e733d62435d8ba72 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 19:26:47 +0000 Subject: [PATCH] fix(greptile): pass explicit bedrock provider to _supports_factory Bedrock Invoke transformation files (chat and messages) called _supports_factory(custom_llm_provider=None, ...) which relies on auto-detection. For short Bedrock model names (e.g. 'anthropic.claude-opus-4-6' without the version suffix) auto-detection fails and the lookup falls back through the exception path. Passing the known 'bedrock' provider explicitly makes the lookup deterministic for all Bedrock model variants, including cross-region inference profile IDs. Co-authored-by: Claude --- .../invoke_transformations/anthropic_claude3_transformation.py | 2 +- .../invoke_transformations/anthropic_claude3_transformation.py | 2 +- ...t_invoke_transformations_anthropic_claude3_transformation.py | 2 +- .../test_anthropic_claude3_transformation.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py b/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py index 7a95356d054..1d615d8df7e 100644 --- a/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py +++ b/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py @@ -173,7 +173,7 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig): if not ( _supports_factory( model=model, - custom_llm_provider=None, + custom_llm_provider="bedrock", key="supports_output_config", ) or AnthropicConfig._model_supports_effort_param(model) diff --git a/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py b/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py index 49f4bbfb440..8451d310578 100644 --- a/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py +++ b/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py @@ -564,7 +564,7 @@ class AmazonAnthropicClaudeMessagesConfig( if not ( _supports_factory( model=model, - custom_llm_provider=None, + custom_llm_provider="bedrock", key="supports_output_config", ) or AnthropicConfig._model_supports_effort_param(model) diff --git a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py index 066a4eedf42..b2e254901f4 100644 --- a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py +++ b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py @@ -449,7 +449,7 @@ def test_bedrock_chat_invoke_checks_output_config_support_with_bedrock_provider( mock_supports_factory.assert_called_once_with( model="us.anthropic.claude-opus-4-7", - custom_llm_provider=None, + custom_llm_provider="bedrock", key="supports_output_config", ) assert result["output_config"] == {"effort": "high"} diff --git a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py index 4af4f8fd50e..2e315a535f0 100644 --- a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py +++ b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py @@ -694,7 +694,7 @@ def test_bedrock_messages_checks_output_config_support_with_bedrock_provider(): mock_supports_factory.assert_called_with( model="us.anthropic.claude-opus-4-7", - custom_llm_provider=None, + custom_llm_provider="bedrock", key="supports_output_config", ) assert result["output_config"] == {"effort": "high"}