LearnSystem design

Evaluation and monitoring platform for LLM features

Design a platform that lets product teams evaluate LLM features before release (datasets, graders, LLM judges, comparisons) and monitor them in production.

Applied LLM8 parts

Contents

What to cover

Sketch your own design first. A complete answer has these parts; the notes say what each should settle.

  1. Requirementsnumber of teams/features; data sensitivity; human labelling capacity; release cadence; online traffic volume
  2. Estimates
  3. API
  4. Data model
  5. Architecturedataset registry (versioned, slices, provenance, PII controls); grader library (code checks, model-graded with versioned prompts, human review queues); judge calibration against human labels; experiment runner (concurrency, caching, seeds, repeated samples); comparison reports with confidence intervals and slice breakdowns; CI gates; production tracing (prompts, retrieval, tools, cost); sampled online grading and alerting; feedback-to-dataset loop
  6. Deep divesthe judge model is upgraded — what happens to historical comparisons?; How do you detect eval-set contamination or staleness?
  7. Trade-offsjudge cost vs coverage; reproducibility (pinned models) vs freshness; central platform vs team autonomy; storing raw traces vs privacy
  8. Evaluationjudges validated and versioned; statistics, not point estimates; slices; tight loop from production failures into datasets; privacy controls

Reference design

One way to answer it, part by part. Open a part once you have your own version of it.

Requirements

Functional: versioned datasets; a library of graders (code checks, LLM judges, human review); experiment runs comparing variants (prompt, model, retrieval config); reports with uncertainty; CI gates; production tracing; sampled online grading with alerts; a path from production failures into datasets.

Assumptions to confirm

  • Teams and features: ~40 teams, ~150 LLM features (chat, RAG, agents, extraction), each with its own quality definition.
  • Data sensitivity: production traces contain customer PII and confidential documents; some features are regulated. Redaction, access control and retention are requirements, not options.
  • Human labelling capacity: ~10 annotators plus part-time SMEs ≈ 2k labels/day in total — far below traffic, so humans calibrate judges rather than grade at scale.
  • Release cadence: prompt and retrieval changes daily, model upgrades monthly, provider deprecations a few times a year.
  • Online traffic: ~50M LLM calls/day across features.
  • Users: engineers and PMs, not ML specialists; the default path must give statistically sound answers without expertise.
  • Non-goals: training infrastructure; the platform does not own each team’s quality definition.

Estimates

  • Trace volume: 50M calls/day × ~10 KB (prompt, output, retrieval ids, tool calls, metadata) ≈ 500 GB/day raw, ~100 GB/day compressed; 30 days hot ≈ 3 TB; afterwards only aggregates and curated examples.
  • Online grading: code checks (format, schema, PII, refusal markers) on 100% — cheap. Small-model judge on 1% = 500k grades/day × ~3k tokens ≈ 1.5B tokens/day ≈ $225/day at an assumed $0.15/M. Strong judge on 0.1% = 50k grades ≈ 150M tokens × $3/M ≈ $450/day. Humans: ~2k/day, stratified.
  • Offline runs: a typical run is 1,000 items × 5 samples × 2 variants = 10k generations + 10k judge calls ≈ 60M tokens ≈ $50–200 depending on models. 150 features × ~1 full run/week × ~$100 ≈ $15k/week; caching responses on (model, prompt, params, seed) means the unchanged baseline is never paid for twice, roughly halving that to ~$30k/month. Small smoke runs on every PR cost cents.
  • Statistical resolution: for a pass rate near 80% with n = 1,000, SE = √(0.8 × 0.2 / 1,000) ≈ 1.3 points → 95% CI ±2.5 points. Comparing two variants on the same items: unpaired, the difference has SE ≈ √2 × 1.3 ≈ 1.8 points; pairing (assuming item-level correlation ≈ 0.5) halves that variance, giving SE ≈ 1.3 points. A difference of ~2.5 points then reaches significance, and the minimum detectable effect at 80% power is ≈ 2.8 × 1.3 ≈ 3.5 points. Reliably catching 2-point regressions needs ~3,000 items (2.8 × √(0.16 / 3,000) ≈ 2 points) or more samples per item.

API

