many-fall-81099
11/07/2025, 6:50 PMtall-airline-16756
11/07/2025, 6:50 PMtall-airline-16756
11/07/2025, 6:52 PMAvatarSession class and the proper plugin registration pattern. This helps everything run smoothly.
4. Authentication: Don’t forget to set up your environment variables with the API keys and generate LiveKit tokens for avatar participants. This step is key for secure access.
5. Testing Workflow: When you’re ready, install your plugin in development mode, then initialize an AgentSession and AvatarSession. It’s important to start the avatar session before the agent session to keep things in order.
6. Preview: Finally, test your avatar in the LiveKit Agents Playground or by integrating it with a frontend starter app for a more real-world feel.
If you run into errors about LiveKit not running properly on localhost, here are a few things to double-check:
• Is the LiveKit server running locally and accessible to your setup?
• Have you set all the required environment variables, like your API keys, correctly?
• Are you initializing the avatar session and agent session in the right order in your test script?
Please feel free to reach out if you want me to walk you through any specific step or if you hit any errors—I’m here to help!
Sources: Anam virtual avatar integration guide | LiveKit Docs | plugins/bey/README.md | Virtual avatar plugins | LiveKit Docs | livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/__init__.py | Hedra Realtime Avatar integration guide | LiveKit Docsmany-fall-81099
11/07/2025, 7:01 PMAgentSession and AvatarSession. It’s important to start the avatar session before the agent session to keep things in order.
howtall-airline-16756
11/07/2025, 7:02 PMAgentSession and AvatarSession for your custom plugin together. Here’s a simple step-by-step guide:
1. Initialize the AgentSession: Begin by creating an AgentSession with the AI components you want to use, like STT, LLM, and TTS. Here’s an example to get you started:
session = AgentSession(
stt=..., # e.g., deepgram.STT(), google.STT()
llm=..., # e.g., openai.LLM(), mistral.LLM()
tts=..., # e.g., cartesia.TTS(), azure.TTS()
vad=silero.VAD.load(), # Optional voice activity detection
)
1. Initialize the AvatarSession: Next, create an AvatarSession from your plugin. Here’s an example using bitHuman:
from livekit.plugins import bithuman
avatar = bithuman.AvatarSession(
model_path="./albert_einstein.imx", # Path to avatar model
)
1. Start the AvatarSession: It’s important to start the avatar session before the agent session to make sure audio routing works smoothly. Here’s how you can do that:
await avatar.start(session, room=ctx.room)
1. Start the AgentSession: Finally, start the agent session in the room. For example:
await session.start(
room=ctx.room,
agent=Agent(instructions="Talk to me!"), # Your agent logic
)
Also, please double-check that your environment variables like LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET are set up correctly. If you have any questions or want me to clarify anything, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/avatar.py | Virtual avatar plugins | LiveKit Docs