wooden-librarian-60399
10/10/2025, 2:24 AMtall-airline-16756
10/10/2025, 2:24 AMtall-airline-16756
10/10/2025, 2:24 AMprewarm function in the LiveKit Agents framework. The prewarm function helps preload models and data into memory before a job even starts, which really cuts down on cold start latency.
Here’s a simple way to get it going:
• Create a prewarm function that loads resources such as voice activity detection (VAD) models or any external data you need.
• Pass this prewarm function to WorkerOptions when you start the agent.
• Use the num_idle_processes parameter in WorkerOptions to control how many idle warm processes you want. For example, setting num_idle_processes=3 keeps three processes warm and ready to jump in.
This way, your agent will be all warmed up and ready to respond right away when a call comes in. If you’d like, I’m here to help with any part of the setup or to provide more details!
Sources: agent/main.py | examples/voice_agents/multi_agent.py | External data and RAG | LiveKit Docs | Worker options | LiveKit Docswooden-librarian-60399
10/10/2025, 2:31 AMtall-airline-16756
10/10/2025, 2:31 AMagent_name field in WorkerOptions when defining your agent. This turns on explicit dispatch and turns off automatic dispatch.
• Dispatch via API: Use the AgentDispatchService API to explicitly dispatch the agent while generating the user’s access token. This makes sure the agent joins the room as soon as the user does.
• Room Creation: Don’t worry about the room—it’s created automatically during dispatch if it doesn’t already exist.
This method works really well if you want your agent ready and waiting as soon as the caller is transferred. If you’d like, I’m here to help with more details or even some code examples tailored to your setup!
Sources: livekit-api/livekit/api/agent_dispatch_service.py | src/main/kotlin/io/livekit/server/AgentDispatchServiceClient.kt | pkg/agent/client.go | Web and mobile frontends | LiveKit Docs | Agent dispatch | LiveKit Docs