SDK (OpenTelemetry GenAI conventions):
  with tracer.span("rag.answer", feature="kb-assistant") as s: ...   # llm, retrieval, tool spans

POST /v1/datasets             {name, schema, items[] | from_traces: {query, sample_n}, pii_policy, slices}
                              → {dataset_id, version}
POST /v1/graders              {type: "code"|"llm_judge"|"human", spec: {template, rubric, judge_model, output_schema}}
                              → {grader_id, version}
POST /v1/graders/{id}/calibrate {gold_set_id}  → {agreement, kappa, bias_by_slice}
POST /v1/experiments          {feature, dataset_version, variants: [{prompt_version, model, params}],
                               graders: [grader@version], samples_per_item: 5, seed}  → {run_id}
GET  /v1/experiments/{run_id}/report → metrics with CIs, paired deltas, per-slice tables, worst items
POST /v1/gates                {feature, metric, comparator: "non_inferior", margin: 0.02, baseline: "prod"}
POST /v1/monitors             {feature, sample_rate, graders, alert: {metric, threshold, window}}
POST /v1/traces/{id}/promote  {dataset_id, label?, note}

Data model

  • Feature: owner team, data classification, linked prompts and models, gates.
  • Dataset / DatasetVersion (immutable): items, slice tags, provenance (production trace, synthetic, SME-written, red-team), PII class, split (dev | held-out), created_from query.
  • Item: input, optional reference, metadata, slice tags, content hash.
  • Grader / GraderVersion (immutable): type, template hash, rubric, judge model snapshot, output schema, calibration record.
  • Calibration: grader version × gold set → agreement, Cohen’s kappa, bias per slice, date.
  • Run: variant config hash, dataset version, grader versions, seeds, samples per item, cost.
  • Output and Score: (run, item, sample) → output; (output, grader version) → value, rationale.
  • Trace / Span: feature, request id, prompts, retrieval ids, tool calls, tokens, cost, latency — payloads redacted at ingest, stored separately with shorter retention than metadata.
  • HumanLabel: item or trace, annotator, label, time spent, guideline version.
  • Alert: monitor, window, metric value, linked traces.

ClickHouse for spans and scores, object storage for payloads, Postgres for registries.

Architecture

Flow · 4 stepsOffline evaluation flow

Offline evaluation flowA flow diagram showing the offline evaluation path: a versioned dataset registry and a grader library feed an experiment runner, which writes scores to a score store; reports with paired bootstrap CIs and slice tables feed a CI gate that releases or blocks. Human review queues and a calibration service keep judges validated against human gold sets.Datasetregistryversioned,slices,provenance,PII policyHumanreviewqueueslabelling tool,SMEs,guidelinesGraderlibrarycode checks,LLM judges,human reviewExperiment runnerconcurrency, cache,seeds, k samplesCalibration servicejudges vs human goldsetsScore storeoutputs and scores per graderversionReportspaired bootstrap CIs, slice tablesCI gateGitHub check, non-inferioritymarginReleasegates refuse uncalibrated graders1234DataComputeOutput
  1. Prepare inputs A versioned dataset and versioned graders are selected for the feature.
  2. Calibrate judges Human review queues supply gold labels; the calibration service checks agreement, kappa and bias by slice against human gold sets.
  3. Run experiments The runner executes variants with seeds, samples per item and response caching, then writes outputs and scores.
  4. Report and gate Reports show paired deltas with bootstrap CIs and per-slice tables; the CI gate applies the non-inferiority margin before release.

Offline evaluation runs versioned datasets and graders through the experiment runner, stores scores, and gates releases on reports with confidence intervals.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1Prepare inputsA versioned dataset and versioned graders are selected for the feature.
2Calibrate judgesHuman review queues supply gold labels; the calibration service checks agreement, kappa and bias by slice against human gold sets.
3Run experimentsThe runner executes variants with seeds, samples per item and response caching, then writes outputs and scores.
4Report and gateReports show paired deltas with bootstrap CIs and per-slice tables; the CI gate applies the non-inferiority margin before release.

Source: This page's text

