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
use ssml with litellm vertex
Ishaan Jaff043919b27856
diff --git a/docs/my-website/docs/providers/vertex.md b/docs/my-website/docs/providers/vertex.mdindex 697aa0701ed..8912133b8b5 100644--- a/docs/my-website/docs/providers/vertex.md+++ b/docs/my-website/docs/providers/vertex.md@@ -1768,7 +1768,7 @@ LiteLLM supports calling [Vertex AI Text to Speech API](https://console.cloud.go-Usage+### Usage - Basic<Tabs><TabItem value="sdk" label="SDK">@@ -1841,6 +1841,61 @@ print("response from proxy", response)</Tabs>+### Usage - `ssml` as input+++<Tabs>+<TabItem value="sdk" label="SDK">++Vertex AI does not support passing a `model` param - so passing `model=vertex_ai/` is the only required param++**Sync Usage**++```python+speech_file_path = Path(__file__).parent / "speech_vertex.mp3"+response = litellm.speech(+ input=None,+ model="vertex_ai/test",+ ssml="async hello what llm guardrail do you have",+ voice={+ "languageCode": "en-UK",+ "name": "en-UK-Studio-O",+ },+ audioConfig={+ "audioEncoding": "LINEAR22",+ "speakingRate": "10",+ },+)+response.stream_to_file(speech_file_path)+```++</TabItem>++<TabItem value="proxy" label="LiteLLM PROXY (Unified Endpoint)">++```python+import openai++client = openai.OpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000")++# see supported values for "voice" on vertex here:+# https://console.cloud.google.com/vertex-ai/generative/speech/text-to-speech+response = client.audio.speech.create(+ model = "vertex-tts",+ input=None, # pass as None since OpenAI SDK requires this param+ voice={'languageCode': 'en-US', 'name': 'en-US-Studio-O'},+ extra_body={+ "ssml": "async hello what llm guardrail do you have"+ }+)+print("response from proxy", response)+```++</TabItem>+</Tabs>+++## Extra### Using `GOOGLE_APPLICATION_CREDENTIALS`