livekit README

The project's README from github.com/livekit/livekit. As one markdown file: README.md.

The LiveKit icon, the name of the repository and some sample code in the background.

LiveKit: Realtime infrastructure for voice, video, and AI agents

LiveKit is an open source platform for building voice, video, and physical AI agents. This repository is the LiveKit server: a scalable, distributed WebRTC SFU that moves realtime audio, video, and data between people, devices, and AI models. The SDKs, agents frameworks, and companion services are linked in the table at the bottom of this page.

LiveKit's server is written in Go, using the awesome Pion WebRTC implementation.

GitHub stars Slack community Twitter Follow Ask DeepWiki GitHub release (latest SemVer) GitHub Workflow Status License

[!IMPORTANT] If you're building Voice AI, LiveKit Agents is the SDK for code-first realtime voice agents. STT, LLM, TTS, turn detection, expressive speech, keyterm accuracy, tool usage, and telephony all come bundled in the framework. It's available in both Python and Node.js.

# agent.py
from livekit import agents
from livekit.agents import Agent, AgentServer, AgentSession, STTContextOptions, TurnHandlingOptions, inference

server = AgentServer()


@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
    session = AgentSession(
        stt=inference.STT(model="deepgram/nova-3", language="multi"),
        llm=inference.LLM(model="google/gemma-4-31b-it"),
        tts=inference.TTS(model="inworld/inworld-tts-2", voice="Ashley"),
        turn_handling=TurnHandlingOptions(turn_detection=inference.TurnDetector()),
        stt_context_options=STTContextOptions(keyterms=["LiveKit", "Acme Corp"]),
        expressive=True,
    )
    await session.start(room=ctx.room, agent=Agent(instructions="You are a helpful voice AI assistant."))
    await session.generate_reply(instructions="Greet the user and offer your assistance.")


if __name__ == "__main__":
    agents.cli.run_app(server)

Models come from LiveKit Inference with no per-provider API keys, and LiveKit Cloud handles deployment and observability. Visit the docs for more info at docs.livekit.io/agents.

Used in production by

LiveKit carries billions of calls a year for companies including Salesforce, Nvidia, Oracle, SAP, Deutsche Telekom, Spotify, Tinder, Coursera, Headspace, Skydio, Retell, Decagon, Cresta, and HeyGen. Read how Assort Health, Playback, and Polymath Robotics use it, or see more customers.

Features

Documentation & Guides

https://docs.livekit.io

Working with a coding agent? Give it the LiveKit Docs MCP server, or start with the coding agents guide.

Live Demos

Install

[!TIP] We recommend installing LiveKit CLI along with the server. It lets you access server APIs, create tokens, generate test traffic, and scaffold and deploy agents.

The following will install LiveKit's media server:

MacOS

brew install livekit

Linux

curl -sSL https://get.livekit.io | bash

Windows

Download the latest release here

Getting Started

Starting LiveKit

Start LiveKit in development mode by running livekit-server --dev. It'll use a placeholder API key/secret pair.

API Key: devkey
API Secret: secret

To customize your setup for production, refer to our deployment docs

Creating access token

A user connecting to a LiveKit room requires an access token. Access tokens (JWT) encode the user's identity and the room permissions they've been granted. You can generate a token with our CLI:

lk token create \
    --api-key devkey --api-secret secret \
    --join --room my-first-room --identity user1 \
    --valid-for 24h

Test with example app

Head over to our example app and enter a generated token to connect to your LiveKit server.

Once connected, your video and audio are now being published to your new LiveKit instance!

Simulating a test publisher

lk room join \
    --url ws://localhost:7880 \
    --api-key devkey --api-secret secret \
    --identity bot-user1 \
    --publish-demo \
    my-first-room

This command publishes a looped demo video to a room. Due to how the video clip was encoded (keyframes every 3s), there's a slight delay before the browser has sufficient data to begin rendering frames. This is an artifact of the simulation.

