# Design an Eval and Monitoring Platform

> How to build a platform that tests an AI app before each release and watches it after launch, explained simply for your AI interview.

**In short:** An eval and monitoring platform (evals are scored tests for AI apps) tests each change against real cases before release, then samples live traffic to catch quality drops after it. Both jobs use the same scores, so a team can see whether a change helped or hurt.

AI and LLM interview question Q372, LLM system design. Advanced, occasional (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/design-an-eval-and-monitoring-platform

## Say it in 30 seconds

An eval and monitoring platform does two jobs. Before a release, it runs every change through a fixed set of real cases and gates the release on the scores. After release, it samples live conversations, has a judge score them, and alerts us when a topic gets worse. The hard part is averages, because a total can look fine while one topic breaks. So I'd gate each topic on its own.

## Say it in 2 minutes

Start with the problem. An AI app changes all the time: a new prompt, a new model version, a new tool. Without measurement, the team learns about a bad change when a customer complains. An eval and monitoring platform turns quality into numbers, checked every time something changes and watched all the time after launch.

The offline side is a golden set of real past cases, each with a good answer or a rubric. Every candidate change runs through it in CI, and a gate blocks the release when a topic drops past its limit. The online side saves a trace for each conversation, samples a small share, and has a judge model score them. Dashboards show quality, cost and speed by topic, and an alert fires on a drop.

The part people miss is averages. A new model can keep the overall score steady while one topic falls hard, so I gate every topic first, then look at the total as a second signal. I also keep a person reading transcripts each week, because a judge can be wrong. Anthropic's guidance backs this: it does not take eval scores at face value until someone digs into the details and reads some transcripts.

Be honest about the limits. Evals measure what you wrote down, the field is still young, and a platform catches regressions early but does not prove the app is safe. I'd say that out loud in the interview.

## What is an eval and monitoring platform, in plain words?

An eval is a test for an AI app: a fixed set of inputs and a way to score the answers. Monitoring is the watching that happens after launch, when real users ask things nobody planned for. A platform keeps both in one place, so the team reads the same scores before and after each change.

Think of a bank's internal audit team. Before a new process goes live, they run it through test cases. After it goes live, they check a sample of real transactions every week, because real life throws up cases the test pack missed.

Here is the AI version, with made-up numbers. A card-support assistant answers fee and dispute questions for about 40,000 chats a month. Its team changes the prompt every week, and each new model version is an unknown. Without a platform, every change is a guess.

- **Golden set:** A fixed list of real past cases, each with a good answer or a rubric (a written checklist of what a good answer must include).
- **Trace:** The full record of one conversation: prompts, replies, tool calls and timings.
- **Judge model:** A second AI model that scores answers against a written rubric. People check its scores too.
- **Drift:** Slow change in what users ask or how the app behaves, so old scores mean less.

## How does the platform decide a change is safe to release?

Before release, the change runs through the golden set in CI, the automatic build check. The eval runner scores every case, and a gate compares each topic with the version now live. It blocks the release when any topic falls past its agreed limit.

Scores move from run to run, so a small drop on a few hundred cases can be noise. Run each case more than once, and treat a drop as real only when it is bigger than the spread between runs.

*Diagram, Before release: the gate: A change enters with the golden set and goes through the runner. The gate compares each topic and holds the release if one falls too far. Only a release that passes every topic ships.*
1. The fixed cases go into the runner.
2. The change under test goes in too. The live version gets the same cases in the gate, so the two scores are comparable.
3. The runner passes its per-topic scores to the gate.
4. The gate lets the release through only if no topic falls past its limit.

Now a worked case with made-up numbers. The new model scores well overall, yet it breaks dispute questions. Gating on the total misses it, and gating each topic catches it.

- **Total only: Ships a broken topic.** Fees hold, and the total drops about 3 points. The total limit is 5 points, so the release passes.
- **Each topic: Holds the release.** Disputes fall 13 points, over the 3 point limit, so the prompt gets fixed first.

```python
# Made-up eval results for one new model version, split by topic.
# A 5 point gate on the total alone would ship this release; a 3 point gate per topic blocks it.
BASELINE = {"fees": 0.96, "disputes": 0.94, "limits": 0.95}
NEW = {"fees": 0.96, "disputes": 0.81, "limits": 0.95}
CASES = {"fees": 400, "disputes": 300, "limits": 500}  # golden cases per topic

def overall(scores):
    total = sum(CASES.values())
    return sum(scores[t] * CASES[t] for t in CASES) / total

def gate(base, new, max_drop=0.03):  # one limit for every topic; a real gate sets a tighter one for disputes
    print(f"overall: {overall(base):.3f} -> {overall(new):.3f}")
    for topic in CASES:
        drop = base[topic] - new[topic]
        verdict = "BLOCK" if drop > max_drop else "ok"
        print(f"{topic:<10} {base[topic]:.2f} -> {new[topic]:.2f}  {verdict}")
    return all(base[t] - new[t] <= max_drop for t in CASES)

print("release passes:", gate(BASELINE, NEW))
```

Output:

```text
overall: 0.951 -> 0.918
fees       0.96 -> 0.96  ok
disputes   0.94 -> 0.81  BLOCK
limits     0.95 -> 0.95  ok
release passes: False
```

Who sets the limits? The product owner and the risk team, from what the business can accept. A wrong dispute answer costs more than a wrong greeting, so the dispute limit is tighter.

> **Tip:** Asked how you'd set up the gate? Say you check each topic against its own limit. The total is a second signal, not the gate.

## How do you watch quality once real users arrive?

Offline tests only cover the cases someone wrote down. Real users ask new things every day, so the platform also records a trace for each conversation and samples a share of them for a judge to score. Google's evaluation guide also says to build test data by sampling production logs.

*Diagram, After release: watching live traffic: Each conversation becomes a trace. A small random sample goes to a judge, whose scores feed a dashboard and an alert. A person reads the flagged chats the same day.*
1. Traces are picked at random, a small share at a time.
2. The sampled chats go to the judge.
3. Every score shows on the dashboard, by topic and model version.
4. A score that falls below the agreed line raises an alert.
5. A person reads the flagged chats and adds each new failure to the golden set.

Cost and speed sit on the same traces. Cloudflare's AI Gateway, a service that sits between your app and the model and keeps logs, can hold the prompt, the response, token usage, cost and duration for each call. In made-up data, the dispute topic costs about three times as much per chat as fees, so the team trims its tool calls.

> "The most effective teams combine these methods: automated evals for fast iteration, production monitoring for ground truth, and periodic human review for calibration." (Anthropic)
>
> "AI agent evaluation is still a nascent, fast-evolving field." (Anthropic)

1. **Take the sample:** Two percent of chats at random, plus every thumbs-down. At about 40,000 chats a month, that is roughly 27 random chats a day, plus the thumbs-downs.
2. **Score each answer:** The judge checks each answer against the rubric: the right fee, the right policy, no invented numbers. People check a sample of the judge's scores every week and track how often they agree.
3. **Compare with the baseline:** The dashboard compares each topic with its score at release and with the agreed line. A drop past the limit raises an alert, so a slow slide still gets caught.
4. **Feed the failures back:** The owner reads the flagged chats the same day and adds each new failure to the golden set, so the next release is tested on it.

Logs hold customer details, so the platform masks personal data before storage and limits who can open a trace.

### How would you catch a quiet drop a week after a model update?

Say the dashboard overall reads about 92 percent, a small dip from the 95 it used to show, but the sample shows dispute answers falling to about 81 percent (made-up numbers). One customer writes, "Why was my card charged twice for the same fee?" and the reply blames the wrong charge.

1. **Slice first:** Filter the drop by topic and by model version, so you know where it sits.
2. **Read the transcripts:** Read ten flagged chats yourself before you trust the judge.
3. **Check the judge:** Score 50 answers by hand. If the judge now disagrees with people, the fault may sit in the judge instead.
4. **Check the inputs:** A new product or a policy change can shift what users ask, so look for drift in the questions.
5. **Fix and remember:** Fix the prompt or roll back, then add the failing cases to the golden set so the gate catches it next time.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] Two jobs: offline tests before release, online sampling after.
- [ ] A golden set of real cases, refreshed from production failures.
- [ ] A judge model, with people checking its scores.
- [ ] Gates per topic or slice, not just the average.
- [ ] Traces, cost and latency kept on the same records.
- [ ] Honest limits: evals catch regressions, and they can't prove safety.

