How do you scale a voice AI agent to thousands of concurrent calls?
- Authors
- Name
- Amit Shekhar
- Published on
We scale a voice AI agent to thousands of concurrent calls by running many small workers that each handle a fixed number of calls, sending every new call to a worker with free room, and adding or removing workers based on the number of live calls. We also make sure that every service the call depends on, like the phone lines, Speech-to-Text, the LLM, and Text-to-Speech, can handle the same number of calls at the same time.
In this blog, we will learn about how we scale a voice AI agent to thousands of concurrent calls. We will also see why a voice call is different from a normal web request, how one worker handles a few calls, how a dispatcher sends each new call to the right worker, how we add and remove workers without dropping live calls, why the STT, LLM, and TTS services often become the limit, and how we test the whole system before real users arrive.
We will cover the following:
- What are concurrent calls?
- Why is a voice call different from a web request?
- The building block: a worker
- How many calls can one worker handle?
- The dispatcher: sending each call to the right worker
- Scaling the workers up and down
- Removing a worker without dropping live calls
- The limits of STT, LLM, and TTS
- Phone lines also have a limit
- Keeping the call state outside the worker
- Running in more than one region
- Load testing before real users arrive
I am Amit Shekhar, Founder @ Outcome School, I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.
I teach AI and Machine Learning at Outcome School.
Let's get started.
What are concurrent calls?
Concurrent calls are the calls that are live at the same moment.
Let's say a bank uses a voice agent that gets 100,000 calls in one day. These calls do not all happen at once. At 10 AM on a Monday, 3,000 people are talking to the agent at the same moment. Those 3,000 are the concurrent calls.
The total calls per day tells us about cost. The concurrent calls tell us how big our system must be at its busiest moment, because every one of those users must get a fast reply.
In many voice agents, every one of these calls runs through a pipeline of three steps: Speech-to-Text (STT) turns what the user said into text, an LLM (Large Language Model) decides the reply, and Text-to-Speech (TTS) turns the reply into a voice.
Why is a voice call different from a web request?
When we open a website, the server sends back a page in a fraction of a second, and the next request can go to any other server.
A voice call is different:
- It is long. A call can last 3 minutes, 10 minutes, or more. The same call stays connected the whole time.
- It is real-time. Small pieces of audio, often 20 milliseconds long, keep arriving all the time. If the system pauses even for a second, the user hears silence or broken audio.
- It has memory. The agent must remember what the user said earlier in the call. This is called the call state.
- It uses many services at once. Every call keeps a live connection to STT, sends text to the LLM, and streams audio from TTS.
Hence, we cannot treat a call like a quick request that any server can pick up and drop. A call is a long-running session that must stay on one server from the start to the end.
The building block: a worker
So, how do we handle thousands of long-running sessions? The answer is: we do not build one giant server. We run many small, identical workers and let each one handle a few calls. A worker is a running process that handles the full life of a call: it receives the user's audio, runs voice activity detection (VAD) to know when the user is speaking, talks to STT, LLM, and TTS, and sends the reply audio back.
We can see one worker handling a few calls in the diagram below:
+-----------------------------------+
| Worker 1 |
| |
| Call A Call B Call C Call D |
+-----------------------------------+
↓
STT, LLM, TTS services
Here, Worker 1 is handling 4 calls at the same time. Each call runs as its own session inside the worker.
Now, if one worker can handle 4 calls, then 1,000 workers can handle 4,000 calls. We do not make one worker bigger. We add more workers of the same size. This is called horizontal scaling.
How many calls can one worker handle?
The number of calls per worker depends on how much work the worker does on its own machine. If it only moves audio and calls external STT, LLM, and TTS services, it spends most of its time waiting. But, the worker also does some work itself for every call:
- Decoding the phone audio coming in and encoding the reply audio going out.
- Running VAD on every audio frame.
- Running a turn detection model to decide when the user has finished speaking.
- Running noise suppression, if we use it.
All of this uses the CPU every few milliseconds, for every call. If we put too many calls on one worker, the CPU gets busy, the audio frames get delayed, and the user hears choppy audio.
So, we find this number by testing. We put 1 call on a worker, then 5, then 10, then 20, and we watch two things:
- The CPU and memory usage of the worker.
- The delay between when the user stops speaking and when the agent starts replying.
The moment the delay starts to grow, we have found the limit. Then, we set the real number a little below that limit. For example, if a worker starts to slow down at 25 calls, we can set its limit at 20 calls.
Planning your move into AI?
No matter which tech domain you work in today, with your effort, you can transition to these roles:
- AI Engineer
- Forward Deployed Engineer
- AI Agent Engineer
- Harness Engineer
- Voice AI Engineer
- AI Architect
- LLM Engineer
- LLM Inference Engineer
- Gen AI Engineer
- MLOps Engineer
- ML Engineer
- Deep Learning Engineer
Our AI and Machine Learning Program at Outcome School takes you there.
The dispatcher: sending each call to the right worker
When a new call arrives, who decides which worker gets it? Here comes the dispatcher into the picture.
A dispatcher is a service that receives every new call and assigns it to a worker that has free room.
Every worker keeps telling the dispatcher how many calls it is handling right now.
New call
↓
+------------+
| Dispatcher |
+------------+
↓
Picks a worker with room
↓
+----------+ +----------+ +----------+
| Worker 1 | | Worker 2 | | Worker 3 |
| 20 / 20 | | 12 / 20 | | 5 / 20 |
| (full) | | | | |
+----------+ +----------+ +----------+
Here, Worker 1 is full with 20 out of 20 calls. So, the dispatcher skips it and sends the new call to Worker 3, which has the most free room.
The dispatcher makes this decision only once, at the start of the call. After that, all the audio of that call goes to the same worker until the call ends, because the call state lives in that worker. Unlike a normal web load balancer that spreads every request, the dispatcher keeps the call sticky to one worker.
Let's see a simple version of the dispatcher logic as below:
def assign_call(call, workers):
# keep only the healthy workers that have free room
available = [w for w in workers
if w.is_healthy and w.active_calls < w.max_calls]
if not available:
# no room anywhere, so we do not accept the call
return reject(call, reason="at capacity")
# pick the worker with the most free room
worker = min(available, key=lambda w: w.active_calls / w.max_calls)
worker.start_session(call)
return worker
Here, we have done the following:
- We keep only the workers that are healthy and not full. A worker that has crashed or stopped reporting is not healthy.
- If no worker has room, we reject the call instead of overloading a worker.
- Otherwise, we pick the worker that is least loaded and start the call session on it.
Scaling the workers up and down
Calls do not come at a steady rate. A bank gets very few calls at 3 AM and a huge number at 10 AM on a Monday. If we keep enough workers for the busiest moment all day, we pay for idle machines. If we keep too few, calls get rejected.
So, we add workers when calls go up and remove workers when calls go down. This is called autoscaling.
Now, the question is: what number should we watch? For a voice agent, the best number is the number of live calls compared to the total room we have, not only the CPU usage.
Let's say we have 100 workers, and each can handle 20 calls. So, our total room is 2,000 calls. We can set a simple rule, for example:
- If more than 70 percent of the room is used, add more workers.
- If less than 40 percent of the room is used, remove some workers.
At 1,400 live calls, we are at 70 percent, so we start adding workers. The remaining 30 percent is our buffer for the calls that arrive while the new workers are still starting.
A new worker does not become ready instantly. It must start up, load the VAD and turn detection models into memory, and open its connections. This can take from a few seconds to a few minutes.
That is why we always keep some warm workers. These are workers that are already started and waiting with zero calls. When a burst comes, they take the calls immediately, while autoscaling starts more workers.
If we know the busy hours in advance, like 10 AM every Monday, we can also add workers a little before that time. This is called scheduled scaling.
A quick note for you
No matter which tech domain you work in, get familiar with these topics:
- LLM
- RAG
- MCP
- Agent
- Fine-tuning
- Quantization
We put it all together in one video:
AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, and Quantization
No need to stop reading - bookmark it and watch later when you get time. Future you will thank you.
Now, let's get back to the topic.
Removing a worker without dropping live calls
Adding workers is simple. Removing them is where we often do mistakes.
If we simply stop a worker that is handling 15 live calls, those 15 calls drop.
So, we remove a worker step by step. This is called draining.
Step 1: We tell the dispatcher to stop sending new calls to this worker.
Step 2: The worker keeps handling its current calls until each of them ends.
Step 3: When the last call ends, and the worker has zero calls, we shut it down.
Worker 7: 15 live calls
↓
Marked as draining (no new calls)
↓
Calls end over time: 15, 9, 3, 0
↓
Worker 7 shuts down
Since a call can last a long time, we also choose a maximum wait time for draining, for example 30 minutes. We use the same draining when we deploy a new version of our agent. We start new workers with the new version and drain the old ones.
The limits of STT, LLM, and TTS
Now, it's time to learn about the part that often breaks first.
Every call depends on STT, LLM, and TTS. If we have 3,000 live calls, then at the same moment:
- STT has up to 3,000 open audio streams.
- The LLM gets a new request every time any of those 3,000 users finishes a turn.
- TTS is generating voice for every agent reply that is being spoken.
For example, if the STT provider allows only 500 open streams for our account, then call number 501 gets no transcription, no matter how many workers we have.
Hence, we must check the limits of every provider we use:
- STT: the maximum number of streaming connections at the same time.
- LLM: the requests per minute and the tokens per minute allowed for our account.
- TTS: the maximum number of voice generations at the same time.
We must ask the providers to raise these limits well before we need them, and keep a fallback. If the main STT provider refuses a new stream, the worker can switch that call to a second provider instead of letting it fail.
If we run our own STT, LLM, or TTS models on our own GPUs, then the limit becomes our GPU capacity. A GPU can serve many calls at the same time by processing their requests together in groups. This is called batching. But, bigger groups can make each reply slower. So, for a voice agent, we keep the groups small enough that the reply delay stays low, and we add more GPUs to handle more calls.
When we scale a voice agent, the STT, LLM, and TTS services often become the limit before the workers do.
To learn Model Deployment and Serving, Continuous Batching, and Infrastructure and Platform in depth, check out our AI and Machine Learning Program at Outcome School.
Phone lines also have a limit
If our agent answers real phone calls, the calls come in through a phone carrier using a connection called a SIP trunk. SIP is the protocol that starts and ends phone calls over the internet.
Every SIP trunk has a limit on the number of calls it can carry at the same time. Each of these call slots is called a channel. If our trunk has 1,000 channels, call number 1,001 is rejected, and the caller often hears a busy tone, even if we have enough workers and enough STT, LLM, and TTS capacity.
So, we must get enough channels for our busiest moment, and some extra. Many teams also use more than one carrier, so that a problem with one carrier does not stop all calls.
Let's see the full chain of limits in the diagram below:
Phone carrier (channels)
↓
Dispatcher (assigns the call)
↓
Workers (calls per worker times workers)
↓
STT, LLM, TTS (provider limits)
Here, every step has its own limit. The number of concurrent calls our system can handle is the smallest limit in this chain. So, we must grow all of them together.
Keeping the call state outside the worker
Now, let's understand one more problem. What happens if a worker crashes in the middle of 20 calls? Those calls will be disturbed, but we can reduce the damage.
The call state includes the conversation so far, the details the user already gave, and the current step of the task. If it lives only in the memory of the worker, then it is lost with the crash.
So, we save the important call state to a fast shared database, like Redis, after every turn. Now, if a worker crashes and the call can be reconnected, the dispatcher moves the call to another worker, and that worker loads the saved state. The agent can say, "Sorry, we got disconnected for a moment. You were telling me your account number," and continue.
The same shared state also helps when we transfer the call to a human, who can read what has already happened.
Stay updated: Subscribe to our newsletter to get our latest AI and Machine Learning blogs straight to your inbox.
Running in more than one region
When people call from different countries, distance comes into the picture. If the user is in India and our workers are in the United States, every audio packet travels a long distance, and this adds delay to every reply.
So, we run our workers in more than one region of the world, and the dispatcher sends each call to the closest region that has free room. We also use STT, LLM, and TTS servers in the same region as the worker whenever we can.
This also protects us, because if one region has a problem, the calls can go to another region.
We have a detailed blog on Design a Real-Time Voice AI Agent that covers the full system end to end.
Load testing before real users arrive
So, how do we know that our system can handle 3,000 calls before 3,000 real users call us?
The answer is load testing. We build a set of fake callers. Each fake caller is a small program that:
- Starts a call to our agent.
- Plays a recorded user voice, like "I want to check my account balance."
- Measures how long the agent takes to reply.
We start with 100 fake callers, then 500, then 1,000, then 3,000, and then a little above our target. At every step, we watch:
- The time from when the user stops speaking to when the agent starts replying.
- How many calls fail or get rejected.
- The CPU and memory of the workers.
- Errors from the STT, LLM, and TTS providers.
We must look at the slow calls, not only the average. If the average reply takes 800 milliseconds but 5 out of every 100 replies take 4 seconds, then many users are having a bad experience. That is why teams track the p95 latency, which is the time within which 95 out of 100 replies arrive.
We also test bursts, like 1,000 calls arriving in the same minute, to see if the warm workers and autoscaling can handle it.
Load testing shows us which limit in the chain breaks first. We fix that limit, and then we test again, until the system handles our target number of calls with a fast reply.
Now we must have understood how we scale a voice AI agent to thousands of concurrent calls, and why every limit in the chain must grow together.
Frequently Asked Questions
Why must a voice call stay on one worker for the whole call?
Because the call state lives in that worker. The dispatcher picks a worker only once, at the start of the call, and after that all the audio of the call goes to the same worker until the call ends. Unlike a normal web load balancer that spreads every request, the dispatcher keeps the call sticky to one worker.
What are warm workers in a voice agent system?
Warm workers are workers that are already started and waiting with zero calls. A new worker does not become ready instantly, because it must start up, load the VAD and turn detection models, and open its connections. When a burst of calls comes, warm workers take the calls immediately while autoscaling starts more workers.
What happens when every worker is full?
The dispatcher rejects the new call instead of overloading a worker. If we put too many calls on one worker, the CPU gets busy, the audio frames get delayed, and the user hears choppy audio. To avoid this, autoscaling adds workers before the room runs out, for example when more than 70 percent of the room is used.
What should a worker do if the STT provider refuses a new stream?
It should switch that call to a second provider instead of letting it fail. Every provider has limits, like the number of open STT streams for our account. So, we ask providers to raise these limits well before we need them, and we keep a fallback provider ready.
Why do we track p95 latency instead of only the average during load testing?
Because the average hides the slow calls. If the average reply takes 800 milliseconds but 5 out of every 100 replies take 4 seconds, many users are having a bad experience. The p95 latency is the time within which 95 out of 100 replies arrive, so it shows these slow replies.
That's it for now.
Thanks
Amit Shekhar
Founder @ Outcome School
You can connect with me on:
Follow Outcome School on:
