Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder
Module 9Intermediate

Evals & Quality for AI Features

Knowing — not hoping — that your feature works

A practical quality system for AI features: define quality, read outputs with error analysis, build golden datasets from real usage, write code-based and model-graded checks, evaluate extraction and RAG, and run evals in development, CI, and production.

Lessons
9
Reading time
97 min
Level
Intermediate
Access
Full course

Lessons in this module

  1. 9.1

    What Quality Means for an AI Feature

    Turn "make it good" into measurable criteria per feature — correctness, completeness, format, tone, safety — and decide which ones block a release.

    10 min
  2. 9.2

    Error Analysis: Read Your Outputs First

    The highest-leverage quality habit: review real outputs, write open notes, group them into failure categories, and fix the biggest bucket first.

    10 min
  3. 9.3

    Building a Golden Dataset from Real Usage

    Assemble a test set that represents reality: sampling production traffic, covering edge cases, labeling efficiently, and keeping it fresh.

    10 min
  4. 9.4

    Code-Based Checks and Assertions

    The cheap, deterministic evals to write first — format, schema, length, required facts, forbidden content — and a tiny eval runner in TypeScript.

    10 min
  5. 9.5

    Model-Graded Evals You Can Trust

    Write grader prompts with clear pass/fail criteria, calibrate them against human labels, and track agreement so your grader stays honest.

    11 min
  6. 9.6

    Evaluating Extraction, Classification, and Generation

    The right metrics for each feature type: field-level accuracy, precision and recall, confusion matrices, and pairwise comparison for open-ended text.

    12 min
  7. 9.7

    Eval-Driven Development and CI

    Make evals part of every change: a fast local loop while iterating, a regression suite in CI, and release gates for prompt and model updates.

    12 min
  8. 9.8

    Monitoring Quality in Production

    Sample live traffic for grading, watch for drift, alert on quality drops, and close the loop from production failures back into your test set.

    11 min
  9. 9.9

    Experiments and A/B Tests for AI Changes

    Test prompt and model changes on real users: choosing metrics that reflect value, sample sizes, guardrail metrics, and reading noisy results honestly.

    11 min

About this module

An eval is a repeatable test for an AI feature: a set of real inputs, a definition of what a good output looks like, and a way to check every output against that definition. Because language models are probabilistic, the same prompt can produce a great answer today and a subtly wrong one tomorrow, and a change that fixes one case can quietly break ten others. Evals are how you know whether your feature works, whether a change made it better, and whether a new model is safe to switch to.

Most teams start with vibes: run a few examples, read the outputs, ship if they look good. That works for a demo and fails in production, where users send messy, multi-part, unexpected inputs and the rare severe failure, like a reply that promises a refund nobody approved, matters more than the average. A practical quality system replaces vibes with named criteria, real test data, and checks you can run on every change.

This module builds that system step by step for a realistic help-desk feature. You will define quality as pass/fail criteria with release gates, read real outputs with error analysis to find the failures that actually happen, and build a golden dataset from production traffic. Then you will write cheap deterministic code checks, add model-graded evals for criteria that depend on meaning, and calibrate those graders against human labels so you can trust their numbers.

The second half covers choosing the right metrics for extraction, classification, and open-ended generation; running evals in a fast local loop and as a regression gate in CI; monitoring quality on live traffic; and running A/B tests for prompt and model changes. Code examples are in TypeScript with the Anthropic SDK, and the methods apply to any model provider.

Questions about Evals & Quality for AI Features

What are LLM evals?

LLM evals are repeatable tests for features built on language models. Each eval runs your feature on a set of test inputs and checks the outputs against defined criteria, using code checks, model graders, or human review. They tell you whether a prompt or model change made quality better or worse before users find out.

How do I start evaluating an AI feature?

Start by reading 50 to 100 real outputs and writing down what goes wrong, then group those notes into failure categories and count them. Turn the most common and most severe categories into criteria, collect test cases from real usage, and write cheap code checks first. Add model-graded evals only for criteria code can't check.

What is LLM-as-judge and can I trust it?

LLM-as-judge means using a model to grade another model's output against written criteria. It is useful for judgments that depend on meaning, such as whether a reply answered every question. You can trust it only after measuring how often it agrees with careful human labels, and you should re-check that agreement whenever the grader or the feature changes.

How big should an eval dataset be?

Fifty to one hundred well-chosen cases drawn from real usage is enough to catch large regressions and guide prompt work. Grow toward a few hundred over time, adding mostly real failures and under-covered edge cases. Watch small slices: with 20 cases in a slice, one case flipping moves its pass rate by 5 points.

Should I use code checks or model-graded evals?

Use code checks wherever they can reliably decide the outcome: format, length, schema, required facts, forbidden phrases, and invented identifiers. They are free, instant, and consistent. Use model graders for criteria that depend on meaning, and keep each grader focused on one pass/fail criterion.