Overview
TruGen enables developers and enterprises to build realtime AI video applications that support low-latency, bidirectional audio and video interactions between users and AI agents. You can use the open source TruGen integration for LiveKit Agents to add realtime avatars to your voice AI app.
Quick reference
This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.
Installation
Install the plugin from PyPI:
uv add "livekit-agents[trugen]~=1.4"
Authentication
The TruGen.AI plugin requires a TruGen API key.
Set TRUGEN_API_KEY in your .env file.
Usage
Use the plugin in an AgentSession. For example, you can use this avatar in the Voice AI quickstart.
from livekit import agentsfrom livekit.agents import AgentServer, AgentSessionfrom livekit.plugins import trugenserver = AgentServer()@server.rtc_session()async def my_agent(ctx: agents.JobContext):session = AgentSession(# ... stt, llm, tts, etc.)avatar = trugen.AvatarSession(avatar_id="...", # ID of the TruGen stock avatar to use)# Start the avatar and wait for it to joinawait avatar.start(session, room=ctx.room)# Start your agent session with the userawait session.start(# ... room, agent, room_options, etc....)
Preview the avatar in the Agents Playground or a frontend starter app that you build.
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
stringOptionalDefault: 7d881c1bID of the TruGen stock avatar to use. Learn more at Stock Avatars.
stringOptionalDefault: trugen-avatarThe identity of the participant to use for the avatar.
stringOptionalDefault: Trugen AvatarThe name of the participant to use for the avatar.
Additional resources
The following resources provide more information about using TruGen.AI realtime avatars with LiveKit Agents.
Python package
The livekit-plugins-trugen package on PyPI.
Plugin reference
Reference for the TruGen realtime avatar plugin.
GitHub repo
View the source or contribute to the LiveKit Trugen realtime avatar plugin.
TruGen.AI docs
TruGen.AI Docs
Agents Playground
A virtual workbench to test your avatar agent.
Frontend starter apps
Ready-to-use frontend apps with avatar support.