livekit/agents
Python framework for real-time voice agents over WebRTC and SIP
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
LiveKit Agents is a Python SDK and server-side runtime for programmable participants in LiveKit rooms. AgentServer coordinates job scheduling and dispatch. An entrypoint registered with @server.rtc_session() receives a JobContext and starts an AgentSession against ctx.room. The session manages the interaction; the Agent supplies instructions and tools. A tool can return another agent to hand off control while retaining typed session state in userdata.
The repository separates livekit-agents/ from livekit-plugins/ in a uv workspace. A session can compose STT, LLM, and TTS stages or use a provider's Realtime API. The LiveKit media server handles WebRTC transport separately from the Python agent process. RPCs and Data APIs connect client-side features to the agent, while Python function tools and native MCP integration connect agent logic to external capabilities.
Key Capabilities & Differentiators
The composable voice path can use Deepgram Nova-3 for multilingual transcription, Gemma through LiveKit Inference for language generation, and Cartesia Sonic-3 for synthesis. An alternative uses openai.realtime.RealtimeModel. Voice activity detection and transformer-based semantic turn detection serve different purposes: one detects speech activity, while the other helps determine whether the speaker has finished a turn.
The framework supports inbound and outbound telephony through LiveKit SIP, with examples spanning multi-user transcription, Gemini Live vision, and video avatars. Its session test API can feed input, assert the order of function calls and results, and use a model judge to assess reply intent. These tests cover conversation behavior; validate microphone audio, WebRTC delivery, and SIP routing separately before deploying.
Trade-offs & Limitations
Compared with a direct integration to a single provider's Realtime API, LiveKit Agents adds room-based dispatch, cross-platform WebRTC, SIP, and a shared session abstraction. That extra layer pays off when the same workflow must run across app and phone clients or when STT, LLM, and TTS must be replaceable independently. For one client and one provider, direct integration may be simpler if the application already handles transport and session lifecycle.
A staged pipeline gives each provider a clear role, but it also introduces service boundaries that can affect end-to-end latency, billing, and failure handling. A Realtime API reduces model-side integration points but ties more of the interaction to one provider. Self-hosting the media server and workers shifts capacity planning and operations to your team; it does not relocate hosted inference. Apache-2.0 covers the framework, not every model or service you connect to it.
Hardware & Deployment Guide
Install the Python package with the extras you need, for example pip install "livekit-agents[openai,deepgram,cartesia]". Use python myagent.py console to exercise local audio input and output without a LiveKit media server; configured remote models still need network access. For room-based testing, python myagent.py dev enables hot reload and connects to LiveKit Cloud or a self-hosted LiveKit server with LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET; add provider credentials as required. Use python myagent.py start for production mode.
Size Python workers and self-hosted media infrastructure separately against expected concurrency. Local inference adds model-dependent compute and memory requirements; no fixed GPU or VRAM target applies across configurations. Operationally, 1.9.0 added multi-stage answering-machine detection for screeners, voicemail, IVR, and hold queues, with replies configurable per stage. Version 1.9.1 added an optional first-token timeout to switch LLMs when a connection stays open without yielding text or a tool call.
AgentServer coordinates jobs; @server.rtc_session() binds a session entrypoint to a LiveKit room.openai.realtime.RealtimeModel for the conversational model.AgentSession.run() tests can assert tool calls and judge reply intent.first_token_timeout for stalled LLM output, including during fallback recovery probes.Teams building real-time voice or multimodal applications across web, mobile, and phone that need room dispatch, provider choice, or in-session agent handoffs.
You need only text chat, already have transport and sessions covered with a single-provider integration, or require an offline turnkey stack with no model or media setup.
Quick Start & Installation
pip install "livekit-agents[openai,deepgram,cartesia]"
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| agents ★ | 15.5k | +107 | Python | Apache-2.0 | Python framework for real-time voice agents over WebRTC and SIP |
| openai-agents-python | 31k | +126 | Python | MIT | Embeddable Python SDK for multi-agent orchestration across text, voice, and sand |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| langgraph | 45.8k | +293 | Python | MIT | Python graph orchestration for stateful, resumable agents and workflows |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/livekit/agents.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about agents
How does a client or phone call connect to the Python agent?
@server.rtc_session() starts an AgentSession against ctx.room. Clients join through a LiveKit SDK or connect by phone through LiveKit SIP. Use RPCs or the Data APIs for application data; use Python function tools or MCP for capabilities the agent can invoke.Do the agent workers need a GPU, and how should I size them?
Can I self-host LiveKit Agents in a commercial product?
MODEL_LICENSE, the terms for each selected model and hosted API, and any telephony terms. Self-hosting the worker and media server does not keep audio or transcripts on-premises if the configured providers process them externally.When is LiveKit Agents a better choice than integrating a Realtime API directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy