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
add test_audio_speech_litellm_vertex
Ishaan Jaff960a141884e8
diff --git a/litellm/tests/speech_vertex.mp3 b/litellm/tests/speech_vertex.mp3new file mode 100644index 00000000000..c676110335eBinary files /dev/null and b/litellm/tests/speech_vertex.mp3 differdiff --git a/litellm/tests/test_audio_speech.py b/litellm/tests/test_audio_speech.pyindex 285334f7ef4..5e0cf607796 100644--- a/litellm/tests/test_audio_speech.py+++ b/litellm/tests/test_audio_speech.py@@ -117,3 +117,39 @@ async def test_audio_speech_router(mode):from litellm.llms.openai import HttpxBinaryResponseContentassert isinstance(response, HttpxBinaryResponseContent)+++ "sync_mode",+ [False],+)+async def test_audio_speech_litellm_vertex(sync_mode):+ litellm.set_verbose = True+ speech_file_path = Path(__file__).parent / "speech_vertex.mp3"+ model = "vertex_ai/test"+ if sync_mode:+ response = litellm.speech(+ model=model,+ voice="alloy",+ input="hello what llm guardrail do you have",+ )++ from types import SimpleNamespace++ from litellm.llms.openai import HttpxBinaryResponseContent++ response.stream_to_file(speech_file_path)++ else:+ response = await litellm.aspeech(+ model=model,+ voice="alloy",+ input="async hello what llm guardrail do you have",+ )++ from types import SimpleNamespace++ from litellm.llms.openai import HttpxBinaryResponseContent++ response.stream_to_file(speech_file_path)