Awesome
<!--BEGIN_BANNER_IMAGE--> <picture> <source media="(prefers-color-scheme: dark)" srcset="/.github/banner_dark.png"> <source media="(prefers-color-scheme: light)" srcset="/.github/banner_light.png"> <img style="width:100%;" alt="The LiveKit icon, the name of the repository and some sample code in the background." src="https://raw.githubusercontent.com/livekit/agents/main/.github/banner_light.png"> </picture> <!--END_BANNER_IMAGE--> <!--BEGIN_DESCRIPTION--><br /><br /> Looking for the JS/TS library? Check out AgentsJS
✨ NEW ✨
Google Gemini 2.0 support
Introducing support for the new Gemini 2.0 model. Here's an example voice agent running Google STT, TTS, and Gemini 2.0 Flash: code
In-house phrase endpointing model
We’ve trained a new, open weights phrase endpointing model that significantly improves end-of-turn detection and conversational flow between voice agents and users by reducing agent interruptions. Optimized to run on CPUs, it’s available via livekit-plugins-turn-detector package.
What is Agents?
The Agents framework enables you to build AI-driven server programs that can see, hear, and speak in realtime. It offers a fully open-source platform for creating realtime, agentic applications.
Features
- Flexible integrations: A comprehensive ecosystem to mix and match the right models for each use case.
- AI voice agents:
VoicePipelineAgent
andMultimodalAgent
help orchestrate the conversation flow using LLMs and other AI models. - Integrated job scheduling: Built-in task scheduling and distribution with dispatch APIs to connect end users to agents.
- Realtime media transport: Stream audio, video, and data over WebRTC and SIP with client SDKs for most platforms.
- Telephony integration: Works seamlessly with LiveKit's telephony stack, allowing your agent to make calls to or receive calls from phones.
- Exchange data with clients: Use RPCs and other Data APIs to seamlessly exchange data with clients.
- Open-source: Fully open-source, allowing you to run the entire stack on your own servers, including LiveKit server, one of the most widely used WebRTC media servers.
Installation
To install the core Agents library:
pip install livekit-agents
Integrations
The framework includes a variety of plugins that make it easy to process streaming input or generate output. For example, there are plugins for converting text-to-speech or running inference with popular LLMs. Here's how you can install a plugin:
pip install livekit-plugins-openai
Realtime API
We've partnered with OpenAI on a new MultimodalAgent
API in the Agents framework. This class completely wraps OpenAI’s Realtime API, abstracts away the raw wire protocol, and provide an ultra-low latency WebRTC transport between GPT-4o and your users’ devices. This same stack powers Advanced Voice in the ChatGPT app.
- Try the Realtime API in our playground [code]
- Check out our guide to building your first app with this new API
LLM
Provider | Package | Usage |
---|---|---|
OpenAI | livekit-plugins-openai | openai.LLM() |
Azure OpenAI | livekit-plugins-openai | openai.LLM.with_azure() |
Anthropic | livekit-plugins-anthropic | anthropic.LLM() |
Google (Gemini) | livekit-plugins-openai | openai.LLM.with_vertex() |
Cerebras | livekit-plugins-openai | openai.LLM.with_cerebras() |
Groq | livekit-plugins-openai | openai.LLM.with_groq() |
Ollama | livekit-plugins-openai | openai.LLM.with_ollama() |
Perplexity | livekit-plugins-openai | openai.LLM.with_perplexity() |
Together.ai | livekit-plugins-openai | openai.LLM.with_together() |
X.ai (Groq) | livekit-plugins-openai | openai.LLM.with_x_ai() |
STT
Provider | Package | Streaming | Usage |
---|---|---|---|
Azure | livekit-plugins-azure | ✅ | azure.STT() |
Deepgram | livekit-plugins-deepgram | ✅ | deepgram.STT() |
OpenAI (Whisper) | livekit-plugins-openai | openai.STT() | |
livekit-plugins-google | ✅ | google.STT() | |
AssemblyAI | livekit-plugins-assemblyai | assemblyai.STT() | |
Groq (Whisper) | livekit-plugins-openai | openai.STT.with_groq() | |
FAL (Whizper) | livekit-plugins-fal | fal.STT() |
TTS
Provider | Package | Streaming | Voice Cloning | Usage |
---|---|---|---|---|
Cartesia | livekit-plugins-cartesia | ✅ | ✅ | cartesia.TTS() |
ElevenLabs | livekit-plugins-elevenlabs | ✅ | ✅ | elevenlabs.TTS() |
OpenAI | livekit-plugins-openai | openai.TTS() | ||
Azure OpenAI | livekit-plugins-openai | openai.TTS.with_azure() | ||
livekit-plugins-google | ✅ | ✅ | google.TTS() | |
Deepgram | livekit-plugins-deepgram | ✅ | deepgram.TTS() |
Other plugins
Plugin | Description |
---|---|
livekit-plugins-rag | Annoy based simple RAG |
livekit-plugins-llama-index | RAG with LlamaIndex |
livekit-plugins-nltk | Utilities for working with text |
livekit-plugins-vad | Voice activity detection |
livekit-plugins-turn-detector | Conversational turn detection model |
Documentation and guides
Documentation on the framework and how to use it can be found here
Example agents
Description | Demo Link | Code Link |
---|---|---|
A basic voice agent using a pipeline of STT, LLM, and TTS | demo | code |
Voice agent using the new OpenAI Realtime API | demo | code |
Super fast voice agent using Cerebras hosted Llama 3.1 | demo | code |
Voice agent using Cartesia's Sonic model | demo | code |
Agent that looks up the current weather via function call | N/A | code |
Voice Agent using Gemini 2.0 Flash | N/A | code |
Voice agent with custom turn-detection model | N/A | code |
Voice agent that performs a RAG-based lookup | N/A | code |
Video agent that publishes a stream of RGB frames | N/A | code |
Transcription agent that generates text captions from a user's speech | N/A | code |
A chat agent you can text who will respond back with generated speech | N/A | code |
Localhost multi-agent conference call | N/A | code |
Moderation agent that uses Hive to detect spam/abusive video | N/A | code |
Contributing
The Agents framework is under active development in a rapidly evolving field. We welcome and appreciate contributions of any kind, be it feedback, bugfixes, features, new plugins and tools, or better documentation. You can file issues under this repo, open a PR, or chat with us in LiveKit's Slack community.
<!--BEGIN_REPO_NAV--><br/><table>
<thead><tr><th colspan="2">LiveKit Ecosystem</th></tr></thead> <tbody> <tr><td>Realtime SDKs</td><td><a href="https://github.com/livekit/client-sdk-js">Browser</a> · <a href="https://github.com/livekit/client-sdk-swift">iOS/macOS/visionOS</a> · <a href="https://github.com/livekit/client-sdk-android">Android</a> · <a href="https://github.com/livekit/client-sdk-flutter">Flutter</a> · <a href="https://github.com/livekit/client-sdk-react-native">React Native</a> · <a href="https://github.com/livekit/rust-sdks">Rust</a> · <a href="https://github.com/livekit/node-sdks">Node.js</a> · <a href="https://github.com/livekit/python-sdks">Python</a> · <a href="https://github.com/livekit/client-sdk-unity">Unity</a> · <a href="https://github.com/livekit/client-sdk-unity-web">Unity (WebGL)</a></td></tr><tr></tr> <tr><td>Server APIs</td><td><a href="https://github.com/livekit/node-sdks">Node.js</a> · <a href="https://github.com/livekit/server-sdk-go">Golang</a> · <a href="https://github.com/livekit/server-sdk-ruby">Ruby</a> · <a href="https://github.com/livekit/server-sdk-kotlin">Java/Kotlin</a> · <a href="https://github.com/livekit/python-sdks">Python</a> · <a href="https://github.com/livekit/rust-sdks">Rust</a> · <a href="https://github.com/agence104/livekit-server-sdk-php">PHP (community)</a></td></tr><tr></tr> <tr><td>UI Components</td><td><a href="https://github.com/livekit/components-js">React</a> · <a href="https://github.com/livekit/components-android">Android Compose</a> · <a href="https://github.com/livekit/components-swift">SwiftUI</a></td></tr><tr></tr> <tr><td>Agents Frameworks</td><td><b>Python</b> · <a href="https://github.com/livekit/agents-js">Node.js</a> · <a href="https://github.com/livekit/agent-playground">Playground</a></td></tr><tr></tr> <tr><td>Services</td><td><a href="https://github.com/livekit/livekit">LiveKit server</a> · <a href="https://github.com/livekit/egress">Egress</a> · <a href="https://github.com/livekit/ingress">Ingress</a> · <a href="https://github.com/livekit/sip">SIP</a></td></tr><tr></tr> <tr><td>Resources</td><td><a href="https://docs.livekit.io">Docs</a> · <a href="https://github.com/livekit-examples">Example apps</a> · <a href="https://livekit.io/cloud">Cloud</a> · <a href="https://docs.livekit.io/home/self-hosting/deployment">Self-hosting</a> · <a href="https://github.com/livekit/livekit-cli">CLI</a></td></tr> </tbody> </table> <!--END_REPO_NAV-->