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 vertex ai claude thinking params (#11796)

X4tar2740c8d77d86
diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
index ab0555b070e..5f0fdfd058c 100644
--- a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
+++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
@@ -46,6 +46,9 @@ class VertexAIAnthropicConfig(AnthropicConfig):
Note: Please make sure to modify the default parameters as required for your use case.
"""
+ @property
+ def custom_llm_provider(self) -> Optional[str]:
+ return "vertex_ai"
def transform_request(
self,
diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py
new file mode 100644
index 00000000000..3ea939397c0
--- /dev/null
+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py
@@ -0,0 +1,28 @@
+import sys
+import os
+
+import pytest
+
+sys.path.insert(
+ 0, os.path.abspath("../../../../../..")
+) # Adds the parent directory to the system path
+from litellm.llms.vertex_ai.vertex_ai_partner_models.anthropic.transformation import (
+ VertexAIAnthropicConfig,
+)
+
+
+ "model, expected_thinking",
+ [
+ ("claude-sonnet-4@20250514", True),
+ ],
+)
+def test_vertex_ai_anthropic_thinking_param(model, expected_thinking):
+ supported_openai_params = VertexAIAnthropicConfig().get_supported_openai_params(
+ model=model
+ )
+
+ if expected_thinking:
+ assert "thinking" in supported_openai_params
+ else:
+ assert "thinking" not in supported_openai_params