An inference pipeline is everything that happens around your model before its answer reaches a user. Here’s how each stage works.
Takeaways
- The model is usually the smallest part of the system. Most of the work goes into getting input to it and answers away from it.
- Choose batch, real-time, or streaming based on when someone needs the answer, not on which model you run.
- A fast model can still feel slow, because response time adds up across every stage and network hop.
- Voice AI forces stages to overlap, which brings two hard problems: knowing when the caller is done and stopping cleanly when they interrupt.
- Pipelines tend to break between stages, so give each request one time budget and monitor the answers, not just uptime.
What is an inference pipeline?
An inference pipeline is everything that has to happen around a trained model before its output is useful to anyone. If your model already gives great answers in a notebook, you've probably been running half the pipeline yourself without noticing: you hand it tidy input and read the raw output with your own eyes.
So why does the same model feel so much harder to ship? Because production takes that job away from you. Your first real user pastes a 3,000-word email, types in all caps, or hits send on an empty box. Something has to clean that up, check what comes back, and get the answer to a chat window or a database. That something is the pipeline.
Picture a support chatbot. A customer types "my bill is wrong." The pipeline cleans and tokenizes the text, runs the model, checks the reply against your support policy, and sends it to the chat window.
This wrapper is getting more attention because running models now takes more compute than building them. Deloitte expects inference to account for roughly two-thirds of all AI compute in 2026, up from half in 2025 and a third in 2023.
The word "pipeline" means different things depending on who's using it, so here's how the neighbors differ:
- A training pipeline turns data into a trained model. It runs before inference and produces the model your inference pipeline serves.
- A feature pipeline computes model inputs (features) from raw data. It feeds both training and inference, so it has to compute features the same way for both.
- Pipeline parallelism splits one model's layers across several GPUs so a model too big for one GPU can run. It's a way to run the model stage, not the pipeline around it.
- The scikit-learn
Pipelineclass chains preprocessing steps and a model into one Python object. It's a handy tool inside the preprocessing and model stages. - A SageMaker inference pipeline is AWS's product name for a model built from a linear sequence of two to fifteen containers. It's one vendor's way to package the idea.
How an inference pipeline works, stage by stage
Every inference pipeline runs five stages, and most of the engineering happens in the four that aren't the model. Google engineers made the same point back in 2015, in a NeurIPS paper on technical debt in machine learning: the ML code is only a small fraction of a real-world ML system.
- Ingest and validate. The pipeline accepts the request and checks its format, size, and authentication. In the chatbot, this is where an empty message or a 50,000-word paste gets turned away.
- Preprocess. The input gets converted into what the model expects, usually tensors or token IDs. "My bill is wrong" becomes a short list of numbers.
- Run the model. The model executes on the prepared input and returns raw scores, logits (unnormalized scores for each possible output), or tokens.
- Postprocess. Raw output becomes a usable answer. Tokens get decoded back into text, thresholds get applied, and safety checks block anything off-policy.
- Deliver and log. The pipeline returns the result and records the inputs, outputs, and how long each stage took. Those timings are how you'll find the slow stage later.
Each stage hands something specific to the next, so when one stage misbehaves, you'll often notice it somewhere else first. How tightly you need to time those handoffs depends on when your users need the answer.
Batch, real-time, and streaming inference pipelines
When the answer is needed decides the pipeline's shape: tomorrow means batch, right now means real time, and continuously means streaming.
Three types of inference pipeline
| Type | When it runs | Optimizes for |
|---|---|---|
| Batch inference | On a schedule, over many inputs at once (nightly churn scores) | Cost per prediction and throughput |
| Real-time inference | Per request, while someone waits (a fraud check on a card swipe) | Response time |
| Streaming inference | Continuously, on an open stream with session state (a live phone call) | Steady, low delay over a long session |
Batch is cheaper for a reason that has nothing to do with the model. Real-time services keep spare GPU capacity for their traffic peaks, so their GPUs sit underused on average, a pattern the 2026 Valve paper on production GPU clusters describes directly. A batch job doesn't care about peaks, so it can keep a GPU busy from start to finish.
Plenty of products use two types at once. A bank checks every card swipe for fraud in real time, then recalculates customer risk segments in a nightly batch.
Inference pipeline latency: where the time goes
In a real-time pipeline, your user waits for the sum of every stage plus every network trip between them.
Ever wondered why a model that benchmarks fast still feels sluggish to your users? It's rarely the model. It's everything stacked around it:
- Stages run in sequence, so their times add up. A fast model inside a slow pipeline still gives a slow answer.
- Distance is a stage that never shows up on the diagram. If your stages live in different regions or with different providers, every request pays for those trips. Running stages closer to users, as edge inference does, is one way around it.
- Slow stages compound. In "The Tail at Scale," a 2013 Google paper, Jeff Dean and Luiz André Barroso show that if each server is slow one time in 100, a request that waits on 100 of them is slow 63% of the time. The same math applies to any pipeline waiting on several stages or models, which is why you track your slowest 1% of requests (p99) instead of the average.
- The budget belongs to the whole pipeline, not to each model. The section on failures below covers how to enforce it.
The good news is that you already have what you need to find the culprit. The per-stage timings you log in stage 5 show you exactly where the time goes.
How an LLM inference pipeline is different
An LLM inference pipeline produces its answer one token at a time, so it can start replying before it has finished generating. That changes a few things about the stages from the diagram above:
- The model reads the whole prompt first (prefill), then writes the reply one token at a time (decode).
- It keeps a working memory of the prompt, called the KV cache, and serves many users on one GPU by batching their requests together.
- It streams tokens to the user as they're generated, so the first words arrive well before the last.
- Postprocessing gets heavier. Safety checks, format checks, and tool calls sit between the model and the user, often as separate rails that run outside the model, which is the approach behind NVIDIA's NeMo Guardrails. Each one is another stage that can add delay or fail.
You don't have to build any of that yourself. Serving engines handle prefill, decode, and the KV cache for you, so most of your work stays in the stages around the model.
Inference pipeline example: a voice AI phone call
A voice AI call runs three models in one streaming pipeline, and your callers expect a reply about as fast as a person would give one. A study of 10 languages published in 2009 found people start answering a question about 208 milliseconds after it ends on average, from 7 ms in Japanese to 469 ms in Danish. A 2022 PNAS study found that faster replies make a conversation feel more connected, even to people just listening in.
This is a sequential multi-model inference pipeline: each model's output feeds the next. The other common patterns are fan-out, where several models run in parallel, and routing, where a small model decides which larger model gets the request.
Here's what happens on each turn of the call:
- Caller audio arrives over the phone network through a programmable voice API.
- Your speech-to-text model streams partial transcripts while the caller is still talking, so the pipeline never waits for silence to start listening.
- Turn detection decides the caller has finished. Most systems treat silence longer than a set threshold as the end of a turn, but KTH researchers found people pause longer inside their own turns than between them. Set the threshold too short and your agent cuts people off; set it too long and the line goes quiet. That's why most platforms let you tune endpointing thresholds.
- The LLM starts generating the moment the turn ends and streams its tokens.
- Text-to-speech starts speaking on the first few words instead of waiting for the full reply. Research on incremental speech synthesis has shown quality close to full-sentence output with a lag of only one or two words.
- The synthesized audio goes back over the call.
- Barge-in handles interruptions. If the caller cuts in, the pipeline stops speaking, throws away the LLM output still in flight, and goes back to listening. It's hard to get right: on the EchoChain benchmark, none of the four real-time voice models tested passed more than half of 200 conversations where the user interrupted mid-reply and the model had to update its task.
Where these stages run matters as much as how they're built. If speech-to-text, the LLM, and text-to-speech each sit with a different provider in a different region, every turn crosses the public internet several times, and those trips stack on top of everything in the latency section above.
Telnyx builds this pipeline on one network. Telnyx's voice AI agent platform runs speech-to-text, the language model, and text-to-speech on GPUs in the same data centers as Telnyx's telephony core, so caller audio reaches each stage without leaving Telnyx's private network. If you'd rather assemble your own pipeline, Telnyx's Inference API serves open-source models on GPUs Telnyx owns, through OpenAI-compatible endpoints.
Where inference pipelines break
Most inference pipeline failures happen at the boundaries between stages, not inside the model. Here are the four you're most likely to run into:
- Training-serving skew. If your pipeline prepares data differently at serving time than it did in training, the model quietly gets worse. Google's Rules of Machine Learning lists this mismatch as a cause of skew and suggests reusing code between your training and serving pipelines wherever you can.
- A stage with no time limit. One hung stage holds the whole request. Google's SRE book describes deadline propagation: set one deadline where the request enters, pass it to every stage, and check before each stage that enough time is left. If there isn't, take a fallback like a smaller model or a holding reply. On a voice call, that fallback is what the caller hears instead of dead air.
- Version drift. A new model ships with last month's preprocessing, or the other way around. Version and deploy them together.
- Watching uptime instead of answers. A pipeline can pass every health check while serving wrong results, so monitor outputs too.
Picture a pricing model trained on prices in dollars that starts receiving prices in cents. Every health check stays green while every score comes out wrong.
Frequently asked questions about inference pipelines
Quick answers to the questions people ask most about the inference pipeline.
What is an inference pipeline in simple terms?
It's the assembly line around a trained model. A request goes in one end, gets checked and converted into something the model can read, passes through the model, and comes out the other end as a finished, filtered answer. The model does the predicting. The pipeline does everything needed to make that prediction safe and useful to a real person.
Is ChatGPT an inference pipeline?
ChatGPT runs an inference pipeline every time you send a message. Your text is tokenized, the model generates a reply token by token, and the reply is filtered and streamed back to your screen. The product is more than the pipeline, though. Accounts, memory, file uploads, and the interface all sit around it.
Is an LLM an inference model?
An LLM is a trained model, and inference is what happens each time it runs on a prompt. So it's more accurate to say an LLM is used for inference than to call it an inference model. In an LLM inference pipeline, it's the model stage, with prompt handling before it and safety and format checks after it.
Is an inference pipeline the same as pipeline parallelism?
No. Pipeline parallelism splits one model's layers across several GPUs so a model too large for a single GPU can still run, with batches moving through those GPUs in sequence. An inference pipeline is the chain of steps around the model, from validating input to delivering the answer. Pipeline parallelism is one way to run the model stage inside it.
Does every model need an inference pipeline?
Any model that serves real users needs one, even a small one. Live input is messy, outputs need checking, and results have to land somewhere useful. A one-off notebook experiment doesn't, because you're doing those jobs by hand. Once someone other than you depends on the answer, you need the steps that make it reliable.
Building a real-time voice AI pipeline and want to talk through where each stage should run? Contact Us.



