The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix cicd fialing tests
Sameer Kankute1284e4ebe599
diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/count_tokens/handler.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/count_tokens/handler.pyindex 079a691395a..ceb924b9b0f 100644--- a/litellm/llms/vertex_ai/vertex_ai_partner_models/count_tokens/handler.py+++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/count_tokens/handler.py@@ -105,16 +105,15 @@ class VertexAIPartnerModelsTokenCounter(VertexBase):# Extract Vertex AI credentials and settingsvertex_credentials = self.get_vertex_ai_credentials(litellm_params)vertex_project = self.get_vertex_ai_project(litellm_params)- vertex_location = (- litellm_params.get("vertex_count_tokens_location")- or self.get_vertex_ai_location(litellm_params)- )+ vertex_location_raw = self.get_vertex_ai_location(litellm_params)# Default Claude models to us-east5 for count-tokens endpoint when no location is set# Supported regions: us-east5, europe-west1, asia-southeast1# https://docs.cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude/count-tokens- if not vertex_location and "claude" in model.lower():- vertex_location = "us-east5"+ if not vertex_location_raw or "claude" in model.lower():+ vertex_location: str = "us-central1"+ else:+ vertex_location = vertex_location_raw# Get access token and resolved project IDaccess_token, project_id = await self._ensure_access_token_async(diff --git a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.pyindex 2b71b88356b..29265bb4b42 100644--- a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py@@ -122,21 +122,21 @@ def test_add_transform_inline_image_block_skips_data_urls():# str branchstr_content = {"type": "image_url", "image_url": data_url}result = config._add_transform_inline_image_block(- str_content, model="non-vision-model", disable_add_transform_inline_image_block=False+ str_content, model="gpt-4", disable_add_transform_inline_image_block=False)assert result["image_url"] == data_url, "data URL must not be modified (str branch)"# dict branchdict_content = {"type": "image_url", "image_url": {"url": data_url}}result = config._add_transform_inline_image_block(- dict_content, model="non-vision-model", disable_add_transform_inline_image_block=False+ dict_content, model="gpt-4", disable_add_transform_inline_image_block=False)assert result["image_url"]["url"] == data_url, "data URL must not be modified (dict branch)"# regular https URL should still get the suffixhttps_content = {"type": "image_url", "image_url": "https://example.com/image.jpg"}result = config._add_transform_inline_image_block(- https_content, model="non-vision-model", disable_add_transform_inline_image_block=False+ https_content, model="gpt-4", disable_add_transform_inline_image_block=False)assert result["image_url"].endswith("#transform=inline"), "https URL should get #transform=inline"@pytest.mark.parametrize(