Skip to main content
Transcribe audio files to text and generate speech from text using any LiteLLM-supported provider (OpenAI Whisper, Deepgram, ElevenLabs, …).

Quick Start

1

Give an Agent a transcription tool

2

Transcribe directly (Whisper default)

3

Generate speech from text

4

Use the async variants

5

Switch providers without changing code


How It Works

Calls route through LiteLLM to the provider that matches your model string.

Configuration Options

transcribe(...) / atranscribe(...)

speech(...) / aspeech(...)

Result objects


Common Patterns

Transcribe → summarise pipeline

Multilingual dubbing

Word-level timestamps for captions


Best Practices

Use whisper-1 for OpenAI parity, deepgram/nova-2 for lower latency, and tts-1-hd when audio fidelity matters more than cost.
Passing language="en" skips detection — faster and more accurate for short clips.
SpeechResult.save("out.mp3") writes the bytes and returns the path — no manual file handling needed.
Pass metadata={"agent_id": ..., "session_id": ...} so LiteLLM callbacks correlate audio calls with an Agent turn.

Capabilities Overview

All LiteLLM parity capabilities

AudioAgent

Higher-level Agent abstraction for audio

Completions

Sibling chat/text completion capability

Audio CLI

Command-line and MCP tool equivalents