LLMOps & Production

Authors 58 articles 698 min total read

This theme is curated by our AI council — see how it works.

LLMOps is the discipline of running large language models in production: routing every request to the right model, containing token costs, surviving provider outages, and proving — with traces, logs, and controlled experiments — that the system still behaves the way it did yesterday. The theme spans the full operational stack, from the gateway a request enters to the audit trail it leaves behind. This page maps that stack: what to read first, what each layer is for, and where the layers get confused with each other.

  • The model call is the easy part; production LLM systems fail in the layers around it — routing, retries, cost control, and observability.
  • An LLM app can degrade with no deploy and no exception: a provider swaps a model, a prompt regresses, spend drifts. Only instrumentation catches it.
  • Cost, latency, and quality are one coupled trade-off — the same routing or caching decision moves all three at once.
  • This theme has three tiers: two foundations, four core control layers, four production-hardening topics. Read them in that order.

Why LLMOps matters for engineers shipping AI features

A prototype that calls one model endpoint is a weekend project; the same feature in production is a distributed system with a nondeterministic dependency you don’t control, billed by the token. Providers rate-limit you, deprecate models under you, and fail in ways your existing retry logic makes worse. For a developer, LLMOps reframes “AI in production” into familiar engineering territory — traffic management, resilience patterns, cost budgets, and telemetry — with one crucial difference: the failure you must catch most often is not an error but a silent change in output quality.

MONA asks: 'Why does my existing retry logic make an LLM outage worse?' MAX answers: 'Providers rate-limit and deprecate under you, and the failure that matters is silent quality drift, not an error.' — comic dialog.
Production LLMs fail silently; telemetry has to catch quality, not errors.

Start here: observability and the gateway, the foundations of LLMOps

Two concepts carry everything else in this theme, and they mirror a pattern every backend engineer already knows: instrument what you run, and put a control point in front of what you don’t.

Instrumentation comes first, because in an LLM system you cannot debug what you didn’t record. LLM observability adapts distributed tracing to prompt chains — how span-based tracing captures every step of a prompt chain is the best first read in the theme, and the MLOps prerequisites no observability tool can fix is its honest companion on what tooling cannot save you from. When you are ready to pick a platform, the Langfuse vs LangSmith vs Arize Phoenix comparison shows how production teams actually split the market.

The control point is the LLM gateway: a proxy layer between your applications and every model provider, owning routing, rate limits, authentication, and unified logging in one place. How request routing, fallback, and unified auth work under the hood explains the architecture; the counterweight read, gateway latency and single points of failure, tells you the price of putting a chokepoint in front of all your AI traffic — worth reading before you commit to one, not after.

With these two in place — a gateway you control and traces you can query — every layer in the next tier has somewhere to live and a way to be measured.

The core LLMOps control loop: routing, cost, resilience, versioning

This tier is where the day-to-day production decisions live, and each of its four layers plugs into the foundations: the gateway enforces them, observability verifies them.

Model routing decides which model serves which request — by cost, latency, or required quality — so simple queries stop paying frontier-model prices. What model routing is and how gateways direct requests is the orientation read; cost metrics, latency budgets, and fallback logic covers what you must measure before writing your first routing rule. Routing is also the biggest lever in LLM cost management, the discipline of keeping token spend proportional to value — start with how token-based pricing scales in production, then move to the hands-on guide to cutting costs with routing, prompt caching, and batch APIs.

Resilience is its own layer because provider APIs fail in correlated, rate-limited ways that generic retry libraries handle badly. LLM fallback and retry patterns cover exponential backoff, circuit breakers, and provider failover — read how backoff prevents API cascade failures first, then what makes LLM retry logic break for the thundering-herd and timeout traps; the multi-provider failover guide with LiteLLM, Portkey, and Tenacity turns the patterns into working code.

The quietest layer is the model registry — the versioned catalog recording which model artifact, weights, and configuration are actually deployed, so rollbacks and audits have something to point at. How MLOps artifact stores work is the entry point, and the MLflow vs W&B vs SageMaker vs DVC comparison is the decision read when your team picks one.

Run these four and you have a system that routes sensibly, spends predictably, survives outages, and knows what version of itself is running. What it doesn’t yet have is proof — that it holds under load, that changes actually improve it, and that its records would satisfy an auditor. That is the next tier.

Advanced LLMOps: load testing, experimentation, and audit-grade logging

This tier separates a system that works from a system you can defend — to an SRE, a compliance officer, or your own postmortem.

LLM load testing replaces classic requests-per-second thinking with token-aware metrics: time-to-first-token, tokens per second, p99 latency under concurrent streams. How TTFT, tokens-per-second, and p99 latency are measured is the orientation read; the vLLM benchmark suite and GenAI-Perf guide gets you a reproducible benchmark harness.

Load testing tells you the system is fast; A/B testing for LLMs tells you a change made it better. It is harder than testing a button color, because output quality has no click-through rate — sample size, statistical power, and why measuring LLM quality is hard explains the statistical trap, and LLM-as-judge vs human raters weighs the two ways to score variants at scale.

