Interactive guide · No build step · Cloudflare-ready

Stop guessing.
Start measuring.

An eval is a structured, repeatable experiment: golden dataset + graders + runner + report/gate. This lab teaches you what evals are, what’s possible, and how to improve prompts with evidence — by running the loop yourself, right here in your browser.

▶ Try the Prompt Lab See the eval loop ↓
0grading layers
0runnable examples
0playbook rules
0sto first result
01 · The mental model

One loop. Everything else is infrastructure.

Click each stage. The loop is the whole framework — tracing UIs, dashboards, and red-teaming all sit around it.

02 · Learn

What is an eval, really?

A structured, repeatable experiment that measures behaviour despite model nondeterminism. It answers two questions: can it ever do it? (capability) and does it reliably do it? (consistency).

Deterministic code — free, instant, never drifts

JSON validity, regex, tool-call presence, final state/DB end-state. In evaled: contains, is_json, state_check, tool_calls_include. Rule: code first, LLM only for what code can’t check.

from evaled import contains, is_json
graders = [contains("refund"), is_json(["status"])]

LLM-as-judge — for tone, groundedness, nuance

One dimension per call. Anchored levels (1/3/5 behaviours), reasoning before the score, strict JSON, UNKNOWN escape hatch, temperature=0, judge from a different model family than your app. In evaled: get_judge("openai" | "anthropic" | "ollama" | "mock").

from evaled import EvalRunner, SUPPORT_RUBRIC
report = EvalRunner(SUPPORT_RUBRIC, judge_name="openai").run(cases, my_app)

Human — calibrate the judge, catch the edges

30–50 labelled cases per rubric. Compare judge vs human (Cohen’s κ or ≥80% agreement). Re-validate on every judge/rubric change. Humans are the ground truth; judges are instruments with a noise floor.

# EvalCase.human_verdict = "PASS" | "FAIL"  →  compare with judge verdict
# docs/08-calibration-and-bias.md has the full loop

Production signals — drift, real-world truth

Trace every call (input, context, output, model, tokens, cost, latency, tool calls). Sample 1–5% of traffic, auto-score, alert on drift (>5% drop). Every failure becomes a new golden case. In evaled: JsonlRecorder, Langfuse / Phoenix / OTel adapters.

from evaled.telemetry import JsonlRecorder
runner = EvalRunner(RUBRIC, recorder=JsonlRecorder("traces.jsonl"))
03 · Rubrics

A rubric is not “rate quality 1–10”.

It’s named, independent dimensions with anchored levels, a verdict format, and a gate/preference decision. Pick a use case and play with the scale.

Try an anchored scale: Tone

Drag the slider. Anchors describe behaviour, not numbers — that’s what makes judges agree.

1Rude, blaming, or robotic (“you made a mistake”)
3Neutral and polite, no warmth
5Warm, empathetic, professional; acknowledges frustration

3 = neutral and polite. A preference — trend it, don’t gate on it.

Gates (groundedness, safety) block release. Preferences (tone, brevity) just trend. Never average them equally.

04 · Prompt Lab — the core skill

Improve a prompt with evidence, not vibes.

Edit the system prompt, run the golden set, read the failures, change one thing, re-run. This simulates the exact evaled loop (MockJudge heuristics mirror evaled/judge.py).

✍️ System prompt

PASS RATE
—
GATE (groundedness)
—

Tip: v1 hallucinates “90 days” and complies with injections. Add grounding + refusal language and watch the gates flip. Then read why each case failed below.

📋 Golden set (6 cases)

Production · failure-replay · edge · adversarial. Two reviewers must agree on pass/fail per case.

05 · Golden datasets

Sets that don’t rot are failure-fed.

60% production sample · 15% adversarial · 15% edge · 10% failure replays. Version it, diff it in PRs, refresh monthly. Filter and add your own cases, then export JSONL for the Python core.

Add your own case

06 · Metrics

Capability vs consistency.

A 90% agent still fails ~10 of 100 users. pass@k asks “can it ever do it?”; pass^k asks “does it reliably do it?” Production runs on pass^k.

pass@k = 1 − (1−p)k  ·  pass^k = pk. Drag and watch capability stay high while consistency collapses.

pass@k (capability)
—
pass^k (consistency)
—

07 · What’s possible

Pick the tool per job. Most teams run 2–3.

Default OSS stack ($0 + judge API costs): DeepEval or Promptfoo in CI + RAGAS if RAG + Langfuse/Phoenix for tracing + Promptfoo red-team.

08 · Adoption

The 7-week path (solo dev / small team).

Don’t boil the ocean. One layer per week — each pays for itself.

09 · Use it in your project

Copy-paste starters.

Vendor evaled/ (stdlib-only) or run the examples. Pick your stack.

from evaled import EvalCase, EvalRunner, SUPPORT_RUBRIC, contains

cases = [EvalCase(id="1", input="refund?", context="Policy: 30 days.", bucket="production")]
runner = EvalRunner(SUPPORT_RUBRIC, judge_name="openai",
                    deterministic_graders=[contains("refund")])
