Back to Blog
Published:
Last Updated:
Recently Updated
Production LLMOps & EvaluationFoundational guide

The Production LLMOps Stack: Evals, Judges, Retries, Circuit Breakers

11 min read
2,200 words
high priority
Mudassir Marwat

Mudassir Marwat

Founder & CEO, Cognilium AI

The Production LLMOps Stack: Evals, Judges, Retries, Circuit Breakers — Cognilium AI

TL;DR

The day-2 ops layer of an LLM product — what to evaluate, what to judge in real time, what to retry, and when to fail closed. The components that turn a prototype into something operable.

A working prototype of an LLM product proves the model can do the task. A production deployment proves the system can survive the model — its failures, slowdowns, drift, cost spikes, and the gap between a passing test set and real user inputs. The stack that handles this is roughly the same across products and worth describing as a unit.

Layer 1: offline evals

Evals are fixed test sets that exercise known good and bad behaviors. They run in CI, gate releases, and answer one question: did this prompt change make the system better, worse, or unchanged? Three eval types cover most products.

  • Acceptance evals — N hand-crafted queries with N expected behaviors. Pass/fail. Runs in <60s. ~50 examples is usually enough to catch regressions.
  • Adversarial evals — queries designed to break the system. Prompt injections, edge cases, ambiguous inputs. Pass means "the system handled it gracefully," not "the system got it right."
  • Drift evals — a sample of real user queries from the previous week, replayed against the new prompt. Looks for behavior changes you did not intend.

Layer 2: online judges

Judges run per request, in real time, on the actual generation. They produce a 0-100 score; below the threshold the system retries (with a stricter prompt, higher temperature, or different model). The judge is itself a smaller LLM call with a structured rubric — for a coaching app, the rubric covers groundedness, vocabulary fidelity, format compliance, and tone.

The judge is not a replacement for evals. Evals catch regressions across releases; judges catch bad outputs in flight. Without evals you ship regressions; without judges you ship the bad output to a user who notices.

Layer 3: retries and time budgets

Retries handle transient errors — rate limits, 5xx, timeouts. Two tiers: internal exponential backoff (1s, 2s, 4s) for known-recoverable; queue-level redelivery (SQS visibility / Pub/Sub ack-deadline) for worker crashes.

Time budgets bound the entire request. A 60-second cap on a coaching-lesson generation means the judge gets the time it needs even after two retries. Budget-aware retry logic checks "do we have time for another attempt?" before each tier.

Layer 4: circuit breakers

When upstream model availability degrades — 3 consecutive timeouts in 30 seconds, or judge fail-rate above 5% in 5 minutes — the circuit breaker opens. New requests get a fast-fail response or queue for later. Retrying through a degraded upstream amplifies the problem; the circuit breaker is the system saying "this is not transient, stop trying."

Layer 5: observability

Per-request: request_id, model, prompt version, judge score, retry count, latency p50/p95, cost. Per-tenant: daily cost, error rate, generation volume. Per-prompt-version: judge score distribution over time (drift detection), cost per request (efficiency tracking). Logs go to a structured store; dashboards expose the per-tenant cuts.

Layer 6: cost guardrails

  • Per-tenant daily cost budget with alarm at 80% and hard cap at 100%
  • Per-request token cap (input + output) — most generations should fit; outliers are bugs
  • Model selection by task complexity — judge uses GPT-4o-mini, generator uses GPT-4o, summarizer uses Haiku
  • Cache hit ratio for prompt prefixes — measure and optimize

Smallest viable stack

Not every team needs every layer day one. The minimum viable stack: 50-example acceptance eval in CI, one judge call per generation, two-tier retry on transient errors, per-tenant cost alarms. Add circuit breakers when you see your first cascading failure. Add drift evals when your first prompt regression slips through. Build out as you hit the failure modes, not before.

What we measured across systems

  • Judge cost overhead: 15-25% of per-request cost
  • Eval gate prevented ~1-2 prompt regressions per month from shipping
  • Two-tier retry recovered ~98% of transient failures without user-visible impact
  • Circuit breaker fire rate steady-state: <0.1% of requests; usually upstream rate-limit episodes

Share this article

The work behind this series

Evaluation harnesses, judges, retries and circuit breakers — how we keep an agent system honest once real traffic arrives.

Mudassir Marwat

Mudassir Marwat

Founder & CEO, Cognilium AI

Mudassir Marwat's argument is that ERP systems record decisions they never optimise.

Founder & CEO of Cognilium AI; 37 AI agents in production across four products; 4 production AI products built and operated; three clouds in production (AWSGCPAzure)
Agentic AIRAG → GraphRAG retrievalVoice AIMulti-Agent Orchestration

Frequently Asked Questions

Find answers to common questions about the topics covered in this article.

Eval is offline measurement on a fixed test set — runs in CI, gates releases. Judge is online validation on real outputs — runs per request, gates delivery. Both are necessary; neither replaces the other.
Typically 15-25% — the judge call is a smaller model on a structured task. For a $0.10 main generation, judge adds ~$0.02. Cheaper than fixing a broken output reactively.
When upstream model availability degrades (>3 consecutive timeouts in 30s) or when judge fail-rate spikes (>5% in 5 minutes). Either signals a bad state where retries amplify the problem instead of recovering.
Less of it. The hosted API absorbs some retry, rate-limit, and stability concerns. You still need eval, judge, and observability — the model behaves differently across versions and the hosted API does not catch business-logic failures.
Eval on a 50-example test set in CI. One judge call per generation. Two-tier retry on transient errors. Per-tenant cost budget alarms. Everything else is optional until your usage demands it.