Boxes
BoxGroupDetail
Dataset registryDataversioned, slices, provenance, PII policy
Grader libraryDatacode checks, LLM judges, human review
Human review queuesDatalabelling tool, SMEs, guidelines
Calibration serviceComputejudges vs human gold sets
Experiment runnerComputeconcurrency, cache, seeds, k samples
Score storeComputeoutputs and scores per grader version
ReportsOutputpaired bootstrap CIs, slice tables
CI gateOutputGitHub check, non-inferiority margin
ReleaseOutputgates refuse uncalibrated graders

Source: This page's text

Flow · 4 stepsHow production traces become alerts

How production traces become alertsProduct services send traces through the SDK/OTel to a trace collector, which passes them through PII redaction and tokenisation before they reach the trace store. A sampler draws from the store into online graders, where code checks run on 100%, a small judge on 1% and a strong judge on 0.1%. Scores feed metrics and alerting per feature and per slice, which reach on-call and team channels.Product servicesSDK/OTelTrace collectorPII redaction/tokenisationpayloads redacted at ingestTrace storeClickHouse + object storeSamplerOnline graderscode 100% · small judge 1% · strongjudge 0.1%Metrics + alertingper feature, per sliceon-call / team channelsSDK/OTelredactedsampledscoresalerts1234IngestStoreGradeAlert
  1. Ingest and redact Product services send traces through the SDK/OTel; payloads are redacted and tokenised at ingest.
  2. Store and sample Redacted traces land in the trace store, then the sampler selects what to grade.
  3. Grade online Code checks run on 100%, a small judge on 1% and a strong judge on 0.1%.
  4. Alert Scores become metrics and alerts per feature and per slice, sent to on-call and team channels.

Production traces are redacted at ingest, stored, sampled and graded, then turned into per-feature alerts.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1Ingest and redactProduct services send traces through the SDK/OTel; payloads are redacted and tokenised at ingest.
2Store and sampleRedacted traces land in the trace store, then the sampler selects what to grade.
3Grade onlineCode checks run on 100%, a small judge on 1% and a strong judge on 0.1%.
4AlertScores become metrics and alerts per feature and per slice, sent to on-call and team channels.

Source: This page's text

Boxes
BoxGroupDetail
Product servicesIngestSDK/OTel
Trace collectorIngest
PII redaction/tokenisationIngestpayloads redacted at ingest
Trace storeStoreClickHouse + object store
SamplerStore
Online gradersGradecode 100% · small judge 1% · strong judge 0.1%
Metrics + alertingAlertper feature, per slice
on-call / team channelsAlert

Source: This page's text

Product services ──SDK/OTel──► Trace collector ─► PII redaction/tokenisation
    ─► Trace store (ClickHouse + object store, per-feature access control)
    ─► Sampler ─► Online graders: code checks 100%, small judge 1%, strong judge 0.1%
    ─► Metrics + alerting (per feature, per slice) ─► on-call / team channels

Curation UI: filter traces (thumbs-down, judge failures, incidents) ─► promote to dataset
Dataset registry (versioned, slices, provenance, PII policy)
Grader library (versioned) ◄─► Calibration service (judges vs human gold sets)
Human review queues (labelling tool, SMEs, guidelines per feature)

Experiment runner: job queue, per-provider concurrency limits, response cache,
   retries, seeds, k samples per item ─► Score store
   ─► Reports: paired bootstrap CIs, slice tables, worst-item browser
   ─► CI gate (GitHub check) ─► release

Same graders run offline and online, so a production regression and a pre-release eval speak the same language.

Deep dives

Flow · 5 stepsHow a judge model upgrade is handled

How a judge model upgrade is handledThe flow moves from a judge upgrade to a new immutable grader version, then to calibration against human gold sets and re-scoring of a fixed bridge set of stored historical outputs. Reports show both versions during the transition window, and gate-dependent teams are notified and re-baselined.Judge upgradeprovider model changeNew grader versionpinned judge snapshotHuman gold setsagreement, kappa, biasby sliceBridge setstored historical outputsReportsboth versions, no mixed trend lineGate-dependent teamsre-baseline gatescalibratere-scoreboth versionsnotify12345UpgradeCalibrationTransition
  1. New grader version A new judge becomes a new grader version with a pinned snapshot.
  2. Calibrate Calibrate the new version against human gold sets for agreement, kappa and bias by slice.
  3. Bridge re-score Re-score a fixed bridge set of stored historical outputs with both versions to quantify the shift.
  4. Show both Show both versions in reports during the transition window; never mix versions on one trend line.
  5. Re-baseline Notify teams whose gates depend on the judge and re-baseline those gates.

