Overview
LiveKitTransport
provides real-time audio communication capabilities using LiveKit’s open-source WebRTC platform. It supports bidirectional audio streaming, data messaging, participant management, and room event handling for conversational AI applications with the flexibility of self-hosted or cloud infrastructure.
LiveKitTransport API Reference
Pipecat’s API methods for LiveKit integration
Example Implementation
Complete LiveKit voice agent example
LiveKit Documentation
Official LiveKit API documentation and guides
LiveKit Cloud
Sign up for hosted LiveKit service
Installation
To use LiveKitTransport, install the required dependencies:Prerequisites
LiveKit Setup
Before using LiveKitTransport, you need:- LiveKit Server: Set up self-hosted or use LiveKit Cloud
- API Credentials: Generate API key and secret from your LiveKit project
- Room Management: Create rooms using LiveKit API or SDK
- Access Tokens: Generate JWT tokens for room authentication
Required Environment Variables
LIVEKIT_API_KEY
: Your LiveKit API key for authenticationLIVEKIT_API_SECRET
: Your LiveKit API secret for token generationLIVEKIT_URL
: Your LiveKit server URL (wss://your-domain.livekit.cloud)
Key Features
- Open Source: Self-hosted or cloud-hosted WebRTC infrastructure
- Multi-participant Support: Handle multiple participants in rooms
- Data Channels: Real-time messaging alongside audio streams
- Room Management: Dynamic participant and room lifecycle management
- Flexible Deployment: Self-hosted or managed cloud options
Usage
LiveKitTransport connects your Pipecat bot to LiveKit rooms where it can communicate with participants through audio and data channels. The transport handles room joining, participant events, and media streaming automatically. See the complete example for a full implementation including:- LiveKit room creation and token generation
- Transport configuration with participant management
- Pipeline integration with audio processing
- Event handling for room lifecycle management