This commit is contained in:
Ishaan Jaff 2024-08-23 18:29:36 -07:00
parent 80e95b4ccf
commit a7bcc0e88e
2 changed files with 35 additions and 35 deletions

View file

@ -327,6 +327,39 @@ response = litellm.completion(
print(response) print(response)
``` ```
## Azure Text to Speech (tts)
**LiteLLM PROXY**
```yaml
- model_name: azure/tts-1
litellm_params:
model: azure/tts-1
api_base: "os.environ/AZURE_API_BASE_TTS"
api_key: "os.environ/AZURE_API_KEY_TTS"
api_version: "os.environ/AZURE_API_VERSION"
```
**LiteLLM SDK**
```python
from litellm import completion
## set ENV variables
os.environ["AZURE_API_KEY"] = ""
os.environ["AZURE_API_BASE"] = ""
os.environ["AZURE_API_VERSION"] = ""
# azure call
speech_file_path = Path(__file__).parent / "speech.mp3"
response = speech(
model="azure/<your-deployment-name",
voice="alloy",
input="the quick brown fox jumped over the lazy dogs",
)
response.stream_to_file(speech_file_path)
```
## Advanced ## Advanced
### Azure API Load-Balancing ### Azure API Load-Balancing

View file

@ -82,43 +82,10 @@ litellm --config /path/to/config.yaml
| Provider | Link to Usage | | Provider | Link to Usage |
|-------------|--------------------| |-------------|--------------------|
| OpenAI | | | OpenAI | [Usage](#quick-start) |
| Azure OpenAI| | | Azure OpenAI| [Usage](../docs/providers/azure#azure-text-to-speech-tts) |
| Vertex AI | [Usage](../docs/providers/vertex#text-to-speech-apis) | | Vertex AI | [Usage](../docs/providers/vertex#text-to-speech-apis) |
## Azure Usage
**PROXY**
```yaml
- model_name: azure/tts-1
litellm_params:
model: azure/tts-1
api_base: "os.environ/AZURE_API_BASE_TTS"
api_key: "os.environ/AZURE_API_KEY_TTS"
api_version: "os.environ/AZURE_API_VERSION"
```
**SDK**
```python
from litellm import completion
## set ENV variables
os.environ["AZURE_API_KEY"] = ""
os.environ["AZURE_API_BASE"] = ""
os.environ["AZURE_API_VERSION"] = ""
# azure call
speech_file_path = Path(__file__).parent / "speech.mp3"
response = speech(
model="azure/<your-deployment-name",
voice="alloy",
input="the quick brown fox jumped over the lazy dogs",
)
response.stream_to_file(speech_file_path)
```
## ✨ Enterprise LiteLLM Proxy - Set Max Request File Size ## ✨ Enterprise LiteLLM Proxy - Set Max Request File Size
Use this when you want to limit the file size for requests sent to `audio/transcriptions` Use this when you want to limit the file size for requests sent to `audio/transcriptions`