A judge upgrade becomes a new grader version, is calibrated and bridge-scored, and is shown alongside the old version before gates are re-baselined.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1New grader versionA new judge becomes a new grader version with a pinned snapshot.
2CalibrateCalibrate the new version against human gold sets for agreement, kappa and bias by slice.
3Bridge re-scoreRe-score a fixed bridge set of stored historical outputs with both versions to quantify the shift.
4Show bothShow both versions in reports during the transition window; never mix versions on one trend line.
5Re-baselineNotify teams whose gates depend on the judge and re-baseline those gates.

Source: This page's text

Boxes
BoxGroupDetail
Judge upgradeUpgradeprovider model change
New grader versionUpgradepinned judge snapshot
Human gold setsCalibrationagreement, kappa, bias by slice
Bridge setCalibrationstored historical outputs
ReportsTransitionboth versions, no mixed trend line
Gate-dependent teamsTransitionre-baseline gates

Source: This page's text

The judge model is upgraded — what happens to historical comparisons? Graders are immutable versions with a pinned judge snapshot, and scores are stored per grader version, so old numbers never silently change. A new judge becomes a new grader version: calibrate it against the human gold sets (agreement, kappa, bias by slice); re-score a fixed bridge set of stored historical outputs (not regenerated) with both versions to quantify the shift; show both in reports during a transition window; never mix versions on one trend line; notify teams whose gates depend on it and re-baseline those gates.

Detecting contamination or staleness. Contamination: near-duplicate search (n-gram and embedding) between eval items and fine-tuning data, few-shot examples and retrieval corpora; canary strings in held-out sets; provenance tracking; a held-out split that teams cannot view or iterate prompts on, scored only at release. Staleness: compare eval inputs with recent production traffic (embedding-cluster coverage, topic and language mix) and alert when production clusters are under-represented; watch for divergence between offline scores and online judge scores; refresh sets quarterly from recent traces.

Trade-offs

  • Judge cost vs coverage: a cascade of code checks on everything, a cheap judge on a sample and a strong judge on a smaller sample buys coverage cheaply; humans calibrate rather than grade.
  • Reproducibility (pinned models) vs freshness: pinned judge snapshots and cached outputs make results reproducible, but providers deprecate models; plan judge migrations as explicit version changes with bridge sets.
  • Central platform vs team autonomy: the platform owns primitives (datasets, runners, statistics, gates, tracing) and safe defaults; teams own their rubrics, datasets and thresholds. A central team writing every grader would become a bottleneck.
  • Storing raw traces vs privacy: raw payloads help debugging but are a liability. Redact at ingest, keep payloads 30 days, aggregates for a year, restrict access per feature, require approval for retained raw examples, and honour deletion requests across traces and datasets.

Evaluation

  • Judges validated and versioned: every judge has a calibration record (target kappa ≥ 0.6–0.7 against humans) and a version; gates refuse uncalibrated graders.
  • Statistics, not point estimates: reports show paired deltas with bootstrap CIs, several samples per item to capture model randomness, and an explicit non-inferiority margin for gates.
  • Slices: every report breaks down by language, customer segment, input length and feature-specific tags; a regression in any critical slice blocks a release even if the average improves.
  • Tight loop from production to datasets: median time from a production failure to a regression item < 2 days; count of items promoted per feature per month.
  • Privacy controls: redaction recall audited on samples; access logs; retention enforced automatically.
  • Platform health: adoption (features with gates and monitors), incidents caught before vs after release, alert precision, run turnaround time, spend per feature.

What a strong design shows

  • Versions judges and calibrates them against humans; never mixes grader versions on one chart.
  • Reports uncertainty — confidence intervals, paired comparisons, repeated samples — and states the minimum detectable effect.
  • Makes slices first-class and blocks releases on slice regressions, not just averages.
  • Turns production failures into dataset items quickly and guards held-out sets against contamination and staleness.
  • Treats trace privacy (redaction, retention, access) as a core design constraint.

Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.