Skip to content
Inference Academy

What is inference engineering? The job behind every fast AI product

Inference engineering is the work of making trained models answer quickly, reliably and cheaply. What inference engineers actually do day to day, the handful of ideas the whole field rests on, why demand for the skill is growing, and where to start.

Key takeaways

  • Inference engineering is making trained models answer quickly, reliably and cheaply.
  • The job: predict speed, capacity and cost per million tokens, then prove changes with repeatable benchmarks.
  • Prefill is compute bound and decode is memory-bandwidth bound.
  • Batching is the biggest lever on cost; KV cache memory usually limits how many users fit.
  • The Inference Engineering course starts from these ideas, and its first lessons are free.

By

8 min read

Share
On this page

Training a model gets the headlines. But once a model ships, it gets trained once and then run billions of times. Every chat reply, every code completion and every agent step is an inference request, and each one costs GPU time. Making those requests fast, reliable and cheap is inference engineering.

If you've ever wondered why one provider streams tokens twice as fast as another for the same model, or why a self-hosted model that benchmarked well falls over with 50 real users, you've already met the problems inference engineers solve.

#What the job actually is

An inference engineer answers three questions about a model and a fleet of hardware:

  1. How fast will it be? Time to the first token, then tokens per second after that.
  2. How many users can it serve at that speed?
  3. What will it cost per million tokens, and what should change first to make it cheaper?

The skill that separates good inference engineers from people who flip flags until a number goes up is that they can predict the answers with a pencil before measuring them, then prove an improvement with a benchmark someone else could repeat.

Day to day, that looks like:

  • Choosing and tuning a serving engine (vLLM, SGLang, TensorRT-LLM, llama.cpp) for a workload.
  • Picking a quantisation (FP8, INT4, FP4) and checking that quality survived.
  • Deciding how to split a model across GPUs, and how many GPUs a service needs.
  • Reading profiles to find where time goes, and sometimes writing a GPU kernel to fix it.
  • Setting latency targets (SLOs), load testing and capacity planning.

#The four ideas the field rests on

Almost everything in inference engineering follows from a few physical facts. Learn these and most "tricks" stop looking like magic.

#1. Generating text has two phases with opposite bottlenecks

Prefill reads your whole prompt at once. It's a big matrix multiply, and it's limited by the GPU's compute (FLOPs). Decode produces one token at a time, and for each token the GPU has to read every weight of the model from memory. Decode is limited by memory bandwidth.

The roofline: where does decode sit?
Interactive
balance ≈ 295 FLOPs/byte18645124096arithmetic intensity (FLOPs per byte, log)1101001000

Achieved

3 TFLOPs

Step time

4.8 ms

Tokens/s (all)

209

Bound by

memory

Decode with BF16 weights does 2 FLOPs per weight byte per sequence, so arithmetic intensity ≈ batch size. KV-cache reads are ignored, which flatters large batches. Dense BF16 peak.

That one split explains a lot: why time to first token grows with prompt length, why tokens per second barely depend on the prompt, and why a 4-bit model decodes faster than a 16-bit one (it reads a quarter of the bytes). There's a full walkthrough in prefill vs decode.

#2. Decode speed is roughly bandwidth divided by bytes

At batch size 1, a decode step reads the whole model once. So the fastest possible speed is

tokens per second≈memory bandwidthbytes of weights\text{tokens per second} \approx \frac{\text{memory bandwidth}}{\text{bytes of weights}}

An 8B model in 16-bit is about 16 GB. On a GPU with 3.35 TB/s of bandwidth (an H100), that's a ceiling of about 3350/16≈2103350 / 16 \approx 210 tokens per second for one user. Real numbers land below the ceiling, and the gap is where engineering happens (why memory bandwidth decides LLM speed).

#3. Batching turns a bandwidth problem into a compute problem

If reading the weights is the expensive part, read them once and use them for many users at the same time. Serving 64 users in one batch costs barely more per step than serving one, which is why batching is the single biggest lever on cost. Engines do this continuously, adding and removing requests every step (continuous batching).

#4. Memory, not compute, usually limits how many users fit

Every active request keeps a KV cache: the keys and values of all its previous tokens. For a 70B model that's about 320 KB per token, so one 8K-token conversation holds about 2.5 GB. Run out of memory for KV caches and you run out of users, however fast the GPU is (KV cache explained).

#The stack an inference engineer works across

Inference engineering isn't one layer; it's knowing enough about each layer to find where the time and money go:

Layer Examples Typical questions
Hardware H100, H200, B200, MI300X, Apple Silicon Which GPU gives the lowest cost per token for this workload?
Kernels cuBLAS, FlashAttention, Triton kernels Why is this step slow? Can two operations be fused?
Engine vLLM, SGLang, TensorRT-LLM, llama.cpp Which engine and settings meet our latency target with the fewest GPUs?
Serving platform Kubernetes, routers, autoscalers, Dynamo, llm-d How many replicas, where, and how do requests find the warm cache?
Application Prompts, caching, model choice, output length Can we cut cost by changing what we send?

Some of the biggest wins come from the top of the table, not the bottom: putting stable content first in prompts so the prefix cache works, capping output length, or routing easy requests to a smaller model.

#A worked example of the job

