Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

claude-sonnet-4-5-20250929 fix

Ishaan Jaffer94c2c28f3da5
diff --git a/tests/litellm_utils_tests/test_utils.py b/tests/litellm_utils_tests/test_utils.py
index 339d00c412e..bee4354fc5b 100644
--- a/tests/litellm_utils_tests/test_utils.py
+++ b/tests/litellm_utils_tests/test_utils.py
@@ -1477,7 +1477,7 @@ def test_is_prompt_caching_enabled_error_handling():
messages=[{"role": "user", "content": "test"}],
tools=None,
custom_llm_provider="anthropic",
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
)
assert result is False # Should return False when an error occurs
diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.py
index 1513b4ddb2d..7988f2264ba 100644
--- a/tests/llm_translation/test_anthropic_completion.py
+++ b/tests/llm_translation/test_anthropic_completion.py
@@ -1382,7 +1382,7 @@ async def test_claude_tool_use_with_anthropic_acreate():
messages=[
{"role": "user", "content": "Hello, can you tell me the weather in Boston?"}
],
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
stream=True,
max_tokens=100,
tools=[
diff --git a/tests/local_testing/test_anthropic_prompt_caching.py b/tests/local_testing/test_anthropic_prompt_caching.py
index ad054616cec..df1eed38120 100644
--- a/tests/local_testing/test_anthropic_prompt_caching.py
+++ b/tests/local_testing/test_anthropic_prompt_caching.py
@@ -74,7 +74,7 @@ async def test_litellm_anthropic_prompt_caching_tools():
# Act: Call the litellm.acompletion function
response = await litellm.acompletion(
api_key="mock_api_key",
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
{"role": "user", "content": "What's the weather like in Boston today?"}
],
@@ -240,7 +240,7 @@ async def test_anthropic_vertex_ai_prompt_caching(anthropic_messages, sync_mode)
async def test_anthropic_api_prompt_caching_basic():
litellm.set_verbose = True
response = await litellm.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
# System Message
{
@@ -308,7 +308,7 @@ async def test_anthropic_api_prompt_caching_basic_with_cache_creation():
litellm.set_verbose = True
response = await litellm.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
# System Message
{
@@ -460,7 +460,7 @@ async def test_anthropic_api_prompt_caching_with_content_str():
async def test_anthropic_api_prompt_caching_no_headers():
litellm.set_verbose = True
response = await litellm.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
# System Message
{
@@ -520,7 +520,7 @@ async def test_anthropic_api_prompt_caching_no_headers():
@pytest.mark.flaky(retries=3, delay=1)
async def test_anthropic_api_prompt_caching_streaming():
response = await litellm.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
# System Message
{
@@ -620,7 +620,7 @@ async def test_litellm_anthropic_prompt_caching_system():
# Act: Call the litellm.acompletion function
response = await litellm.acompletion(
api_key="mock_api_key",
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
{
"role": "system",
@@ -696,7 +696,7 @@ def test_is_prompt_caching_enabled(anthropic_messages):
messages=anthropic_messages,
tools=None,
custom_llm_provider="anthropic",
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
)
@@ -723,7 +723,7 @@ async def test_router_prompt_caching_model_stored(
{
"model_name": "claude-model",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
"api_key": os.environ.get("ANTHROPIC_API_KEY"),
},
"model_info": {"id": "1234"},
@@ -772,7 +772,7 @@ async def test_router_with_prompt_caching(anthropic_messages):
{
"model_name": "claude-model",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
"api_key": os.environ.get("ANTHROPIC_API_KEY"),
"mock_response": "The sky is blue.",
},
diff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.py
index 7f4da72e04f..6bbeb3f5a54 100644
--- a/tests/local_testing/test_custom_callback_input.py
+++ b/tests/local_testing/test_custom_callback_input.py
@@ -1418,7 +1418,7 @@ async def test_standard_logging_payload_stream_usage(sync_mode):
with patch.object(customHandler, patch_event, new=return_val) as mock_client:
if sync_mode:
resp = litellm.completion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[{"role": "user", "content": "Hey, how's it going?"}],
stream=stream,
)
@@ -1429,7 +1429,7 @@ async def test_standard_logging_payload_stream_usage(sync_mode):
time.sleep(2)
else:
resp = await litellm.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[{"role": "user", "content": "Hey, how's it going?"}],
stream=stream,
)
diff --git a/tests/local_testing/test_prompt_caching.py b/tests/local_testing/test_prompt_caching.py
index 11c4d583d05..58b8f560045 100644
--- a/tests/local_testing/test_prompt_caching.py
+++ b/tests/local_testing/test_prompt_caching.py
@@ -41,6 +41,6 @@ def _usage_format_tests(usage: litellm.Usage):
def test_supports_prompt_caching():
from litellm.utils import supports_prompt_caching
- supports_pc = supports_prompt_caching(model="anthropic/claude-3-5-sonnet-20240620")
+ supports_pc = supports_prompt_caching(model="anthropic/claude-sonnet-4-5-20250929")
assert supports_pc
diff --git a/tests/local_testing/test_router_budget_limiter.py b/tests/local_testing/test_router_budget_limiter.py
index c78bf2bee64..0af1d3f073f 100644
--- a/tests/local_testing/test_router_budget_limiter.py
+++ b/tests/local_testing/test_router_budget_limiter.py
@@ -153,7 +153,7 @@ async def test_provider_budgets_e2e_test_expect_to_fail():
response = await router.acompletion(
messages=[{"role": "user", "content": "Hello, how are you?"}],
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
)
print(response)
@@ -163,7 +163,7 @@ async def test_provider_budgets_e2e_test_expect_to_fail():
with pytest.raises(Exception) as exc_info:
response = await router.acompletion(
messages=[{"role": "user", "content": "Hello, how are you?"}],
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
)
print(response)
print("response.hidden_params", response._hidden_params)
diff --git a/tests/local_testing/test_router_fallbacks.py b/tests/local_testing/test_router_fallbacks.py
index ce33b46f685..a3413897bdc 100644
--- a/tests/local_testing/test_router_fallbacks.py
+++ b/tests/local_testing/test_router_fallbacks.py
@@ -1300,9 +1300,9 @@ async def test_anthropic_streaming_fallbacks(sync_mode):
router = Router(
model_list=[
{
- "model_name": "anthropic/claude-3-5-sonnet-20240620",
+ "model_name": "anthropic/claude-sonnet-4-5-20250929",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
},
},
{
@@ -1313,7 +1313,7 @@ async def test_anthropic_streaming_fallbacks(sync_mode):
},
},
],
- fallbacks=[{"anthropic/claude-3-5-sonnet-20240620": ["gpt-3.5-turbo"]}],
+ fallbacks=[{"anthropic/claude-sonnet-4-5-20250929": ["gpt-3.5-turbo"]}],
num_retries=0,
)
@@ -1321,7 +1321,7 @@ async def test_anthropic_streaming_fallbacks(sync_mode):
chunks = []
if sync_mode:
response = router.completion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[{"role": "user", "content": "Hey, how's it going?"}],
stream=True,
client=client,
@@ -1331,7 +1331,7 @@ async def test_anthropic_streaming_fallbacks(sync_mode):
chunks.append(chunk)
else:
response = await router.acompletion(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[{"role": "user", "content": "Hey, how's it going?"}],
stream=True,
client=client,
diff --git a/tests/local_testing/test_router_retries.py b/tests/local_testing/test_router_retries.py
index 789e5e9b351..70c3437627c 100644
--- a/tests/local_testing/test_router_retries.py
+++ b/tests/local_testing/test_router_retries.py
@@ -780,7 +780,7 @@ async def test_router_timeout_model_specific_and_global():
{
"model_name": "anthropic-claude",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
"timeout": 1,
},
}
diff --git a/tests/old_proxy_tests/tests/test_anthropic_context_caching.py b/tests/old_proxy_tests/tests/test_anthropic_context_caching.py
index 6156e4a0485..7a153295f35 100644
--- a/tests/old_proxy_tests/tests/test_anthropic_context_caching.py
+++ b/tests/old_proxy_tests/tests/test_anthropic_context_caching.py
@@ -7,7 +7,7 @@ client = openai.OpenAI(
response = client.chat.completions.create(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
messages=[
{ # type: ignore
"role": "system",
diff --git a/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py b/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py
index d5208421f11..584f7f4d32a 100644
--- a/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py
+++ b/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py
@@ -123,7 +123,7 @@ def test_bad_request_bad_param_error():
def test_anthropic_with_responses_api():
client = get_test_client()
response = client.responses.create(
- model="anthropic/claude-3-5-sonnet-20240620",
+ model="anthropic/claude-sonnet-4-5-20250929",
input="just respond with the word 'ping'",
previous_response_id="hi",
)
diff --git a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py
index dacda602c01..ea9e26c1d18 100644
--- a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py
+++ b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py
@@ -83,7 +83,7 @@ def test_is_llm_api_route():
)
assert (
RouteChecks.is_llm_api_route(
- "/openai/deployments/anthropic/claude-3-5-sonnet-20240620/chat/completions"
+ "/openai/deployments/anthropic/claude-sonnet-4-5-20250929/chat/completions"
)
is True
)
diff --git a/tests/test_litellm/test_cost_calculator.py b/tests/test_litellm/test_cost_calculator.py
index 7ee5a6855a6..3490650ff84 100644
--- a/tests/test_litellm/test_cost_calculator.py
+++ b/tests/test_litellm/test_cost_calculator.py
@@ -161,7 +161,7 @@ def test_custom_pricing_with_router_model_id():
{
"model_name": "prod/claude-3-5-sonnet-20240620",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
"api_key": "test_api_key",
},
"model_info": {
@@ -175,7 +175,7 @@ def test_custom_pricing_with_router_model_id():
{
"model_name": "claude-3-5-sonnet-20240620",
"litellm_params": {
- "model": "anthropic/claude-3-5-sonnet-20240620",
+ "model": "anthropic/claude-sonnet-4-5-20250929",
"api_key": "test_api_key",
},
"model_info": {
@@ -204,7 +204,7 @@ def test_custom_pricing_with_router_model_id():
)
model_info = router.get_deployment_model_info(
- model_id="my-unique-model-id", model_name="anthropic/claude-3-5-sonnet-20240620"
+ model_id="my-unique-model-id", model_name="anthropic/claude-sonnet-4-5-20250929"
)
assert model_info is not None
assert model_info["input_cost_per_token"] == 0.000006