mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-01 16:21:12 +00:00
test(proxy): add regression tests for vertex passthrough model names with slashes (#19855)
Added test cases for custom model names containing slashes in Vertex AI passthrough URLs (e.g., gcp/google/gemini-2.5-flash). Test cases: - gcp/google/gemini-2.5-flash - gcp/google/gemini-3-flash-preview - custom/model
This commit is contained in:
@@ -356,6 +356,25 @@ def test_get_internal_user_header_from_mapping_no_internal_returns_none():
|
||||
"/openai/deployments/my-deployment/chat/completions",
|
||||
"my-deployment"
|
||||
),
|
||||
# Custom model_name with slashes (e.g., gcp/google/gemini-2.5-flash)
|
||||
# This is the NVIDIA P0 bug fix - regex should capture full model name including slashes
|
||||
(
|
||||
{},
|
||||
"/vertex_ai/v1/projects/my-project/locations/us-central1/publishers/google/models/gcp/google/gemini-2.5-flash:generateContent",
|
||||
"gcp/google/gemini-2.5-flash"
|
||||
),
|
||||
# Another custom model_name with slashes
|
||||
(
|
||||
{},
|
||||
"/vertex_ai/v1/projects/my-project/locations/global/publishers/google/models/gcp/google/gemini-3-flash-preview:generateContent",
|
||||
"gcp/google/gemini-3-flash-preview"
|
||||
),
|
||||
# Model name with single slash
|
||||
(
|
||||
{},
|
||||
"/vertex_ai/v1/projects/my-project/locations/us-central1/publishers/google/models/custom/model:generateContent",
|
||||
"custom/model"
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_get_model_from_request_vertex_ai_passthrough(request_data, route, expected_model):
|
||||
|
||||
Reference in New Issue
Block a user