careful-tiger-18580
03/02/2026, 7:37 AMtall-airline-16756
03/02/2026, 7:38 AMtall-airline-16756
03/02/2026, 7:38 AM{{metadata.user_name}}, asks for an order number, calls your order API to return status, and summarizes the call. You click “test” in the builder to try the flow, then click “deploy” to make the agent available to inbound calls — no hand-coding required.
Architecture
• What it means: How media is routed and where media servers run.
• Self-hosted: Single-home SFU — each room/session runs on a single server instance that you manage. All participants connect to that same server regardless of their location.
• LiveKit Cloud: Global mesh SFU — sessions are distributed across multiple geographically distributed edge servers; edges interconnect on a private backbone to route media between regions.
• Why it matters: A distributed mesh reduces latency for geographically dispersed participants and enables scaling beyond a single server’s limits.
• Example: Meeting with participants in New York and Tokyo:
◦ Self-hosted: If your server is in Virginia, both NY and Tokyo users connect to that one server. Tokyo users may see higher latency because traffic must travel to/from Virginia.
◦ LiveKit Cloud: New York user connects to a nearby US edge, Tokyo user connects to a Japan edge. Media is routed across the LiveKit backbone between edges with lower end-to-end latency.
Connection model
• What it is: How individual participants establish connections to the infrastructure.
• Self-hosted: Single server per room — every participant connects to the same server that hosts the room. This can create bandwidth or CPU bottlenecks as your room grows.
• LiveKit Cloud: Each user connects to the nearest edge — clients are routed to their closest edge server. The mesh handles inter-edge routing and fan-out so sessions can grow without a single-server bottleneck.
• Why it matters: The connection model affects latency, scale, and resilience (failover).
• Example: A large webinar with 10,000 viewers:
◦ Self-hosted: One server may exhaust upload bandwidth or CPU; scaling requires you to implement your own sharding or relay logic.
◦ LiveKit Cloud: The publisher sends to a local edge; that edge relays to other edges. Load is distributed across the mesh so the same event can reach many viewers with low latency and transparent failover if an edge becomes unhealthy.
If you’d like, I can:
• Walk through a concrete deployment decision for your use case (e.g., region distribution, expected concurrent users, resilience needs).
• Show what the Agent Builder UI flow looks like and which agent features you can configure.
• Explain how you’d migrate an agent created in Agent Builder into a self-hosted environment using the generated Python code.
Which of those would be most helpful next?
Sources: Agent Builder | LiveKit Documentation | Announcing LiveKit Cloud | How We Built a Globally Distributed WebRTC Mesh Networkcareful-tiger-18580
03/02/2026, 7:49 AMtall-airline-16756
03/02/2026, 7:49 AMagent_name so only servers for a specific agent type accept that job.
A) Parallel calls to one agent (single use-case)
• How it connects:
◦ You deploy one agent type (single agent_name). Multiple agent server instances register for that agent_name.
◦ Each incoming room/session becomes a separate job. LiveKit dispatches each job to any available agent server registered for that agent.
• Concurrency model:
◦ A single agent server instance can run many jobs in parallel (each job isolated via JobContext/process).
◦ Load is balanced across available agent server instances (round-robin / distribution).
• Scaling & resilience:
◦ Scale horizontally by adding more agent server instances for that agent. Jobs are automatically distributed.
◦ If one agent server fails, pending jobs will be retried or dispatched to other servers.
• Example:
◦ You have a “customer-support-bot” agent. 200 customers call simultaneously. LiveKit creates 200 jobs. If you run 4 agent server instances and each handles 50 concurrent jobs, calls are spread across them. To handle 400 concurrent calls you add more instances.
B) Multiple agents running simultaneously (multiple use-cases)
• How it connects:
◦ Each agent type has a unique identifier (e.g., survey-agent, drive-thru-agent, triage-agent).
◦ Jobs can be dispatched explicitly for a specific agent_name (API, SIP rules, or token-based configuration).
◦ Only agent servers registered with that agent_name will receive jobs for that agent.
• Concurrency & isolation:
◦ Each agent type maintains its own pool of agent servers and runs jobs independently.
◦ Resource, model choices (STT/LLM/TTS), and runtime can differ per agent type, so one agent’s heavy workload won’t directly starve another.
• Scaling & operational flexibility:
◦ You scale each agent pool independently based on traffic patterns and SLAs.
◦ You can deploy different versions/configurations for each agent without affecting others.
• Example:
◦ During lunch, drive-thru-agent gets a surge while medical-triage-agent remains light. You scale the drive-thru agent server pool up for that period without touching the triage servers. A room configured for drive-thru-agent will only dispatch to servers in that pool.
Comparison summary (quick)
• Single agent, many parallel calls: many jobs routed to the same agent pool → scale by adding more instances of that agent server.
• Multiple agents, many use-cases: jobs routed to targeted agent pools by agent_name → scale and configure each agent pool independently.
Practical notes to guide decisions
• If one agent type will handle the majority of traffic, size and autoscale that agent pool accordingly.
• If different use-cases have different model or latency needs, separate them into different agent_names so you can tune resources independently.
• Use explicit dispatch (API or rules) when you need precise control over which agent runs a session; use broader registration when any agent instance can handle a job.
Would you like a recommended autoscaling strategy (metrics to use, example instance counts) for either: 1) a high-concurrency single-agent deployment, or 2) a multi-agent setup with uneven traffic across agents?
Tell me which scenario (1 or 2) and approximate peak concurrent sessions and I’ll suggest concrete scaling guidance.
Sources: Self-hosted deployments | LiveKit Documentation | Agent dispatch | LiveKit Documentation | Agent server overview | LiveKit Documentation | Agents (Python) | livekit/livekit_composite | DeepWiki | Introduction | LiveKit Documentationcareful-tiger-18580
03/02/2026, 9:33 AMtall-airline-16756
03/02/2026, 9:33 AMload_fnc available for self‑hosted).
• Media configuration: Higher audio sampling rates, additional tracks, or video will raise resource use; turning off unneeded features reduces load.
Concrete evidence and examples
• A recommended starting config is 4 cores + 8 GB RAM; that often supports 10–25 concurrent voice jobs depending on what each job does.
• A load test example showed ~30 agents on a 4‑core/8GB machine peaked at ~3.8 cores and ~2.8GB RAM, indicating CPU is typically the bottleneck as concurrent jobs increase.
What I recommend you do next (practical steps)
1. Share your VM specs (cores, RAM), typical session profile (average call length, use of STT/LLM/TTS, synchronous API calls), and expected peak concurrent sessions — I can give a tighter estimate.
2. Run a focused load test with your actual agent code:
a. Simulate realistic sessions (media + any external API/model calls).
b. Monitor CPU, memory, load average, and response latency.
c. Increase concurrent sessions until CPU or latency becomes unacceptable.
1. Tune: reduce media quality or disable nonessential processing, add model batching or async calls, and adjust agent server `load_fnc`/`load_threshold` to stop accepting new jobs when load is high.
2. Scale horizontally: if one VM hits limits, add more agent server instances and let LiveKit distribute jobs across them.
If you want, tell me:
• Your VM CPU/RAM,
• Whether your agent does STT/LLM/TTS locally or calls external services,
• Expected average session length and peak concurrent sessions you plan for —
and I’ll give a more specific concurrency estimate and a sample load test plan you can run to validate capacity.
Sources: Self-hosted deployments | LiveKit Documentation | An open source stack for real-time multimodal AI | Server options | LiveKit Documentation | Going beyond a single-core | Optimizing Video Calls for Low-Powered Devices in LiveKit (JS SDK ≥ v2.14.0...