Anva avatars for LiveKit Agents
Give your LiveKit voice agent a face. The agent keeps its own STT, LLM and TTS; Anva joins the room as a second participant and speaks the agent's words with the lips in time, video and audio published together.
pip install livekit-plugins-anva
from livekit import agents, rtc
from livekit.agents import Agent, AgentSession
from livekit.plugins import anva, deepgram, openai, silero
async def entrypoint(ctx: agents.JobContext):
session = AgentSession(
stt=deepgram.STT(), llm=openai.LLM(), tts=openai.TTS(), vad=silero.VAD.load(),
)
avatar = anva.AvatarSession(avatar_id="av_...") # or preset_id="..."
await avatar.start(session, room=ctx.room)
await session.start(agent=Agent(instructions="You are a friendly guide."), room=ctx.room)
Set ANVA_API_KEY (from anva.ai → API keys) and the usual LIVEKIT_URL,
LIVEKIT_API_KEY and LIVEKIT_API_SECRET. ANVA_AVATAR_ID can stand in for
avatar_id.
What happens
start()mints a room token for the avatar participant (kindagent, attributelk.publish_on_behalfnaming your agent) and asks Anva to create anavatar_onlysession that joins your room with it. Anva answers once the avatar is in the room with its video and audio tracks published.- The agent's audio output is replaced by LiveKit's
DataStreamAudioOutput, so speech goes to the avatar over the room's data stream rather than straight to the room. Interruptions and playback receipts use LiveKit's standardlk.clear_buffer,lk.playback_startedandlk.playback_finishedRPCs. aclose()(called for you when the job shuts down) ends the Anva session.
Billing is Anva's avatar_only rate per connected minute. The audio can be any
sample rate and channel count; Anva converts it to what its lip-sync takes.
Options
| Argument | Meaning |
|---|---|
avatar_id / preset_id |
Exactly one. A preset's voice and prompt do not apply: the agent speaks. |
api_key, api_url |
Anva API key and base URL (https://anva.ai). |
avatar_participant_identity, avatar_participant_name |
Defaults anva-avatar, Anva avatar. |
max_duration_seconds |
End the Anva session this long after it goes live. |
metadata |
Echoed on Anva's session and webhooks. |
conn_options |
LiveKit APIConnectOptions: retries and timeouts for the Anva call. |
A 400 from Anva (wrong mode, bad avatar, plan limits) raises AnvaException
without retrying; a 503 no_capacity is retried after Anva's Retry-After.
Front end
Your front end sees two agent participants. LiveKit's components pick the
avatar's tracks automatically; by hand, it is the participant whose
lk.publish_on_behalf attribute equals your agent's identity.
Tests
livekit-server --dev &
LIVEKIT_TEST_URL=ws://127.0.0.1:7880 python -m pytest tests
Metadata
Release files for livekit-plugins-anva 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| livekit_plugins_anva-0.1.0.tar.gz | 5.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| livekit_plugins_anva-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / livekit_plugins_anva-0.1.0.tar.gz
| Download URL | livekit_plugins_anva-0.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dea06a48d818934952d80042667bf9553a3a07e8eea7e232e89da844c188b47e
|
|
BLAKE2b-256 checksum How to use checksums |
2f940bf5b1219e404306da5014fcb31ad160cccc5cc9990c291444309da55dd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / livekit_plugins_anva-0.1.0-py3-none-any.whl
| Download URL | livekit_plugins_anva-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
630a544b98df884a013e48ff779a73f1700a267553ee41973161935976a37018
|
|
BLAKE2b-256 checksum How to use checksums |
73b4dddead6f449d99d07885713aaf5351114e8a7b5b0a52492ae6ba12b1fc62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for livekit-plugins-anva 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.