Merge pull request #2234 from BerriAI/litellm_fix_vertex_project

[FIX] Proxy -  Set different locations per vertex ai deployment on litellm proxy
This commit is contained in:
Ishaan Jaff 2024-02-28 11:06:59 -08:00 committed by GitHub
commit 9124ef60a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1467,12 +1467,12 @@ def completion(
response = model_response
elif custom_llm_provider == "vertex_ai":
vertex_ai_project = (
optional_params.pop("vertex_ai_project", None)
optional_params.pop("vertex_project", None)
or litellm.vertex_project
or get_secret("VERTEXAI_PROJECT")
)
vertex_ai_location = (
optional_params.pop("vertex_ai_location", None)
optional_params.pop("vertex_location", None)
or litellm.vertex_location
or get_secret("VERTEXAI_LOCATION")
)
@ -2566,12 +2566,12 @@ def embedding(
)
elif custom_llm_provider == "vertex_ai":
vertex_ai_project = (
optional_params.pop("vertex_ai_project", None)
optional_params.pop("vertex_project", None)
or litellm.vertex_project
or get_secret("VERTEXAI_PROJECT")
)
vertex_ai_location = (
optional_params.pop("vertex_ai_location", None)
optional_params.pop("vertex_location", None)
or litellm.vertex_location
or get_secret("VERTEXAI_LOCATION")
)