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]

vertex forward all headers from vertex

Ishaan Jaff50014aa78eb9
diff --git a/litellm/proxy/tests/test_vertex_sdk_forward_headers.py b/litellm/proxy/tests/test_vertex_sdk_forward_headers.py
index b291be438ca..0799ef8eb8b 100644
--- a/litellm/proxy/tests/test_vertex_sdk_forward_headers.py
+++ b/litellm/proxy/tests/test_vertex_sdk_forward_headers.py
@@ -11,4 +11,6 @@ vertexai.init(
)
model = GenerativeModel(model_name="gemini-1.0-pro")
-model.generate_content("hi")
+response = model.generate_content("hi")
+
+print("response", response)
diff --git a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py
index fe1f46bda41..9b87823e309 100644
--- a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py
+++ b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py
@@ -102,10 +102,7 @@ async def vertex_proxy_route(
vertex_location = match.group(1) if match else None
base_target_url = f"https://{vertex_location}-aiplatform.googleapis.com/"
headers.pop("content-length", None)
- _new_headers = {
- "Authorization": headers.get("authorization"),
- }
- headers = _new_headers
+ headers.pop("host", None)
else:
vertex_project = default_vertex_config.get("vertex_project")
vertex_location = default_vertex_config.get("vertex_location")