From e6899174353f1e1a3604b3e8e63b92c9dffe10ac Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 23 May 2026 10:48:56 -0700 Subject: [PATCH] test(bedrock): swap legacy claude-3/3.5 model strings for 4.5 inference profiles The pinned model IDs anthropic.claude-3-sonnet-20240229-v1:0 and anthropic.claude-3-5-haiku-20241022-v1:0 are in the Bedrock 'public extended access' phase of Legacy (EOL 2026-07-30 and 2026-06-19 respectively). Bedrock now returns ValidationException 'Operation not allowed' for accounts that aren't grandfathered/active on these models, which is what the CCI Bedrock-using account hits. Swap to the current-generation inference profiles already used elsewhere in the suite: - claude-3-5-haiku-20241022-v1:0 -> us.claude-haiku-4-5-20251001-v1:0 - claude-3-sonnet-20240229-v1:0 -> us.claude-sonnet-4-5-20250929-v1:0 - us.claude-3-sonnet-20240229-v1:0 -> us.claude-sonnet-4-5-20250929-v1:0 - bedrock/claude-3-sonnet-20240229-v1:0 -> bedrock/us.claude-sonnet-4-5-20250929-v1:0 Affected tests: - tests/litellm_utils_tests/test_litellm_overhead.py test_litellm_overhead_non_streaming, test_litellm_overhead_stream - tests/local_testing/test_function_calling.py test_aaparallel_function_call, test_parallel_function_call_anthropic_error_msg, test_passing_tool_result_as_list - tests/test_openai_endpoints.py test_chat_completion_anthropic_structured_output --- tests/litellm_utils_tests/test_litellm_overhead.py | 5 ++--- tests/local_testing/test_function_calling.py | 9 ++++----- tests/test_openai_endpoints.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/litellm_utils_tests/test_litellm_overhead.py b/tests/litellm_utils_tests/test_litellm_overhead.py index 3a428e9d588..70fb42f33f5 100644 --- a/tests/litellm_utils_tests/test_litellm_overhead.py +++ b/tests/litellm_utils_tests/test_litellm_overhead.py @@ -14,7 +14,6 @@ sys.path.insert( ) # Adds the parent directory to the system path import litellm - # Fake Vertex AI Gemini response for mocking FAKE_VERTEX_GEMINI_RESPONSE = { "candidates": [ @@ -82,7 +81,7 @@ async def _vertex_ai_mocks(): "bedrock/mistral.mistral-7b-instruct-v0:2", "openai/gpt-4o", "openai/self_hosted", - "bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", + "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", "vertex_ai/gemini-1.5-flash", ], ) @@ -147,7 +146,7 @@ async def test_litellm_overhead_non_streaming(model): [ "bedrock/mistral.mistral-7b-instruct-v0:2", "openai/gpt-4o", - "bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", + "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", "openai/self_hosted", ], ) diff --git a/tests/local_testing/test_function_calling.py b/tests/local_testing/test_function_calling.py index 3c7e004b62e..1cad7d1421e 100644 --- a/tests/local_testing/test_function_calling.py +++ b/tests/local_testing/test_function_calling.py @@ -49,7 +49,7 @@ def get_current_weather(location, unit="fahrenheit"): "mistral/mistral-large-latest", "claude-haiku-4-5-20251001", "gemini/gemini-2.5-flash-lite", - "anthropic.claude-3-sonnet-20240229-v1:0", + "us.anthropic.claude-sonnet-4-5-20250929-v1:0", ], ) @pytest.mark.flaky(retries=3, delay=1) @@ -267,7 +267,6 @@ def test_aaparallel_function_call_with_anthropic_thinking(model): from litellm.types.utils import ChatCompletionMessageToolCall, Function, Message - _PARALLEL_TOOL_HISTORY_MESSAGES = [ { "role": "user", @@ -303,7 +302,7 @@ _PARALLEL_TOOL_HISTORY_MESSAGES = [ [ # Bedrock Converse still requires modify_params to inject the dummy tool. ( - "anthropic.claude-3-sonnet-20240229-v1:0", + "us.anthropic.claude-sonnet-4-5-20250929-v1:0", _PARALLEL_TOOL_HISTORY_MESSAGES, True, ), @@ -314,7 +313,7 @@ _PARALLEL_TOOL_HISTORY_MESSAGES = [ False, ), ( - "anthropic.claude-3-sonnet-20240229-v1:0", + "us.anthropic.claude-sonnet-4-5-20250929-v1:0", [ { "role": "user", @@ -579,7 +578,7 @@ def test_groq_parallel_function_call(): @pytest.mark.parametrize( "model", [ - "bedrock/anthropic.claude-3-sonnet-20240229-v1:0", + "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0", ], ) def test_passing_tool_result_as_list(model): diff --git a/tests/test_openai_endpoints.py b/tests/test_openai_endpoints.py index e898b88a556..29875a04413 100644 --- a/tests/test_openai_endpoints.py +++ b/tests/test_openai_endpoints.py @@ -446,7 +446,7 @@ async def test_chat_completion_anthropic_structured_output(): client = AsyncOpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000") res = await client.beta.chat.completions.parse( - model="bedrock/us.anthropic.claude-3-sonnet-20240229-v1:0", + model="bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0", messages=messages, response_format=EventsList, timeout=60,