All courses LLM apps

AI Evals: Test and Improve Your LLM App

Intermediate

Read real outputs, build a test set, write graders and block a version that got worse.

Intermediate 8 lessons 24 lab exercises Certificate Updated

You build

An evaluation suite for a small support assistant: a test set with expected behaviour, graders in code, a model grader checked against labels, a comparison of two prompt versions, and a gate that fails when a score drops.

You need

  • Python basics: functions, lists, dictionaries, reading and writing files, and running a script in a terminal
  • Calling a language model from Python and getting structured output: a system prompt, messages, and a reply parsed into fields your code can read (the course Build Your First LLM App in Python is one way to get this)
  • Having seen an ordinary automated test: a function that runs some code and asserts on the result

To build it on your own machine

This is optional and comes with a plan. The course pack brings the starting files, a ready container and a check for every lesson. You need only Docker and git, plus your own AI coding agent if you want a tutor.

What you learn

Know whether a prompt change made your app better or worse, before it ships

A small support assistant for a made-up bike shop is handed to you finished. You build what tells you whether its answers are good: you read real answers and name what goes wrong, turn that into a test set, write graders in code, add a model as a grader and check it against human labels, compare two prompt versions, and end with a gate that blocks a change that makes the answers worse. Plain Python, no eval library. Every check runs on recorded answers, so you need no key.

  • Look First. Why an exact assert cannot test a model's answer, what an eval is instead, and why reading real outputs and naming the failures you find comes before any metric.
  • A Test Set and Graders. Cases that state the expected behaviour rather than one expected text, graders in code that each check one thing, and pass rates per grader instead of one comforting number.
  • A Model as a Grader. What only a model can judge, a judge prompt with one criterion and a pass or fail verdict, and how to measure the judge against human labels before trusting its score.
  • Decisions and Gates. Comparing two versions case by case, telling a real change from the variation between two runs of the same app, and a gate that fails when a score drops below the baseline of the accepted version.

Lessons

Where it fits

Course 7 of 8 on the AI Engineer path.

How our courses are made Report a mistake