Adding an agent

Agents join rooms as participants, the same way a browser or a phone does. Follow the Voice AI quickstart to build one. An agent connects to a self-hosted server the same way it connects to LiveKit Cloud; when running without Cloud, use model plugins in place of LiveKit Inference.

Deployment

Use LiveKit Cloud

LiveKit Cloud is the fastest and most reliable way to run LiveKit. It runs in 19+ regions with 99.99% uptime and adds agent hosting, model inference, telephony, and observability on top of the server. The Build plan is free, with no credit card required.

Sign up for LiveKit Cloud.

Self-host

Read our deployment docs for more information. Official Docker images and Helm charts are available.

Building from source

Pre-requisites:

Then run

git clone https://github.com/livekit/livekit
cd livekit
./bootstrap.sh
mage

Contributing

We welcome your contributions toward improving LiveKit! Please join us on Slack or in the Developer Community to discuss your ideas and/or PRs.

License

LiveKit server is licensed under Apache License v2.0.


LiveKit Ecosystem
Agents SDKsPython · Node.js
LiveKit SDKsBrowser · Swift · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL) · ESP32 · C++
Starter AppsPython Agent · TypeScript Agent · React App · SwiftUI App · Android App · Flutter App · React Native App · Web Embed
UI ComponentsReact · Android Compose · SwiftUI · Flutter
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community) · .NET (community)
ResourcesDocs · Docs MCP Server · CLI · LiveKit Cloud
LiveKit Server OSSLiveKit server · Egress · Ingress · SIP
CommunityDeveloper Community · Slack · X · YouTube

livekit (livekit/livekit)

Searching Database…

21.5K ·GitHub
这是什么?LiveKit 是一个开源的实时平台,支持语音、视频和具身 AI。这个仓库是它的服务器:一个可扩展的分布式 WebRTC SFU,在共享房间里的用户、设备和 AI 模型之间转发音频、视频和数据。
这个仓库是整个 LiveKit 平台,还是只是其中一部分?只是服务器这一部分。各种 SDK、Agents 框架、UI 组件和 LiveKit Cloud 都是另外的关联项目;服务器本身用 Go 编写,基于 Pion WebRTC 实现。
我想跑一个服务器试试,该怎么做?在 macOS、Linux 或 Windows 上安装(Windows 下载发行包),最好同时装上 LiveKit CLI,然后运行 livekit-server --dev,就会以开发模式启动,并带一对占位的 API key/secret。
用户要怎么才能获得加入房间的权限?每个参与者都用一个 JWT 访问令牌连接,令牌里包含其身份和房间权限。令牌需要你自己生成,比如用 LiveKit CLI;不需要任何第三方账号。
我自己部署服务器,而不是用 LiveKit Cloud,会有什么不同?Agent 连接自托管服务器的方式和连接 Cloud 一样,但不用 Cloud 的话,你需要把 LiveKit Inference 换成自己的模型插件,并自己负责部署和可观测性。Cloud 在此之上还提供 agent 托管、电话接入和监控。
在写任何代码之前,我可以用什么来测试服务器?LiveKit CLI 可以生成令牌和测试流量,还能向房间发布一段循环播放的演示视频。然后用 LiveKit Meet 示例应用,在浏览器里用生成的令牌加入房间,就能在自己的实例上看到你的音频和视频。
有没有办法在自己搭建语音 agent 之前先体验一下?有,README 里链接了一个在线演示,你可以和一个用 LiveKit Agents 构建的语音 agent 对话,另外还有空间音频和从 OBS Studio 直播的演示。
我想正式部署,而不只是用开发模式,该怎么做?官方提供 Docker 镜像和 Helm charts,部署文档涵盖了从单个二进制文件到分布式多区域集群的各种生产环境方案。从源码构建需要 Go 1.26+。
Creator
livekit
Size
16.6 MB
Stars
21.5K
Age
6y
Commits · 90 Days