if I am bringing my own models and not using Livek...
# ask-ai
r
if I am bringing my own models and not using Livekit inference models then How would be concurrency determined as every model would have different concurrency limits
t
Thanks for reaching out, Chandan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're correct to expect differences — concurrency for BYO models is determined by the third‑party model/provider you integrate with, not by LiveKit. What that means for you: • Each provider (OpenAI, Anthropic, Google, TogetherAI, Telnyx, etc.) enforces its own concurrency/rate limits (requests per minute, concurrent connections, tokens per minute) tied to your account and plan. • LiveKit acts as the client to those providers; LiveKit does not impose additional concurrency limits on external model calls. • You are responsible for managing API keys, handling provider errors, and implementing retries, backoff, or throttling when you hit provider limits. How to handle this in practice (options): • Query the provider’s docs for exact concurrency/rate limits and design your client to respect them. • Implement a request queue or token-bucket rate limiter in your integration to cap concurrent requests per provider. • Use exponential backoff + retry for 429/throttle responses and surface graceful degradation to users when capacity is reached. • If you use multiple providers, apply per‑provider rate limiting and a global circuit breaker to prevent cascading failures. If you’d like, tell me which providers you plan to use and your expected request volume and I can recommend a specific throttling/queueing strategy. Sources: Anthropic Claude LLM plugin guide | LiveKit Docs | Together AI LLM plugin guide | LiveKit Docs | Fireworks AI LLM plugin guide | LiveKit Docs | Telnyx LLM plugin guide | LiveKit Docs | Perplexity LLM plugin guide | LiveKit Docs
r
Suppose I am making 10 concurrent calls outbound does it means that I need to create 10 different agents and host it on the cloud?
t
You're asking whether 10 concurrent outbound calls require 10 separate agents — short answer: no. What to know: • An "agent" is defined by its
agent_name
. You run one agent type and deploy it as multiple worker instances. • LiveKit load-balances jobs (each call = a job) across workers with the same
agent_name
. • A single worker can handle multiple concurrent calls if it has enough CPU/memory and your agent pipeline is efficient. Practical options to support 10 concurrent calls: • Run one well-provisioned worker sized to handle ~10 concurrent jobs. • Run several smaller worker instances (e.g., 2–3) and let LiveKit distribute the 10 jobs across them. • Implement autoscaling based on job queue depth or resource usage, and use per-provider rate limiting/retries for any BYO model limits. If you tell me your agent's expected CPU/memory per call and whether your models are CPU- or network-bound, I can recommend an initial worker size and a scaling strategy. Sources: Agents Framework | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWiki | Deploying to custom environments | LiveKit docs | examples/bank-ivr | livekit/livekit_composite | DeepWiki | Agent server | LiveKit docs
r
explain to me like i am a 5 year old
t
Think of your agent like a pizza chef in a kitchen. • Each phone call is like an order for a pizza. • You don't need 10 different chefs to make 10 pizzas. One chef can make many pizzas if the kitchen has enough ovens and helpers. • "Workers" are the ovens and helpers. If you have more ovens/helpers, the chef can make more pizzas at the same time. • If you only have one tiny oven, you might add another oven so pizzas don’t wait. So: you only need one kind of chef (one agent). Give them enough ovens/helpers (workers or more resources) and they can handle 10 orders at once.
r
so how do I get more workers ?
t
Good question — here’s how to get more workers, explained simply and practically. What to do (choose one): • Run more instances manually a. Start another copy of your agent program (same
agent_name
). b. Each process becomes a worker and LiveKit will distribute jobs across them. • Use containers + your cloud (recommended) a. Package the agent as a Docker image. b. Deploy multiple replicas (e.g., Docker Compose, ECS, Render). • Use Kubernetes for production autoscaling a. Create a Deployment for your agent image. b. Set replica count or HorizontalPodAutoscaler based on CPU, memory, or custom metrics. • Use LiveKit Cloud for managed scaling (simplest) a. Deploy via the LiveKit CLI/dashboard and set min/max instances. b. LiveKit will scale workers up/down automatically with load. Quick tips: • Keep the same
agent_name
for all workers so they’re grouped. • Start with 2–3 workers for redundancy, then increase as load grows. • Autoscale on CPU, memory, or job queue depth; add retries/backoff for provider limits. • Tell me where you want to run them (local, AWS/GCP, Kubernetes, or LiveKit Cloud) and I’ll give exact commands or a sample manifest. Sources: Agents Framework | livekit/livekit_composite | DeepWiki | Deploying to custom environments | LiveKit docs | Deploy and scale agents on LiveKit Cloud
r
suppose i want to run them on livekit cloud
t
Great — here’s a clear step‑by‑step for running agents (workers) on LiveKit Cloud. What you need • LiveKit project and API key • Docker image of your agent (built to run the agent process) •
agent_name
used by your agent code (same across all instances) Steps to deploy and scale 1. Build your Docker image • Package your agent into a Docker image (ensure it reads the API key and
agent_name
from env). 1. Log in / configure CLI • Use the LiveKit CLI and set your project and API key (CLI will prompt or accept env vars). 1. Deploy with desired replicas (example) • Deploy your agent image and set replica count (workers). • Example CLI pattern: ◦
lk agent deploy --image your-agent-image --agent-name your_agent_name --replicas 3
◦ This creates 3 worker instances; LiveKit will load‑balance jobs across them. 1. Configure autoscaling (min/max) • Set min/max so LiveKit Cloud can scale: ◦
lk agent deploy --image your-agent-image --agent-name your_agent_name --min 2 --max 10
• LiveKit Cloud will scale workers between min and max based on load. 1. Environment & secrets • Pass provider API keys and config as environment variables or secrets when deploying (e.g.,
--env ANTHROPIC_API_KEY=xxx
). 1. Monitor and adjust • Monitor CPU, memory, and active job counts in the LiveKit Cloud dashboard. • If workers are CPU/network bound, increase replica count or per-worker resources. Quick recommendations • Start with min=2 for redundancy. • Tune per-worker CPU/memory so each worker can handle multiple concurrent calls. • Use per-provider rate limiting inside your agent to avoid hitting external model limits. Would you like a concrete CLI command or a Kubernetes/manifest example or a sample
Dockerfile
for your agent language?