From 9d40dc7b264f0d517b61043977bb19b55874e372 Mon Sep 17 00:00:00 2001 From: Ankit Jha Date: Thu, 1 Oct 2026 19:42:56 +0530 Subject: [PATCH] perf(google_genai): read only the two location keys instead of dumping every param --- litellm/google_genai/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litellm/google_genai/main.py b/litellm/google_genai/main.py index 3daf43c729e..86f98d856b7 100644 --- a/litellm/google_genai/main.py +++ b/litellm/google_genai/main.py @@ -200,7 +200,12 @@ class GenerateContentHelper: from litellm.llms.vertex_ai.vertex_llm_base import VertexBase explicit_vertex_location: Final = VertexBase.explicit_vertex_ai_location( - MappingProxyType(litellm_params.model_dump(exclude_none=True)) + MappingProxyType( + { + key: getattr(litellm_params, key, None) + for key in ("vertex_location", "vertex_ai_location") + } + ) ) vertex_location_params: Final = ( MappingProxyType({"vertex_location": explicit_vertex_location})