Overview
Tavus provides hyper-realistic interactive avatars for conversational video AI agents. You can use the open source Tavus integration for LiveKit Agents to add virtual avatars to your voice AI app.
Tavus demo
A video showcasing an educational AI agent that uses Tavus to create an interactive study partner.
Installation
uv add "livekit-agents[tavus]~=1.5"
pnpm add @livekit/agents-plugin-tavus
Authentication
The Tavus plugin requires a Tavus API key .
Set TAVUS_API_KEY in your .env file.
Faces and PALs
A Tavus avatar combines a face and a Personified Application Layer (PAL ). The face is the on-screen likeness and voice. The PAL is the conversational configuration: it sets the agent's behavior and the LiveKit transport, and carries a default face. The face overrides the PAL's default face when you set one. Choose each with the face_id and pal_id parameters, or omit either to fall back to a default.
Using faces
By default, the avatar uses the PAL's default face. To use a specific appearance, set face_id to a stock or custom face:
- Browse Tavus's stock faces and copy the ID of one you like.
- Train a custom face from a short video or an image.
Using PALs
By default, the plugin uses a stock PAL already configured for LiveKit Agents, which covers most apps. To define your own conversational configuration, create a PAL and pass its ID as pal_id. A PAL used with LiveKit Agents must set pipeline_mode to echo and define a livekit transport layer. The following curl command creates one using the Create PAL endpoint :
curl --request POST \--url https://tavusapi.com/v2/pals \-H "Content-Type: application/json" \-H "x-api-key: <api-key>" \-d '{"pal_name": "My PAL","default_face_id": "<face-id>","pipeline_mode": "echo","layers": {"transport": {"transport_type": "livekit"}}}'
In Node.js, you can also create a PAL in code with TavusAPI:
import { TavusAPI } from '@livekit/agents-plugin-tavus';const tavus = new TavusAPI(); // reads TAVUS_API_KEYconst palId = await tavus.createPal({ defaultFaceId: '<face-id>' });
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 tavusserver = AgentServer()@server.rtc_session(agent_name="my-agent")async def my_agent(ctx: agents.JobContext):session = AgentSession(# ... stt, llm, tts, etc.)avatar = tavus.AvatarSession(# Both are optional. Omit to use a default stock PAL.face_id="...", # ID of the Tavus face to usepal_id="...", # ID of the Tavus PAL to use (see preceding section for configuration details))# 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....)
import { voice } from '@livekit/agents';import * as tavus from '@livekit/agents-plugin-tavus';const session = new voice.AgentSession({// Add STT, LLM, TTS, and other components here});const avatar = new tavus.AvatarSession({// Both are optional. Omit to use a default stock PAL.faceId: '...', // ID of the Tavus face to usepalId: '...', // ID of the Tavus PAL to use (see preceding section for configuration details)});// Start the avatar and wait for it to joinawait avatar.start(session, room);// Start your agent session with the userawait session.start(// ... room, agent, room_options, etc.);
Preview the avatar in the Agent Console 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.
face_idstringID of the Tavus face to use. Omit to use the default stock PAL's face. See Faces and PALs for details.
pal_idstringID of the Tavus PAL to use. Omit to use a default stock PAL. See Faces and PALs for details.
avatar_participant_namestringDefault: Tavus-avatar-agentThe name of the participant to use for the avatar.
Additional resources
The following resources provide more information about using Tavus with LiveKit Agents.