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(speech): stop vertex gemini tts from dropping response_format in cloud tts param mapping
mateo-berri35a375e26f99
diff --git a/litellm/utils.py b/litellm/utils.pyindex 5e9e115ed54..e7028301dab 100644--- a/litellm/utils.py+++ b/litellm/utils.py@@ -9409,6 +9409,10 @@ class ProviderConfigManager:return RunwayMLTextToSpeechConfig()elif litellm.LlmProviders.VERTEX_AI == provider:+ if "gemini" in model:+ # Gemini TTS uses the speech_to_completion bridge, and Google Cloud TTS param+ # mapping would drop response_format before the bridge sees it (LIT-6501)+ return Nonefrom litellm.llms.vertex_ai.text_to_speech.transformation import (VertexAITextToSpeechConfig,)diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.pyindex 6524353aa48..935e4c61535 100644--- a/tests/test_litellm/test_utils.py+++ b/tests/test_litellm/test_utils.py@@ -1416,6 +1416,26 @@ def test_get_provider_rerank_config():assert isinstance(config, HostedVLLMRerankConfig)+def test_get_provider_text_to_speech_config_vertex_gemini_skips_cloud_tts():+ """Regression for LIT-6501: mapping vertex Gemini TTS params through Google Cloud TTS+ dropped response_format before the speech_to_completion bridge could honor it."""+ from litellm.llms.vertex_ai.text_to_speech.transformation import VertexAITextToSpeechConfig+ from litellm.utils import LlmProviders++ assert (+ ProviderConfigManager.get_provider_text_to_speech_config(+ model="gemini-2.5-flash-preview-tts", provider=LlmProviders.VERTEX_AI+ )+ is None+ )+ assert isinstance(+ ProviderConfigManager.get_provider_text_to_speech_config(+ model="en-US-Studio-O", provider=LlmProviders.VERTEX_AI+ ),+ VertexAITextToSpeechConfig,+ )++# Models that should be skipped during testingOLD_PROVIDERS = ["aleph_alpha", "palm"]SKIP_MODELS = [