sr·Sachin RajputInference, explained · blog

The blog · LLM inference

What happens
after you hit
Enter.

LLM inference explained simply, and measured for real: tokens, prefill, decode, the KV cache, batching and more. Every claim comes with code you can run and time yourself.

ONE REQUEST · TOY ENGINEPART 1

“Why is the sky blue?”

Why␣is␣the␣sky␣blue?
The␣sky␣looks␣blue␣because▍
TokenizePrefillDecodeStream
TTFT · 256-token prompt1.66 s
Gap between tokens (p50)107 ms
KV cache per token72 KB
blog.sachinrajput.dev · by Sachin RajputVisit the main site

01 / Latest

Latest
articles.

Short, friendly on-ramps to how production LLMs really serve answers. Start anywhere, or read the series in order.

02 / Series

Inference Foundations
1 of 10 published.

How AI chatbots actually answer you, explained simply and measured for real. Short, friendly on-ramps to LLM inference: tokens, prefill, decode, the KV cache, batching and more.

  1. One Request, End to End: Tokenize, Prefill, Decode, Stream14 min read
  2. A Forward Pass for One Token: Where the FLOPs GoComing soon
  3. Prefill vs Decode: Two Phases, Two BottlenecksComing soon
  4. The Roofline Model for LLM InferenceComing soon
  5. The KV Cache From ScratchComing soon
  6. How Much GPU Memory Do I Need?Coming soon
  7. Continuous Batching and PagedAttentionComing soon
  8. Speculative Decoding BasicsComing soon
  9. Tensor, Pipeline and Expert ParallelismComing soon
  10. Quantization Formats: FP16, BF16, FP8, INT8, INT4Coming soon

New article every few days

Get the next one
as it ships.

How AI models really answer you, explained simply and measured for real. I share every new part on LinkedIn first, and the RSS feed has the full text.