A team runs a 70B model for a customer-support assistant on one node of eight H100s. Users complain that answers sometimes freeze mid-sentence, and the GPU bill is high. Here's how an inference engineer might approach it:

  1. Measure before changing anything. P95 time to first token is fine, but inter-token latency has spikes of 300 ms or more. Throughput is moderate and GPUs aren't full.
  2. Form a hypothesis from the physics. Spikes in the gap between tokens, but not in TTFT, point at long prefills landing in decode steps (prefill vs decode).
  3. Check the traffic. Prompts include a 6,000-token knowledge-base excerpt that changes per request, plus a 2,000-token system prompt that starts with the current date and time.
  4. Fix the cheapest thing first. Moving the timestamp to the end of the prompt lets the 2,000-token system prompt be shared across all requests through prefix caching. Prefill work drops by about a quarter.
  5. Then the engine setting. Enabling chunked prefill with a moderate token budget stops long prompts from stalling everyone else's stream.
  6. Re-measure under the same load. Inter-token latency spikes are gone, goodput at the latency target is up, and the team can serve the same traffic with fewer GPUs.

No kernel was written and no hardware was bought. That's typical: understanding the physics and measuring carefully usually beats exotic optimisation.

Role Main focus Overlap with inference engineering
ML engineer / research engineer Training and evaluating models Knows the model; less focus on serving cost
MLOps / platform engineer Deploying and operating ML systems Kubernetes, CI/CD, monitoring; less focus on GPU performance
GPU / kernel engineer Writing fast kernels Deep on one layer of the stack
Inference engineer Speed, capacity and cost of serving Spans all of the above, with performance at the centre

In small companies one person often covers several of these. In large ones, inference teams work closely with all of them.

#Why demand is growing

Three trends push inference work up the priority list:

  • Inference is now most of the compute bill. A model is trained once but served for as long as it's useful. For popular products, serving dwarfs training.
  • Open models are good enough to self-host. Teams that used to call an API now run Llama, Qwen, DeepSeek or Mistral models themselves, and someone has to make that efficient.
  • Reasoning models and agents spend far more tokens per task. A single agent task can generate tens of thousands of tokens. Halving cost per token halves the cost of the product.

The result is that "inference engineer", "ML performance engineer" and "AI infrastructure engineer" roles ask for the same core skills: GPU architecture, serving engines, quantisation, parallelism, profiling and benchmarking.

#What you need to learn, in order

Stage What to learn Why
1. Foundations Tokens, prefill and decode, VRAM maths, the roofline Predict speed and memory before you measure
2. Engines How vLLM and SGLang schedule, batch and cache Most gains come from configuring engines well
3. Techniques Quantisation, speculative decoding, prefix caching, parallelism, disaggregation The levers you'll pull in practice
4. Measurement Open-loop load tests, percentiles, goodput Prove what helped, honestly
5. Kernels CUDA, Triton, Nsight profiling Read profiles, fuse operations, fix slow paths
6. Production Capacity planning, autoscaling, observability Run it for real users

There's a longer version of this in how to become an inference engineer.

#Common misconceptions

  • "Faster GPU means faster model." Only if the GPU has more memory bandwidth (for decode) or more compute (for prefill). A GPU with twice the FLOPs and the same bandwidth decodes at the same speed.
  • "Quantisation is just about fitting in memory." It also makes decode faster, because fewer bytes are read per token.
  • "Benchmarks from the engine's README apply to me." Throughput depends heavily on prompt length, output length and concurrency. Measure your own workload.
  • "More GPUs always help." Splitting a model across GPUs adds communication. Sometimes two copies of the model on two GPUs serve more users than one copy split across both (parallelism compared).

#Try it yourself: a five-minute estimate

Pick a model you know and a GPU, and estimate before you measure:

  1. Weights: parameters × bytes per weight. An 8B model in FP8 is about 8 GB.
  2. Decode ceiling at batch 1: bandwidth ÷ weights. On a GPU with 1 TB/s, about 125 tokens per second; expect 60 to 75% of that.
  3. KV cache per token: 2×layers×KV heads×head dim×bytes2 \times \text{layers} \times \text{KV heads} \times \text{head dim} \times \text{bytes}. For a Llama-class 8B in FP8, 64 KiB.
  4. Users that fit: (memory − weights − about 10% overhead) ÷ (KV per token × tokens per conversation).

Then run the model and compare. If your measurement is far from the estimate, finding out why is exactly the work of inference engineering. The VRAM calculator and hardware checker help with the arithmetic.

#FAQ

Do I need a PhD or ML research background? No. Strong software engineering plus the core ideas above (memory bandwidth, batching, the KV cache, measurement) cover most of the job. Many inference engineers come from backend, systems or infrastructure work.

Do I need to write CUDA? Not to start. Reading profiles and understanding what kernels do matters more early on; writing kernels comes later, if at all (what is a GPU kernel).

Is this only for companies training their own models? No. Any team serving open models, or paying large API bills, benefits from the same skills.

#Where to start

If you already run models, the Inference Engineering course starts from these four ideas and builds up to engines, techniques and benchmarking. The first lessons are free, starting with what you'll learn and the plan. If you want a week-by-week route instead, the inference engineering roadmap lays it out with a free lesson at each stage.

inference-engineeringcareersfundamentals

Found this useful?

Send it to someone who is learning the same thing.

Share this article

Next: learn it step by step, free

Prefill, decode and the roofline

The first idea every inference engineer learns, and the one interviewers check first. A free lesson with step-through diagrams and a quiz.

Get new articles by email

One short email when a new guide is out. Unsubscribe any time.