**Common traps**

- Trap: "Our average score is 95 percent, so we're good." Better: The average can hide a topic that fell hard. Check each slice before you trust it.
- Trap: "The judge scores everything, so humans aren't needed." Better: A judge can be wrong or drift. Keep a person reading a sample each week.
- Trap: "We'll add monitoring after launch." Better: Plan tracing and sampling before launch. Without traces, you can't see what went wrong.

## Can you spot the gap?

**Spot the gap:** A team's gate says: block a release only if the overall score falls more than 5 points. What is the problem with this setup?

A. A judge model uses a rubric, so its scores can't be wrong.
B. Five points is always too strict for any app.
C. The gate checks the total, so a broken topic can ship while the total barely moves.
D. A golden set should never change after launch.

**Answer:** C. A total can hide a topic that falls hard. Gate each slice, such as disputes.

**Quick check:** Which setup gives the earliest warning of a quality drop from real users?

A. A bigger golden set, refreshed once a year
B. Sampling live traces, scored by a judge and checked by a person
C. A dashboard of token counts only
D. A nightly score on 1,000 past cases, with no live sampling

**Answer:** B. Only live sampling sees the questions users really ask this week. Token counts show cost, not quality, and a yearly set misses new problems.

## Can you answer these from memory?

**Flash cards**

- **What are the two jobs of an eval platform?** Test each change before release, and sample live traffic after release.
- **What is a golden set?** A fixed list of real past cases, each with a good answer or a rubric.
- **What is a trace?** The full record of one conversation: prompts, replies, tool calls, timings.
- **Why gate by topic, not only the average?** An average can hide a topic that falls hard.
- **What does a judge model do?** Scores answers against a rubric. People check its scores too.
- **Does an eval platform prove the app is safe?** No. It catches regressions early, and it can't prove safety.

## Likely follow-up questions

- Q247 Offline vs online evaluation? https://designervenkat.online/interview/ai/offline-vs-online-evaluation
- Q261 How do you detect drift? https://designervenkat.online/interview/ai/how-do-you-detect-drift
- Q265 How do you sample production traffic for evals? https://designervenkat.online/interview/ai/how-do-you-sample-production-traffic-for-evals
- Q275 Eval scores dropped but the model is unchanged. How do you debug? https://designervenkat.online/interview/ai/eval-scores-dropped-model-unchanged
- Q280 Design an eval harness for a model release. https://designervenkat.online/interview/ai/design-an-eval-harness-for-a-model-release

## Learn it in depth

- [LLM Evaluations](https://designervenkat.online/learn/ai-engineering/llm-evaluations)
- [Production monitoring](https://designervenkat.online/learn/ai-engineering/production-monitoring)
- [Seeing inside your AI app](https://designervenkat.online/learn/ai-engineering/llm-observability)
