AvatarSession API — the bridge between your voice pipeline and the avatar server that animates the .hvia file. Two ready-to-run agent patterns are included so you can start with the approach that best fits your architecture.
Agent Patterns
Conversational Agent
Full voice AI pipeline: STT → LLM → TTS → Avaluma Avatar. Powered by LiveKit Inference with AssemblyAI, OpenAI GPT-4.1-mini, and Cartesia Sonic-3.
External Audio
Stream raw PCM audio directly to the avatar via LiveKit DataStream, bypassing the AgentSession pipeline entirely — ideal for custom TTS or audio sources.
How the AvatarSession Works
Both agents rely onAvatarSession from the avaluma-livekit-plugin package. You instantiate it with your credentials, call avatar.start(), and it handles joining the room as a separate avatar participant and forwarding audio frames to the avatar server for rendering.
Choosing a Pattern
Dependencies
All dependencies are declared inpyproject.toml and managed by uv:
pyproject.toml
Prerequisites
Before running either agent, make sure you have the following:Docker & Docker Compose
Both agents ship with a
docker-compose.yaml for zero-config local startup.LiveKit Account
A LiveKit Cloud project or self-hosted instance. You need the URL, API key, and API secret.
Avatar Server
A running
avatar-server instance, or use the hosted endpoint at https://api.avaluma.ai.Avaluma License Key
Your
AVALUMA_LICENSE_KEY from the Avaluma dashboard — passed directly to AvatarSession.