mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix get_vertex_base_model_name
This commit is contained in:
parent
87b75afe12
commit
bfa7f12d4c
1 changed files with 6 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ from .common_utils import (
|
|||
_get_gemini_url,
|
||||
_get_vertex_url,
|
||||
all_gemini_url_modes,
|
||||
get_vertex_base_model_name,
|
||||
is_global_only_vertex_model,
|
||||
)
|
||||
|
||||
|
|
@ -327,10 +328,13 @@ class VertexBase:
|
|||
# Check if this is a PSC endpoint or custom deployment
|
||||
# PSC/custom endpoints need the full path structure
|
||||
if vertex_project and vertex_location and model:
|
||||
# Strip routing prefixes (bge/, gemma/, etc.) for endpoint URL construction
|
||||
model_for_url = get_vertex_base_model_name(model=model)
|
||||
|
||||
# Check if model is numeric (endpoint ID) or if api_base doesn't contain googleapis.com
|
||||
# These are indicators of PSC/custom endpoints
|
||||
is_psc_or_custom = (
|
||||
"googleapis.com" not in api_base.lower() or model.isdigit()
|
||||
"googleapis.com" not in api_base.lower() or model_for_url.isdigit()
|
||||
)
|
||||
|
||||
if is_psc_or_custom:
|
||||
|
|
@ -342,7 +346,7 @@ class VertexBase:
|
|||
version,
|
||||
vertex_project,
|
||||
vertex_location,
|
||||
model,
|
||||
model_for_url,
|
||||
endpoint,
|
||||
)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue