
A quick hello and what this course will help you do.
Welcome to the course. If you've shipped an LLM feature or an agent, and someone asked you "how do you know it works?", and the honest answer was "I tried it and it seemed fine", this course is for you.
Every LLM app starts with a vibe check. You type a few questions, read the answers, and they look good. In this lecture, we'll look at why that feels convincing and why it misses almost everything that matters.
If evals are so useful, how many teams run them? There's a useful survey on exactly this, and the answer explains a lot about why agents in production keep surprising the people who built them.
If you write software tests, you already know half of this course. Evals borrow a lot from testing. But a few differences change how you write them, and how you read the results.
There are a lot of eval and observability tools, and new ones every month. Here's a map of the main kinds, which ones we use, and why the course doesn't depend on any single one.
Let's get the project running. You need Python 3.12 or newer, Git, and either an API key or a local model. Docker is useful from Section two, and I'll show it there.
Before we measure anything, you need to know the app we're measuring. In this section we tour the agent, then make every step it takes visible with tracing.
Tracing has three words you need: trace, span and attribute. Let's define them, then look at a real one from our agent.
OpenTelemetry is the open standard for traces. It also defines semantic conventions: agreed names for spans and attributes. There's a set just for generative AI, and if we follow it, any backend can understand our traces.
Now let's add tracing to the agent's code. It's less work than you might think: one setup function, and three places in the loop.
Langfuse is an open-source platform for LLM traces, evals and datasets. You can self-host it for free, and that's what we'll use for most of the course.
We said the code never names a backend. Let's prove it. Same agent, same code, different place: Arize Phoenix, another open-source tracing and eval tool.
Traces give us tokens, cost and latency for free. But only if they're counted once. And they can also hold your customers' personal data. Two real problems I hit while building this section, and how to catch them.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
Welcome to Section 3. This is where the course really begins. Before we build a single evaluator, we're going to learn the skill that separates teams who ship reliable AI from teams who ship hopeful AI: reading your traces.
We know we want to read traces. But a real app can produce thousands a day, and nobody reads thousands of anything. So the first question is: which ones?
In the last lecture we pulled a sample of fifty real conversations from our support agent. Now we're going to do the single most valuable thing in this whole course: read them. Not skim them, not score them.
At the end of the last lecture we had forty-one notes, one for each failed trace. A pile of notes is hard to act on. You can't put forty-one bullet points on a roadmap.
We now have a failure taxonomy: three categories, each with a count. But you can't fix everything at once, and you definitely shouldn't build an evaluator for everything at once.
Reading fifty traces in a tracing tool works, but it's slow. You click into each trace, expand the tool calls, then switch to a spreadsheet to type your note.
This lecture is for product managers, designers, support leads, or anyone who wants to do error analysis without writing code. Everything we did in this section works in a plain spreadsheet.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
In Section 3 we found out what actually goes wrong with our support agent. Now we start catching those failures automatically. And we start with the cheapest tool there is: plain code.
A check is just a function. To make it part of your workflow, you want it in a test suite that runs every time you change a prompt, a model or a tool. In Python, that's pytest.
An agent's reply is only half the story. The other half is what it did: which tools it called, with which arguments, in what order. Tool calls are structured data, which makes them perfect for code checks.
Our agent answers policy questions by searching Acme's policy documents. If the search brings back the wrong section, even a perfect model will give a wrong answer.
Our biggest failure from Section 3 was sharing order details before verifying the customer. I built a code check for it.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
In Section 4 we found the failures that code can't catch, like an agent hinting that an order hasn't shipped. For those we need an LLM judge: a model that reads the conversation and decides pass or fail.
The most common judge prompt in the wild says: rate this response from one to ten. It feels precise. It isn't. In this lecture I'll show you why a plain pass or fail on one specific failure is better, using our own data.
Time to write a real judge, and we'll aim it at our number one failure: sharing order details before the customer is verified. Our code check from Section 4 already catches the obvious leaks.
To measure a judge, you need the right answers: a set of conversations where a careful person has already decided pass or fail. That's your gold set. The good news: we've already done most of the work in Section 3.
We have a judge and a gold set. Now we need numbers that tell us whether to trust the judge. Accuracy is the number everyone reaches for, and it's the wrong one. Let's see why, and what to use instead.
Our first judge missed six leaks on the test set. In this lecture we'll improve it the right way: change the prompt, measure on the dev set, and only at the end, check the test set once.
Last question for this section: which model should run your judge? It's tempting to just pick the biggest one. But a judge might run on every conversation, every day, so cost matters.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
We now have checks and a judge we trust. But evaluators need something to evaluate. Every time you change a prompt or a model, you want to run the same set of test inputs and compare.
How many test cases do you need? The honest answer is: it depends on what decision you're making. If you want to know roughly how bad things are, you need fewer than you think.
Real failures are the best test cases, but sometimes you don't have enough of them, or you want to test situations you haven't seen yet. That's where synthetic inputs come in.
Synthetic inputs are useful, but they're not real customers. Before you trust a score measured on generated data, compare it with what your real traffic looks like.
Your test set will change: new failures get added, labels get corrected. That's healthy, but it creates a problem. If last month's score came from eighty-nine cases and this month's from a hundred and one, you can't compare them.
So far we've mostly judged what the agent says. But an agent doesn't just talk. It looks things up, issues refunds, and hands cases to people. In this section we evaluate what it does.
A trajectory is the ordered list of tool calls an agent makes: which tool, with which arguments, and what came back. In this lecture we write evals that check it, and run them on both the Opus and Haiku versions of our agent.
When you change an agent's prompt, you want to know whether its decisions changed. But real tools get in the way. Orders ship, data changes, and refunds really happen. In this lecture we replay recorded runs with the tools frozen.
Real customers don't send one message and leave. They push back, they forget their email, they change their minds. Some failures only show up over several turns. In this lecture we test whole conversations.
You don't have to write every agent check yourself. Libraries like DeepEval ship ready-made agent metrics. In this lecture we run two of them on our agent and compare them with the rules we wrote.
Our trajectory checks run in code and print a table. That's fine for CI, but when you're investigating, you want to click on a failing run and see every step. In this lecture we put our eval results next to the traces, in Phoenix.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
We have a versioned test set, code checks and a validated judge. Now we can answer the questions teams actually ask. Is the new prompt better? Can we switch to a cheaper model? It starts with running experiments.
Our biggest failure, by far, is sharing order details before the customer is verified. In this lecture we fix it in the prompt and compare the two versions, case by case.
A new prompt scores five points higher. Should you ship it? With a hundred test cases, a five-point change can easily be noise. In this lecture we measure the noise, then test whether a difference is real.
Here's a situation every team hits. Someone notices the cheaper model costs a fraction of the price and asks: can we just switch? Let's answer it properly, and see how easy it is to get wrong.
Quality is never the only thing that matters. Every configuration also has a cost and a speed. In this lecture we put all three side by side and make a decision.
Everything we've built so far runs when you remember to run it. In this section, it runs on its own. Every change to the agent gets checked before it can merge.
Now we wire the tiers into GitHub Actions. The goal is a red cross on any pull request that makes the agent worse, with a message that says exactly what broke.
The golden set tells you rates over many cases. Sometimes you want something more direct: a handful of known messages, and for each one, a rule the answer must follow.
Every floor in the gate is a number someone chose. In this lecture: why those numbers are almost never one hundred percent, how to pick them, and who should own them.
A gate only works if people don't resent it. If every pull request waits five minutes and costs a dollar, someone will turn it off. So in this last lecture, we make the suite fast and cheap without making it blind.
Starter code and tests. Run pytest in the folder until every test passes. Full instructions are in the README inside the zip.
CI tests the cases you thought of, before release. Production is where everything else happens. In this section we keep measuring after launch, starting with online evals: the same checks, run on real traffic.
Your users already judge every reply. Thumbs, edits, and asking for a human are free signals. Let's see what they're good for, and where they're blind.
A silent failure is one that throws no errors. Nothing crashes, nothing times out, and customers are happy. Only your evals can see it, so your evals need to raise the alarm.
Quality isn't the only thing that drifts. Cost and latency do too, and the GenAI attributes we added in Section two give us both for free.
Evals measure after the fact. A guardrail runs before the reply is sent, and can stop it. They sound similar, and they're often confused, so let's build one and compare.
Real customers are mostly polite. A few are not, and some will try to trick your agent on purpose. Red-teaming means attacking your own agent first, and keeping those attacks as tests.
This course contains the use of artificial intelligence.
How this course was made: the lecture narration uses an AI-generated voice created from the instructor's own voice, and AI tools helped produce the slides, visuals and demo code. The instructor introduces the course on camera.
Your LLM app passed the vibe check. Then a customer found the bug.
This course teaches you how to test and evaluate LLM apps, RAG systems and AI agents the way production teams do. You work on one realistic project from start to finish: Acme's online-store support agent. You'll trace it, read its real conversations, find what actually breaks, and build the evals that catch those failures before customers do.
Everything is vendor-neutral and built on open standards. The same OpenTelemetry traces flow to Langfuse or Arize Phoenix, and the method works with any eval tool.
What you'll do
You also get
Every number in the videos comes from code you can run yourself, including the bugs: a privacy leak hidden in traces, a hotfix that dropped a pass rate from 96% to 6% while customers kept giving thumbs up, and a cheaper model that looked fine until it was measured.
If you're a software or AI engineer shipping LLM features, a QA engineer moving into AI testing, or a tech lead deciding when an AI feature is ready, this course is for you.