Overview
TavusVideoService integrates with Tavus to generate AI-powered video avatars that speak your text-to-speech output in real-time. The service takes audio input and produces synchronized video of a realistic avatar speaking, enabling engaging conversational AI experiences with visual presence.
Tavus Video API Reference
Pipecat’s API methods for Tavus video integration
Example Implementation
Complete example with avatar video generation
Tavus Documentation
Official Tavus replica and avatar documentation
Tavus Platform
Create avatars and manage API keys
Installation
To use Tavus services, install the required dependency:Prerequisites
Tavus Account Setup
Before using Tavus video services, you need:- Tavus Account: Sign up at Tavus Platform
- API Key: Generate an API key from your account dashboard
- Replica Creation: Create and train voice replicas for your avatars
- Avatar Selection: Choose or create avatar models for video generation
Required Environment Variables
TAVUS_API_KEY: Your Tavus API key for authenticationTAVUS_REPLICA_ID: ID of your trained voice replica
Configuration
Tavus API key for authentication.
ID of the Tavus voice replica to use for speech synthesis.
ID of the Tavus persona. Defaults to
"pipecat-stream" for Pipecat TTS voice.Async HTTP session used for communication with Tavus.
Usage
Basic Setup
With Custom Persona
Notes
- Dual room architecture: When used with DailyTransport, Tavus creates two virtual rooms — a Tavus room (containing the avatar and the Pipecat bot) and a user room (containing the Pipecat bot and the user).
- Interruption handling: The service handles interruptions by resetting the audio send task and sending an interrupt message to the Tavus client.
- Metrics support: The service supports TTFB metrics tracking using
TTSStartedFrameandBotStartedSpeakingFramesignals.