i tried deploying my livekit agent but when i try ...
# ask-ai
l
i tried deploying my livekit agent but when i try to connect why does it take some time for the avatar and the agent to load?
t
Thanks for reaching out, Computer. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I completely understand how waiting for the avatar and agent to load when deploying a LiveKit agent can feel a bit frustrating. The main reason for this delay is the complexity behind AI-driven video synthesis. Avatar models usually need specialized GPUs and often run on different machines than the agent code. Because of this, the audio from the agent has to travel over a network to a remote server for video generation, which naturally adds some network latency and processing time. Also, the first time you load things up, it might take a little longer due to the initial runtime warmup, especially if you’re using local setups like BitHuman. The good news is that LiveKit has put a lot of thought into optimizing this process with pre-warming strategies, efficient architecture, and improvements in real-time communication to help reduce these delays as much as possible. Still, a bit of loading time is necessary to make sure you get a high-quality, synchronized avatar video experience. Please don’t hesitate to reach out if you have any other questions or if there’s something specific about your setup you’re concerned about—I’m here to help and can offer more tailored advice! Sources: Bringing AI avatars to voice agents | livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/avatar.py
l
but i am talking about the initial 5 dots loading, i am using beyond presence for avatar and i call it using api. so you are telling me, if i remove the avatar will it connect fast? and what is causing this latency?
t
Thank you for your patience! The initial 5 dots loading delay happens because the Beyond Presence avatar session needs a little time to get everything set up and synchronized before the video track is ready to go. During this time, the frontend shows a placeholder UI (those 5 dots) to let you know the agent is active, even though the video isn’t quite available yet. Here’s a quick rundown of what’s happening behind the scenes: • Making an API call to start the Beyond Presence avatar session. • Authenticating with the API key. • Generating a token so the avatar worker can join the LiveKit room. • Connecting the avatar worker to the room and syncing the audio input to generate the video. If you decide to remove the avatar, you’ll probably notice the connection is faster since it skips these avatar-specific setup steps. The delay mainly comes from the remote processing and syncing needed to create and share the avatar video track. Please feel free to reach out if you’d like any more help or have questions about how to optimize your setup — I’m here to help! Sources: Bringing AI avatars to voice agents | Bringing AI avatars to voice agents | Bringing AI avatars to voice agents | examples/avatar_agents/README.md | Beyond Presence virtual avatar integration guide | LiveKit Docs