Chart of eval scores across versions with a pass threshold line
Back to Work & InsightsComprehensive Guide

Eval-Driven Development & Golden Datasets

Trying a few prompts in the playground tells you the system works on those few prompts. Evals tell you whether it still works after every change.

TL;DR

  • Every prompt edit, model upgrade, or new tool can silently break cases that worked last week. Manual playground testing can't catch that.
  • Eval-driven development treats evals like tests: write the cases before changing the prompt, score automatically, block the change if the score drops.
  • The golden dataset is real inputs with expected outputs, labeled by someone who knows the domain. 30–50 well-chosen cases beat 1,000 synthetic ones.
  • Score with code wherever possible. Use an LLM judge only for what code can't check, and measure how often it agrees with humans.
Testing & validation · Typical API wrapper

Try a handful of prompts by hand in the playground

Testing & validation · FDE architecture

Eval-driven development (EDD) with automated infrastructure and a golden dataset

01 · Definition

The four parts of an eval setup

Golden dataset
input → expected output, labeled by an expert

Real cases from the business, including the ugly ones. The single most valuable artifact of an AI project.

Scorers
exact match, schema valid, LLM judge

Deterministic checks first; model-graded checks for tone or completeness; humans to calibrate both.

Regression gate
CI fails if score < baseline

No prompt or model change ships without running the suite and comparing against the current version.

Production loop
failed case → new golden record

Every real failure becomes a test case, so the same bug can't return quietly.

{
  "id": "invoice-0137",
  "input": "attachments/invoice-0137.pdf",
  "expected": { "vendor": "Acme Supply", "total": 1840.50, "currency": "USD", "due": "2026-03-01" },
  "checks": [
    { "type": "schema", "schema": "Invoice" },
    { "type": "exact", "fields": ["vendor", "currency", "due"] },
    { "type": "numeric", "field": "total", "tolerance": 0.01 }
  ],
  "tags": ["handwritten", "multi-page"]
}
One golden record and its checks. Most checks are plain code.
02 · Worked example

Upgrading the model, two ways

A new, cheaper model is released. The team wants to switch their invoice extractor to it.

“Is the new model good enough to switch?”
Playground testing
A feeling, not an answer
  1. 01Paste 5 invoices you remember into the playground
  2. 02Outputs look right
  3. 03Switch the model in production
  4. 04Two weeks later: multi-page invoices lose their totals
Eval-driven
A number per case type
  1. 01Run 120 golden invoices on both models
  2. 02Overall: 96% vs 95%, but multi-page drops to 71%
  3. 03Route multi-page to the old model, rest to the new one
  4. 04Ship with the score report attached to the change

The numbers here are illustrative. The point is the tags: an average hides the slice that breaks.

03 · Failure modes

Where eval setups go wrong

Vibe checks

“It looks better” after reading five outputs. Nobody remembers what the previous version said.

Same cases, same scorers, side-by-side scores for both versions.

Synthetic-only data

LLM-generated test cases are clean and predictable; real inputs are not.

Start from real production inputs. Use synthetic data only to fill known gaps.

Unchecked LLM judge

The judge model is trusted blindly, and it prefers long, confident answers.

Measure judge agreement against human labels on a sample before relying on it.

Overfitting the set

Prompts get tuned until the eval passes, then fail on new inputs.

Keep a held-out slice nobody tunes against; refresh it from production.

Averages only

One overall score hides a category that dropped from 95% to 60%.

Tag cases by type and report scores per tag.

04 · Self-check

How eval-ready is your AI system?

Your score: 0 / 6

You're vibe-checking

Collect 30 real inputs this week, label the expected outputs with whoever owns the process, and write one script that scores them. That's day one of EDD.

05 · Trade-off

What it costs

Expert labeling time
The domain expert's hours are the real cost. Budget them; it is the highest-leverage time in the project.
Eval runtime & spend
Every run calls the model on every case. Cache results per version and run the full suite only on meaningful changes.
Maintenance
When the business rule changes, expected outputs change too. Version the dataset like code.
Slower first week
You ship a few days later and spend far fewer weeks chasing regressions afterwards.
06 · Playbook

How to set it up

  1. 01Pull 30–50 real inputs from production or the client's backlog, including the hard ones.
  2. 02Have the domain expert label the expected output for each; write down why for edge cases.
  3. 03Write deterministic checks first; add an LLM judge only for what code can't verify.
  4. 04Record the current system's score as the baseline.
  5. 05Run the suite in CI on every prompt, model, or tool change; block regressions.
  6. 06Sample production weekly; every failure becomes a new golden record.

Tooling options

SMB · fastest start
pytest / Vitest + JSON files

Your existing test runner and a folder of golden records. Enough to start a regression gate.

Open source · CI
promptfoo

Config-driven evals and model comparisons that run from the command line or CI.

Team workflows
Braintrust / LangSmith

Hosted datasets, experiment comparison, and human annotation queues.

Framework
DeepEval / OpenAI Evals

Libraries with ready-made metrics and judge templates to build on.

More guides

Want this built into your workflow?

I help small and mid-size teams decide what to build, then build it, from the first eval set to production guardrails.

Talk through your use case