From 50014aa78eb9ea8c3da29e919e32c50093836174 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 30 Aug 2024 11:05:23 -0700 Subject: [PATCH] vertex forward all headers from vertex --- litellm/proxy/tests/test_vertex_sdk_forward_headers.py | 4 +++- litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/tests/test_vertex_sdk_forward_headers.py b/litellm/proxy/tests/test_vertex_sdk_forward_headers.py index b291be438c..0799ef8eb8 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 fe1f46bda4..9b87823e30 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")