Skip to main content
This guide provides instructions for integrating LiveKit with the TrueFoundry AI Gateway for real-time AI voice and video applications.

What is LiveKit?

LiveKit is an open-source platform for building real-time audio and video applications with AI agents. With TrueFoundry AI Gateway integration, you can route your LiveKit AI agent requests through the Gateway for enhanced security, cost tracking, and access controls.

Key Features of LiveKit

  1. Real-Time Multimodal AI Agents: LiveKit enables building conversational AI experiences with sub-100ms latency for voice and video interactions. Stream audio and video between AI models and users in real-time, creating natural, responsive AI agent conversations with minimal delay.
  2. Scalable WebRTC Infrastructure: It can handle everything from small applications to enterprise-scale deployments with thousands of concurrent participants. The platform provides robust networking with speaker detection, simulcast, and end-to-end encryption.
  3. Comprehensive SDK Ecosystem: Offers modern, full-featured client SDKs across all major platforms with consistent APIs and extensive documentation. The platform includes first-class support for integrating AI models, STT, TTS, and real-time APIs, making it easy to build sophisticated AI-powered applications.

Prerequisites

Before integrating LiveKit with TrueFoundry, ensure you have:
  1. TrueFoundry Account: Create a TrueFoundry account and follow the instructions in our Gateway Quick Start Guide
  2. LiveKit Account: Set up a LiveKit Cloud account or deploy LiveKit server
  3. Python Environment: Python 3.8+ with pip package manager

Setup Process

Step 1: Install Dependencies

Add to your .env file:
You will get your API key, base URL, and model name directly from the unified code snippet above in the TrueFoundry playground. Copy these values into your .env file as shown.

Step 2: Basic LiveKit Agent with TrueFoundry

Create a simple LiveKit agent that uses TrueFoundry’s AI Gateway:

Step 3: Run Your Agent

That’s it! Your LiveKit agent is now integrated with TrueFoundry Gateway and ready for real-time AI conversations.