Thanks — I hear you: you migrated from LiveKit Cloud to self-hosted and now the bot shows higher latency. I’ll walk through the most likely causes and then ask a few quick questions so we can narrow this down.
Most likely reasons for increased latency after moving to self-hosted
• Geographical placement of your agent relative to AI models (STT/LLM/TTS). LiveKit Cloud co-locates agents and models in the same datacenter and routes over a private backbone. If your self-hosted agent is farther from the model endpoints, round-trip time to the models will increase.
• Network routing and peering. Self-hosted deployments don’t automatically benefit from the global routing and multi-home mesh LiveKit Cloud provides. Public internet hops, poor peering, or lack of proximity to users or model endpoints can add latency.
• Instance type and CPU behavior. Using burstable or undersized instances (for example t3/t4g) can cause high latency or timeouts when CPU credits are exhausted, even if average CPU appears low.
• Model/inference capacity and endpoint congestion. LiveKit Cloud reserves dedicated inference capacity; a self-hosted setup that calls public model endpoints may see higher wait times or contention unless you provision capacity or use closer/managed endpoints.
• Media routing differences. If media is being relayed inefficiently (for example all traffic routed through one distant server rather than a regional peer), that increases end-to-end latency.
Quick diagnostic questions to narrow this down
1. Where is your self-hosted agent deployed (cloud provider + region, or on-prem region)?
2. Which model endpoints are you calling for STT/LLM/TTS (public cloud region, vendor)?
3. What VM/instance types are you using for the agent (CPU/memory)?
4. Is the increased latency only for the bot’s AI processing (STT/LLM/TTS), or also for media/events inside LiveKit (audio/video jitter, packet loss)?
5. Do you see any CPU, memory, or network interface metrics spiking around the latency events?
6. Approximate added latency you’re seeing (ms) and whether it’s consistent or intermittent.
What we can try next (quick actions)
• Temporarily deploy an agent in the same region as the model endpoints or in a region known to be close to users and compare latency.
• Use a non-burstable instance (or larger instance) to rule out CPU credit exhaustion effects.
• Measure round-trip to the model endpoints from your host (ping/traceroute or an HTTP latency test) to spot network hops or high latency.
• Check your model provider’s queueing/throughput—if using public inference endpoints, try a dedicated/provisioned endpoint if available.
• If media route topology is adjustable, test routing a session so traffic stays regional instead of traversing distant relays.
If you share answers to the diagnostic questions above (region, instance type, which models/endpoints, and whether the latency is AI-only or affects media), I’ll suggest the highest-impact next steps and configuration changes to reduce latency.
Sources:
Understand and Improve Agent Latency | LiveKit |
Introducing LiveKit Inference: A unified model interface for voice AI | Liv... |
Understand and Improve Agent Latency | LiveKit |
Announcing LiveKit Cloud | LiveKit |
Announcing LiveKit Cloud | LiveKit, with interactive elements