Vijendra Rana

Search

Search articles, series and snippets

Inference engineering - most valuable skill now

By · · 5 min read · AI Infra, LLM Serving

A map of the path to becoming an inference engineer

On this page

Training a model gets the headlines. Serving it is where the bill arrives. Every chat reply, every code completion, every agent step is an inference call, and somebody has to make those calls fast, cheap and reliable. That somebody is the inference engineer.

This post is a map, not a course. It shows why the skill matters, where companies actually use it, what the stack looks like from GPU to API, and where to go next.

Why Inference engineering

A model is trained once and then served millions of times. The training run is a one-off cost. Inference is a cost you pay on every request, for as long as the product is alive. Once a product has real users, most of the compute money goes to serving, not training.

That changes what teams need. Fewer people are training models from scratch now, because strong open and hosted models already exist. Far more people are trying to answer questions like these:

  • Why does the first token take two seconds?
  • Can we serve twice the traffic on the same GPUs?
  • Is it cheaper to rent an API or run the model ourselves?
  • Will a smaller, quantized model be good enough for this task?

None of these are research questions. They are engineering questions, and they sit between three worlds: machine learning, systems programming and plain old backend operations. Very few people are comfortable in all three, which is exactly why the skill is valuable.

Business use cases

Inference work looks different depending on what the product needs. A few common shapes:

Chat and copilots. People are waiting on the other side, so time to first token matters more than anything. Streaming, prompt caching and keeping tail latency under control are the daily work here.

Voice agents. The whole loop of speech to text, model, and text to speech has to feel like a conversation. A delay that is fine in chat feels broken on a phone call, so every stage is fought over in milliseconds.

Agents and tool calling. One user request can turn into ten or twenty model calls. Latency and cost multiply, so caching, routing easy steps to smaller models and running calls in parallel pay off quickly.

Batch and offline jobs. Summarising a million documents or building embeddings for a search index. Nobody is waiting, so the goal flips from low latency to high throughput and the lowest cost per token.

Private and on-prem deployments. Banks, hospitals and governments often cannot send data to a public API. Someone has to run the models inside their walls, on the hardware they already own.

Edge and on-device. Phones, laptops and cars. Small memory, no datacenter GPU, sometimes no network. This is where quantization and small models earn their keep.

The pattern across all of them is the same trade-off triangle: latency, throughput and cost. You rarely get all three. Knowing which one the business cares about is half the job.

Inference stack

I find it easiest to think of the work as four layers. Each one has its own skills, its own tools and its own reading list. Click a layer to see what to learn there, then click any skill to see why it is worth your time.

Inference engineering layers

Foundation

How a model turns a prompt into tokens

Before tuning anything you need a working picture of what happens inside one request. Every optimisation higher up is a trick played on these basics.

Skills to master

Why you need it: Latency is the cost of running this pass once per generated token. If you cannot trace it, you cannot say where the time goes.

Why you need it: You are billed and rate limited in tokens, not words. Prompt size, context limits and cost all come back to how text is split.

Why you need it: The KV cache is why the model does not re-read the whole prompt for every new token. It is also what fills GPU memory under load.

Why you need it: Reading the prompt and writing the answer behave very differently. Time to first token comes from one, tokens per second from the other.

Why you need it: Temperature, top-p and stop conditions decide output length, and output length is the biggest driver of latency you control.

Why you need it: Large models are usually limited by how fast weights can be read from memory, not by raw compute. This sets what fits and how fast it runs.

GitHub repos to check out

karpathy/nanoGPTA small GPT you can read end to end in an afternoon.
karpathy/llama2.cLlama inference in one C file. Nothing is hidden.
huggingface/transformersThe reference implementations most engines start from.

Read online

The Illustrated TransformerJay Alammar. Still the clearest picture of attention.
Large Transformer Model Inference OptimizationLilian Weng. One overview of every optimisation family.
Optimizing LLMs for speed and memoryHugging Face guide with runnable examples.

Research papers

Attention Is All You NeedThe architecture everything else here serves.
Efficiently Scaling Transformer InferenceLatency and cost trade-offs of serving large models.

Foundation is understanding what the model does with a single request. Run time is the serving engine that makes one model fast for many users. Production is everything needed to keep that running under real traffic and a real budget. Kernel is the low-level code underneath it all.

You do not have to learn them in order, and you do not need all four to be useful. Most people enter from one side, either backend engineers moving toward the model or ML engineers moving toward production, and pick up the rest as problems force them to. If you are unsure where to begin, start with Foundation and Run time: they give you the vocabulary for everything else.

Resources to deep dive

A short list, in the order I would read them.

  1. Large Transformer Model Inference Optimization by Lilian Weng. The best single overview of quantization, pruning, distillation and architecture tricks.
  2. How continuous batching enables 23x throughput in LLM inference from Anyscale. Explains the batching idea every modern engine uses.
  3. Efficient Memory Management for Large Language Model Serving with PagedAttention. The vLLM paper. Read it for how the KV cache is managed.
  4. Efficiently Scaling Transformer Inference. A Google paper on the latency and cost trade-offs of serving large models.
  5. vLLM documentation. Run a model, load test it, change one setting at a time and watch the numbers move.
  6. llama.cpp. The place to learn quantized, CPU and on-device inference by doing.

Reading only gets you so far. The fastest way to learn is to pick one open model, serve it yourself, and try to double its throughput. You will touch every layer in the diagram above before you are done.