What is LLMOps?
LLMOps is the engineering system used to evaluate, deploy, observe, and improve applications built on probabilistic models. It extends ordinary software operations because the same valid input can produce different wording, tool choices, or reasoning paths across model versions and runs.
Traditional tests still matter. APIs, permissions, calculations, and schemas should be deterministic. LLMOps adds evidence for the behavior that cannot be proven by ordinary unit tests alone.
Why do AI prototypes fail in production?
A prototype is usually tested by its builders on cooperative examples. Production introduces ambiguous requests, prompt injection, long conversations, missing data, provider limits, tool failures, and users who interpret the answer differently.
The common failure is not simply “hallucination.” It is an incomplete operating model:
- prompts and model versions are changed without regression testing;
- tool calls are observed only in server logs;
- evaluations contain polished examples rather than real traffic;
- latency and cost are measured separately from answer quality;
- the system has no safe abstention or human handoff;
- incidents cannot be replayed from the original context.
What belongs in the LLMOps loop?
Version everything that changes behavior
Record the model snapshot, system prompt, tool schemas, retrieval configuration, safety policy, and evaluation dataset version. A model name alone is not enough to reproduce an output.
Evaluate before and after deployment
Build datasets from actual tasks, known failures, adversarial inputs, and edge cases. OpenAI’s evaluation guidance recommends defining the objective, collecting a dataset, choosing metrics, and continuously evaluating changes.
Trace the complete workflow
Capture model generations, retrieval results, tool calls, guardrail decisions, retries, and handoffs under one trace identifier. The OpenAI Agents SDK tracing documentation illustrates this span-based approach for agent runs.
Control behavior at runtime
Apply schema validation, permission checks, content controls, rate and spend limits, timeouts, circuit breakers, and human approval. Keep these controls outside natural-language instructions whenever possible.
Learn from production
Sample outcomes, review user feedback, cluster failures, and add confirmed cases to the evaluation set. Improvement should turn incidents into regression tests.
Semantic Cache
15ms Response
Input Guardrails
PII & Injection Filter
Reasoning Engine
LLM / Agentic Logic
Output Validator
Hallucination Check
Analytics / Tracing
Full Observability
How do you build a useful evaluation set?
Start with the decisions the system must get right. A support assistant might need to identify the account issue, retrieve the correct policy, avoid exposing another customer’s data, and escalate exceptions. Each requirement becomes one or more labeled cases.
Include:
- typical successful requests;
- incomplete and contradictory requests;
- unsupported questions where the model should abstain;
- prompt-injection attempts;
- stale or conflicting retrieved sources;
- tool timeouts and partial failures;
- multilingual or domain-specific phrasing;
- high-impact actions requiring approval.
Avoid one aggregate score. A model can improve tone while becoming worse at citations. Track metrics by failure category and business risk.
| Layer | Example metric | Failure it reveals |
|---|---|---|
| Retrieval | Evidence coverage and relevance | The answer never received the needed facts |
| Generation | Correctness and groundedness | The model added unsupported claims |
| Tools | Argument and outcome accuracy | The right tool was called incorrectly |
| Safety | Detection and safe completion | A harmful or unauthorized path remained open |
| Operations | Latency, cost, and recovery | The workflow is correct but unusable at scale |
What should be in an AI trace?
A trace should answer what happened without exposing more sensitive data than operations require.
Record:
- request and tenant identifiers;
- model, prompt, and policy versions;
- retrieval queries and selected source identifiers;
- tool name, validated arguments, result status, and duration;
- guardrail and authorization decisions;
- token usage, cache use, latency, and retries;
- final outcome, user feedback, and human intervention.
Use redaction and retention policies. Observability data can become a second sensitive-data store if complete prompts and tool results are retained indefinitely.
How should guardrails be layered?
No single guardrail can understand every context. Use several narrow controls:
- input controls for injection, data classification, and request policy;
- retrieval controls for tenant and document authorization;
- tool controls for schema, scope, and action approval;
- output controls for groundedness, sensitive data, and format;
- workflow controls for budgets, loops, timeouts, and escalation.
A model judge is not the final authority
Model-based graders are useful for nuanced review, but calibrate them against human labels and pair them with deterministic checks. Authorization, financial totals, identifiers, and required fields should not depend on an LLM score.
What does recovery look like?
Design for failure before adding autonomy.
- Retry only transient failures and use bounded backoff.
- Use idempotency keys for tools that can create side effects.
- Fall back to a smaller capability, not a fabricated answer.
- Preserve a human-readable incident trail.
- Pin or roll back model and prompt versions.
- Degrade to search results or a support handoff when generation is unavailable.
- Stop agent loops with time, cost, and step budgets.
A reliable AI system knows when to do less.
A production release checklist
Before shipping a model or prompt change:
- run the regression and safety suites;
- compare quality, latency, and cost to the current version;
- inspect failures rather than only averages;
- canary the change on a controlled traffic segment;
- verify dashboards and alert thresholds;
- confirm rollback and provider-failure behavior;
- document the decision and responsible owner.
NIST’s AI Risk Management Framework provides a broader governance structure around these activities. LLMOps is how teams turn that structure into repeatable operational evidence.