livekit/python-sdks

LiveKit real-time and server SDKs for Python

What it solves

This SDK provides the infrastructure to integrate real-time audio, video, and data communication into Python applications. It eliminates the need to build low-level WebRTC infrastructure from scratch, allowing developers to create multi-modal AI agents, live streaming services, and video conferencing tools.

How it works

The project consists of two primary Python packages:

  • livekit: A real-time SDK that allows a Python application to act as a participant in a room, subscribing to and publishing audio/video tracks.
  • livekit-api: A server-side SDK used for administrative tasks such as generating access tokens for authentication and managing rooms via the LiveKit Cloud or a self-hosted server.

It utilizes an underlying Rust SDK for high-performance media handling and supports hardware-accelerated encoding/decoding (via VideoToolbox, VAAPI, and NVENC/NVDEC) to reduce CPU load.

Who it’s for

  • AI Developers: Those building multi-modal AI agents that need to see, hear, and speak in real-time.
  • Application Developers: Developers building live streaming or video call apps using Python.
  • Backend Engineers: Engineers managing session authentication and room orchestration.

Highlights

  • Full Duplex Audio: Supports simultaneous microphone input and speaker output with built-in Acoustic Echo Cancellation (AEC).
  • RPC Capabilities: Allows participants to perform predefined method calls to one another, which is useful for forwarding LLM function calls to clients.
  • Hardware Acceleration: Automatic use of GPU-accelerated codecs (H264, H265) on macOS, Linux (AMD), and Linux (NVIDIA).
  • Comprehensive API: Integrated access to Egress, Ingress, SIP, and Agent Dispatch services.