Overview
Curated: · Written: · Reviewed:
LLMOps: Deployment, Versioning & Cost Management
In one line
Release an LLM product as one pinned, content-addressed manifest (exact model revision, rendered prompt, retrieval config, tool schemas, decoding, agent graph), promote it behind gates, canary it against a pinned control, and roll back by repointing an alias. Reach for this whenever a change can alter behavior, which for an LLM product includes almost every change.
Key definitions
- Release manifest: the immutable record of every behavior-changing component, referenced by digest. Promotion moves a pointer to it.
- Pinned revision: an exact provider or model-repo revision, never an alias such as
gpt-4oorlatest. - Compatibility matrix: checks that a component loads and also means the same thing (tokenizer, chat template, embedding space, dtype, context length).
- Non-compensable gate: a critical gate whose failure blocks promotion regardless of gains elsewhere.
- Sticky canary: a server-side traffic split assigned per user, compared against a pinned control cohort.
- Expand-migrate-contract: a three-phase schema change so old and new code can both read and write the same state.
Formulas and complexity
Chance that a per-request defect fires at least once in n independent requests, with per-request rate p:
Canary example (hypothetical arithmetic): 800 rps peak at 5% is 40 rps, over 20 minutes that is 48,000 requests. At p = 1/50,000, P = 1 - (1 - 2e-5)^48000, about 1 - e^(-0.96), roughly 0.62. A 20-minute canary at 5% does not reliably surface a 1-in-50,000 defect.
Session split with a 10% canary and 3 requests per session, where a session is served by both arms:
How it works
- Every behavior-changing component is versioned and referenced by digest in one manifest.
- The artifact is built once. CI runs static, deterministic, offline golden-set and budget gates on the packaged artifact, not on a laptop.
- Promotion repoints the production alias to an already tested digest. Production never rebuilds.
- The canary splits traffic sticky by user and compares latency, cost per success and quality against the pinned control.
- Rollback repoints the alias to the previous manifest, which needs no re-evaluation. In-flight state needs idempotent tools and expand-migrate-contract schema changes.
When to use and when not to
| Situation | Use the full gated release | Trade-off that decides it |
|---|---|---|
| Prompt or tool-schema change | Yes | A renamed field silently breaks dispatch and tuned behavior |
| Model revision bump | Yes, with compatibility matrix | A later revision can behave differently under the same name |
| Shadow copy that writes or charges | No, unless side effects are isolated | Shadowing a side-effecting path double-acts on users |
| Self-hosted inference at low volume | Weigh cost first | Fixed GPU cost dominates below roughly 10^7 tokens/day, workload-dependent |
| Provider API with pinned revision | Yes | Pinning is only as good as the revisions the provider lets you pin |
Traps interviewers probe
- Versioning components separately. A prompt tuned on index v3 with top-k 10 misbehaves on v4 with top-k 8 even with identical prompt text. Fix: promote one manifest.
- Treating a valid signature or checksum as safety. Those prove identity, not behavior. Fix: require a provenance chain tied to a reviewed source commit, then run behavioral gates. A correct builder identity does not prove the source was safe.
- Mutable tags in the build.
FROM node:20-alpinecan change between builds, so two environments run different bytes from the same commit. Fix: pin base images by digest and promote the digest that staging validated. - Adapters loaded against a different base revision. The load reports no key or shape errors, yet quality drops. Fix: pin the base revision the adapter was trained on and check it in the compatibility matrix.
- Caches keyed without release identity. A cache keyed on prompt hash or model ID alone serves stale answers after a prompt or index change, which is a silent rollback. Fix: key on manifest ID, tenant, and index checksum.
Interview tips
Open with the unit: "I'd deploy one manifest, not a prompt edit: pinned model revision, rendered prompt, retrieval config, tool schemas, decoding and agent graph, identified by digest."
Expect these follow-ups:
- Canary accuracy fine, p99 tripled: check context growth, cache misses, throttling, and capacity the canary itself consumes.
- Provider retires a model on 30 days' notice: qualified fallback release through the same gates, then per-cohort migration.
- Rollback after three external API calls: idempotent operations and compensation logic, because rollback covers state, not just routing.
- Metrics dropped Tuesday: compare like with like, since pricing, evaluator, or traffic-mix changes can mimic a release effect.
- Cheap model for some requests: a measured quality-per-dollar curve per task class, with its own eval evidence.
30-second outline:
- One manifest, referenced by digest, built once and promoted without rebuilding.
- Gates on quality, safety, latency and cost, with critical safety gates non-compensable.
- Sticky canary against a pinned control, with abort criteria declared before launch.
- Rollback by alias repoint, with state handled by idempotent tools and expand-migrate-contract.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.