report = runner.run(cases, my_app)   # my_app(input, context) -> str
print(report.summary())             # pass rate, scores, reasons
# LangSmith auto-traces LangGraph; score the outcome, not the path.
# 1) Verify final state (DB/tickets), not just the final message.
# 2) Check tool sets (order-flexible), not exact sequences.
# 3) One LLM rubric per quality dimension.
from evaled import EvalRunner, AGENT_RUBRIC
report = EvalRunner(AGENT_RUBRIC, judge_name="anthropic").run(tasks, agent_fn)
from evaled import EvalRunner, RAG_RUBRIC
# Separate retrieval (precision/recall) from generation (faithfulness).
# Golden case needs: (question, expected_doc_ids, expected_chunk_text)
report = EvalRunner(RAG_RUBRIC, judge_name="openai").run(cases, rag_fn)
# Or RAGAS for reference-free faithfulness / context precision.
from evaled import EvalRunner, AGENT_RUBRIC
from evaled.telemetry import JsonlRecorder
# Run each task 3-5x. Report pass@k (capability) AND pass^k (consistency).
runner = EvalRunner(AGENT_RUBRIC, judge_name="mock",
                    recorder=JsonlRecorder("traces.jsonl"))
report = runner.run(tasks, agent_fn)  # agent returns {tool_calls, final_state}

Try it now: python3 examples/00-no-key-demo/run.py (offline, ~1s) · python3 examples/07-agent-trajectory/run.py · Full recipes: docs/06-adding-to-existing-projects.md

10 · Check understanding

Five questions. No vibes.

Score 0 / 5. Aim for 5/5 before you gate CI on a judge.

11 · Take it to the next level

What “great” looks like after week 7.

From the repo audit (docs/09-improvement-roadmap.md): fix the Tier-0 bugs first, then climb.

🔧 Fix the core

Inverted judge prompt, scale-gate semantics, runner error isolation, judge JSON parsing, real pass@k/pass^k. Half a day each — see docs/09 Tier 0.

📐 Calibrate properly

Judge-vs-human agreement + Cohen’s κ on 30–50 labels. Re-validate on every change. No calibration code exists yet — building it is the highest-value feature gap.

🛡️ Harden & scale

Timeouts/retries, cost tracking, PII redaction, red-teaming (Promptfoo), multi-model bake-offs, online evals on 1–5% of prod traffic, drift alerts.

⚡ evaled · Rapid training
A practical 10-minute field guide

Better evals start with a clear definition of good.

Turn a real task into a small, repeatable test. Define success, gather cases, grade the results, then improve one thing at a time. Use this page as your first-run checklist.

01 · Define the outcome

Start with one decision, not a vague quality score.

Pick a task and a consequence: “Can our support assistant answer refund questions using only the supplied policy?” Define what must never fail and what is merely preferred.

Must-pass: no unsupported policy claims or private customer data. Preference: warm, concise tone. A friendly hallucination still fails.

02 · Build a golden set

Collect cases that can prove you wrong.

Start with 20–50 representative, privacy-safe cases when available. Include typical requests, edge cases, adversarial inputs and replays of real failures. Record the input, context, expected behavior and a stable ID; have humans agree on the labels.

Case: “What is the refund window?”
Context: “Refunds are allowed within 30 days.”
Expected: answer 30 days, without inventing a different window.

Keep dataset versions and a separate holdout set so you don’t tune only to the examples you’ve seen.

03 · Write a rubric

Make each criterion observable and independent.

For every dimension, state the question, what passes, what fails, and when evidence is insufficient. Reserve gates for non-negotiable outcomes; use anchored scales for preferences.

Gate · Groundedness: Are the answer’s factual claims supported by the supplied context?
PASS: “The window is 30 days.” FAIL: “The window is 90 days.” UNKNOWN: necessary context is missing; route to review, not a pass.

Preference · Tone: 1 = rude or blaming; 3 = neutral and polite; 5 = warm and professional. Score this separately from the gate.

04 · Run & calibrate

Use the cheapest reliable grader first.

  1. Run the same cases through your system and save the outputs. Use deterministic checks for things like valid JSON or required fields.
  2. For nuanced criteria, ask a judge to grade one dimension at a time against the rubric, with reasoning and an UNKNOWN option.
  3. Compare judge verdicts with human labels on a sample; inspect disagreements and revise before relying on the judge. Recalibrate when the rubric or judge changes.

A gate failure must not be averaged away by a high tone score. Track UNKNOWNs and errors separately; review them rather than treating them as passes.

05 · Improve & repeat

Make one change, then compare like with like.

Inspect failures by case and category. Change one prompt instruction, model or retrieval setting; rerun the same versioned set and compare gates, preferences, UNKNOWNs and regressions. Check the holdout before shipping. Add new production failures back as cases.

Example: Add “Use only the supplied policy; say when it’s missing.” Re-run the refund cases: did unsupported claims drop without causing more unanswered questions?

Your first run

Ready-to-use checklist

Checklist is temporary and stays in this browser tab.

Try it with evaled

From practice to a real eval

Explore the simulated Prompt Lab in this page, or run the repository’s offline example from a checkout:

python3 examples/00-no-key-demo/run.py

The demo’s mock judge is a heuristic for testing the pipeline, not a calibrated quality or safety judge. Before real-judge or production use, review the known rubric, gate and runner limitations in the improvement roadmap.