LLM logging and auditing extends observability’s traces into compliance territory: prompt/response capture, PII redaction, cost attribution, and audit trails that survive a regulator’s questions. How production systems capture prompts, costs, and traces is the entry point; PII redaction, trace sampling, and the limits of logging at scale covers what breaks when volume grows.

The last topic operates inside the request itself. Context window management decides what fits into the model’s token budget — conversation summaries, sliding windows, priority-based packing — and it is where latency, cost, and quality collide in a single decision. The token limits that shape every LLM interaction explains the constraint, and how real products handle context limits shows how teams resolve it now that 10M-token windows compete with compression.

How the LLMOps traffic layers differ

The three traffic-control concepts in this theme — gateway, routing, fallback — get used interchangeably, and the confusion produces real architecture mistakes. They answer different questions:

LLM gatewayModel routingFallback and retry
Question it answersWhere do all requests pass throughWhich model should serve this requestWhat happens when the call fails
When it actsEvery request, alwaysPer request, before the callOnly on failure or timeout
Optimises forControl, auth, unified loggingCost, latency, quality fitAvailability
Failure it preventsKey sprawl, unmanaged providersOverpaying frontier models for trivial queriesOne provider outage taking your feature down

Three more pairs blur just as often:

  • Observability vs logging and auditing. Observability serves engineers debugging behavior — traces, latency, regressions. Logging and auditing serves records that outlive the incident — compliance, cost attribution, redaction. Same raw events, different consumers, different retention rules.
  • Load testing vs A/B testing. Both are experiments, but load testing varies traffic against one configuration, while an A/B test varies configuration under real traffic. One proves capacity, the other proves improvement — neither substitutes for the other.
  • Model registry vs gateway config. The gateway knows which endpoint receives traffic right now; the registry knows which artifact and version that endpoint serves and how it got promoted. Teams that keep only gateway config lose the rollback trail.

Common questions

Q: Where should I start with LLMOps as a backend developer? A: Instrument before you optimize: without traces you cannot see which layer needs work. Start with span-based tracing for prompt chains, then put a gateway in front of your providers — the rest of the stack plugs into those two.

Q: Do I need a full gateway, or is a retry library enough? A: A retry library saves a single service from transient errors; a gateway pays off once multiple apps, providers, or teams share LLM traffic and need one place for auth, limits, and failover. The LiteLLM and Portkey deployment guide shows what a gateway adds beyond retries.

Q: Should I cut costs with model routing or with caching? A: They attack different waste: routing stops you overpaying for simple queries, caching stops you paying twice for repeated context. Route first if traffic is varied, cache first if prompts repeat. Model tiering vs prompt caching gives the decision rules.

Q: Why did output quality drop when nothing was deployed? A: Usually a change you didn’t make: a provider updated a model, a fallback silently switched routes, or accumulated context crossed a truncation threshold. Silent model switching and opaque fallbacks covers the accountability gap; regression alerts on your traces are how you catch it early.

Q: What do I need in place before running LLM A/B tests? A: Stable observability, cost attribution per variant, and an evaluation method you trust — statistical power over LLM outputs is far harder to reach than over click-through rates. How controlled experiments evaluate prompt and model variants lists the prerequisites.

Q: How do I plan capacity for an LLM feature before launch? A: Load test with token-aware metrics, not requests per second — streaming makes TTFT and tokens-per-second the numbers users actually feel. Load testing architecture: key components and metrics covers what to measure and which bottlenecks appear only under concurrency.

Developer orientation

Coming from software engineering? Bridge articles map this theme onto what you already know — which of your instincts still apply, which quietly break, and where to dive deeper once you're oriented.

Browse all 10 topics

A/B Testing for LLMs →

A/B testing for LLMs runs controlled experiments that compare two or more prompt versions, model configurations, or …

6 articles

Context Window Management →

Context window management encompasses the techniques used to fit relevant information within an LLM's fixed token limit …

5 articles

LLM Cost Management →

LLM Cost Management covers the strategies and tooling used to control operational expenses in LLM-powered systems. It …

6 articles

LLM Fallback and Retry Patterns →

LLM fallback and retry patterns are resilience strategies that keep AI-powered applications running when a model …

5 articles

LLM Gateway →

An LLM Gateway is an API management layer that sits between your application and one or more LLM providers. It handles …

6 articles

LLM Load Testing →

LLM load testing measures how an AI system performs under realistic traffic — tracking tokens-per-second output, …

6 articles

LLM Logging and Auditing →

LLM Logging and Auditing covers production practices for capturing, storing, and analyzing prompt/response pairs in LLM …

5 articles

LLM Observability →

LLM Observability is the practice of monitoring, tracing, and debugging large language model applications in production. …

7 articles

Model Registry →

A model registry is the often-overlooked bridge between training and production: it enforces that every deployed model …

6 articles

Model Routing →

Model routing is the practice of dynamically directing each LLM request to the most appropriate model based on query …

6 articles

Four perspectives on this domain