Skip to content

Serving Large Language Models

For people

The techniques behind fast, affordable LLM inference: batching, KV caching, quantisation and serving frameworks.

Editorial team 1 min read

Serving language models efficiently is different from serving traditional models.

Why It's Hard

  • Large models need lots of GPU memory.
  • Generation is sequential, token by token.
  • Request lengths vary widely.

Key Techniques

  • Continuous batching: add and remove requests from batches as they start and finish, greatly improving throughput.
  • KV caching: store attention keys and values from earlier tokens to avoid recomputation.
  • Paged attention: manage cache memory efficiently.
  • Quantisation: smaller, faster models.
  • Speculative decoding: a small model drafts tokens that the large model verifies in parallel.
  • Prefix caching: reuse computation for shared prompt prefixes.

Serving Frameworks

Open-source inference servers implement these techniques and expose standard APIs.

Metrics

  • Time to first token.
  • Tokens per second per request.
  • Total throughput.
  • Cost per million tokens.

Build or Buy

Managed APIs are simpler; self-hosting gives control and can be cheaper at scale, if you have the expertise.

More in MLOps & deployment

All MLOps & deployment guides →
MLOps & deployment Guide · 2 min

What Is MLOps?

The practices that take machine learning from notebook to reliable production: versioning, automation, deployment and monitoring.

MLOps & deployment 2 min read 27 Dec 2025 For people

MLOps & deployment Guide · 2 min

Deploying Machine Learning Models

Batch scoring, real-time APIs, streaming and on-device inference: choosing how predictions reach users, and deploying safely.

MLOps & deployment 2 min read 26 Dec 2025 For people

MLOps & deployment Guide · 2 min

Monitoring Machine Learning Models in Production

What to monitor after deployment — data, predictions, outcomes and operations — and how to respond when things change.

MLOps & deployment 2 min read 25 Dec 2025 For people

MLOps & deployment Guide · 2 min

Model Registries and Versioning

Why every production model needs a version, metadata and lineage, and how a model registry manages promotion and rollback.

MLOps & deployment 2 min read 24 Dec 2025 For people

Share X LinkedIn Reddit Bluesky Email

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in