LLMOps
Version the request, test a required title, inspect a judge and account for traces and retries.
Version the entire request path
A reading-card application extracts a title from supplied text. A new prompt fixes two examples but changes a required title from Schema to Format. The average improves, yet one contract is broken. Operating an LLM application means preserving the exact request path and deciding which evidence allows that path to change.
The titles, outputs, timings and prices below are original fictional fixtures. Outputs are explicitly supplied arrays, not responses collected from a language model. They test evaluation and accounting logic without sending documents to a provider.
Make the request reproducible as an artifact
A prompt embedded in a handler can change with an unrelated deployment. Record its exact content identity together with the model identifier, decoding settings, output schema, retrieval snapshot and tool definitions. Store the evaluated combination as a release. A human-friendly alias may point to it, but the trace should preserve the resolved versions.
A new template can alter output even when the model stays fixed. A changed retrieval corpus can alter the answer without changing either template or model. The complete request path is therefore the review unit. For sensitive content, a content hash and controlled artifact store may be more appropriate than copying every prompt into broadly accessible logs.
Separate application failures from model variation
A model can return syntactically valid text that does not satisfy the task. Parsing, factual support, permissions and task success need separate observations. Stochastic decoding adds variation between calls; backend and model updates can change behaviour as well. Preserve the actual response when permitted, with its version and parameters, instead of assuming a later replay is identical.
For title extraction, exact string matching is an appropriate constructed criterion because the requirement says to preserve the title verbatim. For a summary, the criterion would need evidence, coverage and possibly human judgement. Choose the grader from the task; a convenient metric should not silently redefine success.
Version the inputs to every decision
Keep prompt content, schema and tool permissions in reviewable files. Treat a model migration as a candidate release and evaluate it on retained permitted cases. A model name alone may not identify an immutable backend; record whatever version evidence the service exposes and state any remaining limitation. For a self-hosted model, the tokenizer, weights, engine and quantization settings all belong to the execution description.
Changing one component at a time makes a failure easier to attribute. It is not always possible to freeze a remote service indefinitely, so retain a tested migration path and a fallback for cases whose requirements are no longer met.
Keep the mandatory release case
A release gate has more than one condition
Our eight authored input titles are Map, Queue, Cache, Trace, Budget, Clock, Schema and Drift. The expected output is the identical title. The following arrays stipulate two candidate behaviours:
| Input title | Previous output | Candidate output |
|---|---|---|
| Map | Map | Map |
| Queue | Queue | Queue |
| Cache | Cache | Cache |
| Trace | Trace | Trace |
| Budget | Budget | Budget |
| Clock | Time | Clock |
| Schema | Schema | Format |
| Drift | Change | Drift |
The previous version is correct on 6/8 and the candidate on 7/8. Before comparison, designate exact preservation of Schema as a mandatory release case, because an existing index entry depends on that title. The candidate fails this condition even though its average rises from 75% to 87.5%. This is a deliberately small regression fixture, not an estimate of general model quality.
Preserve the pairing
For item , let be the previous and candidate correctness indicators. Define . Here the differences are , whose mean is . Shared item difficulty is retained in this comparison. If estimating uncertainty by resampling, resample paired items or the larger unit that captures their dependence; do not independently resample the two score arrays.
Repeated stochastic trials belong to their originating item. A collection of nearly identical prompts is not a collection of independent users. Keep a separate representative evaluation for broader quality and refresh it with permitted, reviewed cases. A growing suite should record why each mandatory case exists so obsolete requirements do not accumulate unnoticed.
Measure the judge as a component
A judge is another measured component
An LLM judge can help assess open-ended answers, but its decisions may depend on presentation order, verbosity or other biases. Zheng and coauthors investigate these limits; their benchmark agreement cannot be assumed for a new domain (2023). Version the judge prompt and model, compare it with human-labelled cases and inspect disagreement rather than treating its score as truth.
Consider a separate fictional batch of 1,000 answers containing 100 actual defects. A detector catches 90 defects and flags 180 of the 900 sound answers. Its sensitivity is 90%, but only of alarms identify a real defect. The denominator includes both true and false alarms. A high sensitivity alone does not make an automated blocking policy usable. This is an arithmetic illustration, not a measurement of any judge.
Follow the request trace
Connect operations with one trace
OpenTelemetry represents operations as spans linked through trace and parent identities, with times and attributes. That structure lets a request be followed across component boundaries (OpenTelemetry). Record a retrieval step, each model attempt, parsing and any tool call separately when they are distinct operations.
For an original sequential trace, use these stipulated intervals:
| Operation | Start, ms | Finish, ms | Duration, ms |
|---|---|---|---|
| Validate input | 0 | 2 | 2 |
| Retrieve permitted context | 2 | 37 | 35 |
| Generate | 37 | 112 | 75 |
| Parse output | 112 | 117 | 5 |
The request lasts 117 ms. The span durations sum to the total because these operations are sequential and cover the path. Parallel children or overlapping work would invalidate that sum. The table contains no observed model latency. Its purpose is to distinguish a slow retrieval step from slow generation and to show where another attempt would appear.
Use restricted content capture with a retention policy. An operation ID, outcome, version, token count and duration often suffice for routine diagnosis. Raw prompts and retrieved documents require their own access controls; a trace store should not become an accidental public copy of user content.
Count every attempt
Account for attempts and successful tasks
Suppose a fictional call has 800 input and 120 output tokens. Choose prices of 0.000002 and 0.000006 currency units per token. The call costs . These prices are illustrative, not a current offer.
If exactly one identical-cost retry occurs with probability 0.2, expected call cost per submitted task is . If some tasks still fail, cost per successful task is higher than cost per submission. Latency also grows on the retry path, so a mean bill does not describe the tail of the user experience.
Enforce permissions and fallback rules
Enforce constraints at the action boundary
Validate output structure before the application consumes it. A valid schema does not prove a supported answer. Check identifiers and citations against the actual permitted context, and enforce tool authorization in ordinary application code. Retrieved text is data; it must not grant new permissions merely because the model repeats its instructions.
Bound retries by attempt count, time and cost. Keep a failed parse as a failed attempt even if a later repair succeeds. For title extraction, a deterministic extraction fallback can be acceptable when its requirements are explicit; a model should not invent a title to hide a parsing failure.
Cache a result only within its valid boundary
An exact response cache needs the inputs, release identity, relevant access scope and context version. A prefix cache reuses intermediate model state; its mechanism belongs to LLM inference systems. A semantic cache deliberately treats different requests as equivalent and therefore needs evaluation of false matches. Similar wording can conceal different requested actions, such as saving a preview versus saving its source file.
Invalidating only the prompt key is insufficient when the retrieved material changes. A cached failure also needs different lifetime rules from a successful extraction. Measure useful correct reuse, not just hits.
Route by an evaluated acceptance rule
A small model can attempt a task before a larger fallback, but its own confidence is not automatically an acceptance test. Validate the output against the task contract. If 20 of 100 tasks reach the larger model, average model cost is , where is the first-attempt cost and the fallback cost. This follows by counting 100 small and 20 large calls; it assumes each path makes only those calls.
A fallback can improve coverage while changing latency, privacy boundaries or output style. Track it as a separate route in evaluation and traces. When no route meets the contract, expose a failure or defer to an authorized person rather than silently redefining success.
What changed
The candidate's broken mandatory case is visible despite a higher mean. Every call and retry has a place in provenance, tracing and cost. Judge outputs are evaluated evidence with an error model, and tools remain controlled by application permissions.
Limits
The eight titles are too small and regular to measure real language-model capability. The detector counts and trace durations are stipulated, and no provider was exercised. Production evaluation also needs representative language, document and adversarial cases, permitted collection, repeat trials where appropriate, and checks of the complete deployed path.
What to retain
Version the whole request path. Separate syntax, support and task success. Preserve paired evaluations and mandatory contracts. Calibrate judges on the intended domain. Trace attempts and enforce permissions outside the model. Count cost per useful completion.
Next
Responsible ML considers how decisions, data collection and explanation affect the people using the system.
References
- Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez and Ion Stoica. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. NeurIPS Datasets and Benchmarks, 2023: judge limitations and biases. No benchmark questions, votes or model outputs reused.
- OpenTelemetry contributors. Traces, checked 13 November 2026: spans, context, parents and attributes. The operation table and timing data are original; no documentation payload is copied.
- vLLM contributors. Automatic Prefix Caching, checked 13 November 2026: distinction between prefix-state reuse and response caching. No engine code or model artifact reused.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Go deeper — optional
Code and labs do not count toward the main percentage or the certificate.
- A mandatory case, judge and retry ledgeroptional
Titles, outputs, judge counts, spans and token prices are fictional inputs. No model, paid API or private prompt is used. A predeclared required case can block release even when average correctness improves.
~20 min · easier on a computer · The corresponding lesson and basic Python functions.
Self-check in the notebook — not part of mastery or the certificate.
Answers are saved on the server and tied to this browser until you sign in.