Still have questions?

Get in touch with our team for personalized assistance.

Contact Us

Still have a question this did not answer?

The person who wrote this article answers these. Describe your setup and what you are stuck on — you will get a straight answer, including where we think the approach is wrong.

Related Articles

Continue exploring related topics and insights from our content library.

LLM-as-Judge With Temperature-Escalation Retry Inside a 60-Second Budget
7 min
1
Mudassir Marwat
May 5, 2026

LLM-as-Judge With Temperature-Escalation Retry Inside a 60-Second Budget

Judge scores below 85? Retry with temperature 0.3, 0.4, 0.5 — three attempts inside a 60-second wall-clock budget. The simple loop that hits 99.5% on-spec output without crossing the latency ceiling.

words
Read Article
Smart Category-Score Routing That Cuts LLM Cost ~75%
7 min
2
Mudassir Marwat
May 5, 2026

Smart Category-Score Routing That Cuts LLM Cost ~75%

A pipeline of 12 scorers + 11 analysts does not need to fan out everywhere. Route each chunk to matching analysts and save three quarters of the LLM bill.

words
Read Article
Smart Category Routing for Contract Review
6 min
3
Mudassir Marwat
May 5, 2026

Smart Category Routing for Contract Review

A focused application of the LLMOps routing pattern to legal contract analysis — the analyst-selection logic that ships fewer clauses to fewer agents and finishes a 3,300-call review in 154 seconds.

words
Read Article

Explore More Insights

Discover more expert articles on AI, engineering, and technology trends.

Personalized for You

Curated content recommendations based on your current reading and interests.

LLM-as-Judge With Temperature-Escalation Retry Inside a 60-Second Budget — Cognilium AI
Trending
114%

LLM-as-Judge With Temperature-Escalation Retry Inside a 60-Second Budget

Same topic cluster: Production LLMOps & Evaluation
Same author: Mudassir Marwat

Judge scores below 85? Retry with temperature 0.3, 0.4, 0.5 — three attempts inside a 60-second wall-clock budget. The simple loop that hits 99.5% on-spec output without crossing the latency ceiling.

Mudassir Marwat
7 min read
Production LLMOps & Evaluation
Read Article
Trending
30%

Is your Dynamics 365 F&O ready for AI agents?

High priority content
Related topic cluster: Procure-to-Pay Agent Operations

Six checks in the order that blocks a project. Version and tier are binary. The two that stop most pilots are who may connect and who owns the identity.

Ali Ahmed
6 min read
Procure-to-Pay Agent Operations
Read Article
Smart Category-Score Routing That Cuts LLM Cost ~75% — Cognilium AI
For You
104%

Smart Category-Score Routing That Cuts LLM Cost ~75%

Same topic cluster: Production LLMOps & Evaluation
Same author: Mudassir Marwat

A pipeline of 12 scorers + 11 analysts does not need to fan out everywhere. Route each chunk to matching analysts and save three quarters of the LLM bill.

Mudassir Marwat
7 min read
Production LLMOps & Evaluation
Read Article
Bias-Detection Alerts on a 4-Agent Candidate Evaluation Pipeline — Cognilium AI
For You
101%

Bias-Detection Alerts on a 4-Agent Candidate Evaluation Pipeline

Same topic cluster: Production LLMOps & Evaluation
Same author: Mudassir Marwat

A four-agent hiring pipeline is a regulated decision system. Continuous monitoring with alerts at the four-fifths-rule disparity-impact threshold.

Mudassir Marwat
7 min read
Production LLMOps & Evaluation
Read Article
Your multi-agent system is a black box. A broken microservice returns a 500, but a broken agent returns a 200 OK and a confident wrong answer, so your dashboard stays green while the system is wrong. Four things you cannot see without instrumenting the run: who spent the tokens, where it broke, whether the run is healthy, and whether the brakes tripped. Instrument it, or you are flying blind and calling it production.
Trending
77%

Your Multi-Agent System Is a Black Box

Same author: Mudassir Marwat
Preferred author

You gave the agents brakes in the last chapter. Brakes stop a runaway, but they do not tell you which agent is dragging, what a run costs, or why last night's batch tripled. Most multi-agent systems ship to production as a black box: the team can see that a run happened and returned, and nothing in between. Worse, agent failures are silent, they return a 200 OK with a confident wrong answer, so uptime and error rate read green while the output is wrong. This chapter builds the instrument panel: the trace tree as the unit of observability, per-span cost attribution that finds the one agent owning two-thirds of the bill, structural sampling that keeps every run worth investigating, and continuous semantic evaluation, the only signal that catches a wrong answer no system metric will flag. Brakes stop a runaway. Instruments show it coming.

Mudassir Marwat
11 min read
Multi-Agent Systems in Production
Read Article
The exposed movement of a mechanical clock
For You
74%

What is nanochat? Andrej Karpathy's full-stack LLM, explained

Same topic cluster: Production LLMOps & Evaluation
Matches your interests

nanochat is Andrej Karpathy's minimal end-to-end ChatGPT clone: tokenizer, pretraining, fine-tuning, inference and a web UI in one small codebase you can read.

Ali Ahmed
4 min read
Production LLMOps & Evaluation
Read Article

Smart Recommendations

Our AI analyzes topic clusters, author expertise, and content relationships to surface the most relevant articles for you.

Topic Matching
Author Expertise
Content Quality
Personal Interests

Questions on this?

Talk to an engineer

Schedule a call