From 7d23106fcfaf304045a3ce976b50d0783f807215 Mon Sep 17 00:00:00 2001 From: Chesars Date: Mon, 2 Mar 2026 19:15:37 -0300 Subject: [PATCH] fix(helicone): correct provider URL for Vertex AI Gemini models Reorder elif branches so is_vertex_ai is checked before "gemini" in model. Previously, Vertex AI Gemini models (e.g. vertex_ai/gemini-2.5-flash) matched the "gemini" substring check first and were logged with the Google AI Studio URL instead of the Vertex AI URL. --- litellm/integrations/helicone.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/integrations/helicone.py b/litellm/integrations/helicone.py index c77a1b2564a..51e6699c5f4 100644 --- a/litellm/integrations/helicone.py +++ b/litellm/integrations/helicone.py @@ -167,12 +167,12 @@ class HeliconeLogger: if "claude" in model and not is_vertex_ai: url = f"{self.api_base}/anthropic/v1/log" provider_url = "https://api.anthropic.com/v1/messages" - elif "gemini" in model: - url = f"{self.api_base}/custom/v1/log" - provider_url = "https://generativelanguage.googleapis.com/v1beta" elif is_vertex_ai: url = f"{self.api_base}/custom/v1/log" provider_url = "https://aiplatform.googleapis.com/v1" + elif "gemini" in model: + url = f"{self.api_base}/custom/v1/log" + provider_url = "https://generativelanguage.googleapis.com/v1beta" headers = { "Authorization": f"Bearer {self.key}", "Content-Type": "application/json",