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]

fix(tests): stabilize 3 failing CI tests

Cursor Agent9a356644bfac
diff --git a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py
index 94004eff3f9..a95b9413b9d 100644
--- a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py
+++ b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py
@@ -1932,16 +1932,16 @@ def test_transform_request_uses_dynamic_max_tokens():
messages = [{"role": "user", "content": "Hello"}]
- # Claude 3.5 model should get 8192 as default max_tokens
+ # Claude 3.7 model should get 64000 as default max_tokens (from model_prices_and_context_window.json)
result = config.transform_request(
- model="claude-3-5-sonnet-20241022",
+ model="claude-3-7-sonnet-20250219",
messages=messages,
optional_params={}, # No max_tokens provided
litellm_params={},
headers={}
)
- assert result["max_tokens"] == 8192
+ assert result["max_tokens"] == 64000
def test_transform_request_respects_user_max_tokens():
@@ -1955,7 +1955,7 @@ def test_transform_request_respects_user_max_tokens():
# User provides explicit max_tokens=1000, should not be overridden
result = config.transform_request(
- model="claude-3-5-sonnet-20241022",
+ model="claude-3-7-sonnet-20250219",
messages=messages,
optional_params={"max_tokens": 1000},
litellm_params={},
diff --git a/tests/test_litellm/llms/gemini/__init__.py b/tests/test_litellm/llms/gemini/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/tests/test_litellm/llms/gemini/image_edit/__init__.py b/tests/test_litellm/llms/gemini/image_edit/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/tests/test_litellm/llms/gemini/realtime/__init__.py b/tests/test_litellm/llms/gemini/realtime/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/tests/test_litellm/llms/vertex_ai/context_caching/test_context_caching_ttl.py b/tests/test_litellm/llms/vertex_ai/context_caching/test_context_caching_ttl.py
index f230d814ae6..250c0947dbb 100644
--- a/tests/test_litellm/llms/vertex_ai/context_caching/test_context_caching_ttl.py
+++ b/tests/test_litellm/llms/vertex_ai/context_caching/test_context_caching_ttl.py
@@ -211,7 +211,7 @@ class TestTransformationWithTTL:
vertex_project="test_project"
result = transform_openai_messages_to_gemini_context_caching(
- model="gemini-1.5-pro",
+ model="gemini-2.5-pro",
messages=messages,
cache_key="test-cache-key",
custom_llm_provider=custom_llm_provider,
@@ -223,9 +223,9 @@ class TestTransformationWithTTL:
assert result["ttl"] == "3600s"
if custom_llm_provider == "gemini":
- assert result["model"] == "models/gemini-1.5-pro"
+ assert result["model"] == "models/gemini-2.5-pro"
else:
- assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-1.5-pro"
+ assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-2.5-pro"
assert result["displayName"] == "test-cache-key"
@@ -250,7 +250,7 @@ class TestTransformationWithTTL:
vertex_project="test_project"
result = transform_openai_messages_to_gemini_context_caching(
- model="gemini-1.5-pro",
+ model="gemini-2.5-pro",
messages=messages,
cache_key="test-cache-key",
custom_llm_provider=custom_llm_provider,
@@ -261,9 +261,9 @@ class TestTransformationWithTTL:
assert "ttl" not in result
if custom_llm_provider == "gemini":
- assert result["model"] == "models/gemini-1.5-pro"
+ assert result["model"] == "models/gemini-2.5-pro"
else:
- assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-1.5-pro"
+ assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-2.5-pro"
assert result["displayName"] == "test-cache-key"
@@ -286,7 +286,7 @@ class TestTransformationWithTTL:
vertex_project="test_project"
result = transform_openai_messages_to_gemini_context_caching(
- model="gemini-1.5-pro",
+ model="gemini-2.5-pro",
messages=messages,
cache_key="test-cache-key",
custom_llm_provider=custom_llm_provider,
@@ -297,9 +297,9 @@ class TestTransformationWithTTL:
assert "ttl" not in result
if custom_llm_provider == "gemini":
- assert result["model"] == "models/gemini-1.5-pro"
+ assert result["model"] == "models/gemini-2.5-pro"
else:
- assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-1.5-pro"
+ assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-2.5-pro"
assert result["displayName"] == "test-cache-key"
@@ -332,7 +332,7 @@ class TestTransformationWithTTL:
vertex_project="test_project"
result = transform_openai_messages_to_gemini_context_caching(
- model="gemini-1.5-pro",
+ model="gemini-2.5-pro",
messages=messages,
cache_key="test-cache-key",
custom_llm_provider=custom_llm_provider,
@@ -345,9 +345,9 @@ class TestTransformationWithTTL:
assert "system_instruction" in result
if custom_llm_provider == "gemini":
- assert result["model"] == "models/gemini-1.5-pro"
+ assert result["model"] == "models/gemini-2.5-pro"
else:
- assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-1.5-pro"
+ assert result["model"] == f"projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/gemini-2.5-pro"
assert result["displayName"] == "test-cache-key"