← Back to PlayBook

Voice to Video • LiveKit • Examples

February 1, 2026

Voice-to-Video LiveKit Plugin

TGTruGen AIintermediate

Overview

In this article, you’ll create a realtime TruGen avatar session using LiveKit.

The avatar is powered by a LiveKit agent worker and configured using environment variables.

What you’ll build

A realtime avatar setup where:

  • LiveKit handles the voice session
  • TruGen renders the avatar
  • Users can speak and receive responses in real time

Prerequisites

  • TruGen API key
  • LiveKit API key, secret, and URL
  • Google API key (or other model provider)
  • Python environment with uv installed

Project setup

1. Clone the example

git clone https://github.com/trugenai/trugen-examples.git
cd trugen-examples/voice-to-video/livekit

2. Configure environment variables

Set the required environment variables:

# TruGen Config
export TRUGEN_API_KEY="..."
export TRUGEN_AVATAR_ID="..."  # optional

# Model config
export GOOGLE_API_KEY="..."

# LiveKit config
export LIVEKIT_API_KEY="..."
export LIVEKIT_API_SECRET="..."
export LIVEKIT_URL="..."

These values configure the avatar, model provider, and LiveKit connection.

3. Choose an Avatar

You can specify an avatar using TRUGEN_AVATAR_ID.

Example IDs:

  • c5b563de → Female
  • 7d881c1b → Female
  • be5b2ce0 → Male
  • 48d778c9 → Male

4. Install dependencies

uv sync

5. Start the agent worker

uv run agent_worker.py dev

This starts the LiveKit agent worker.

6. Test the avatar

Open the LiveKit playground:

https://agents-playground.livekit.io/

Then:

  • Sign in with your LiveKit credentials
  • Click Connect
  • Speak to the avatar

Result

  • A realtime avatar session is created
  • Voice input is processed by the agent
  • The avatar responds in real time

Next steps

  • Customize the agent worker logic
  • Change avatar configuration
  • Use different model providers