Building your first LLM eval

Build a single LLM grader end to end, from grader to deployed evaluator.

The simplest and most common evaluator is a single LLM grader with no branching: Original input to the grader to Final result. This walkthrough builds an LLM correctness check on a “world capitals” dataset, the same dataset used in the Datasets guide. Once you have this shape down, the other examples add one capability at a time.

New to the pieces involved? Start with the Evaluators overview.

Walkthrough

1

Create the grader

In the Graders section, add an LLM grader named Correctness. Set the output type to Number, the range to 0 to 1, and the passing score to 1. Write a definition that compares the output to the expected answer:

You are grading whether an answer is correct.
Question: {{input}}
Model answer: {{output}}
Expected answer: {{expected_output}}
Give 1 if the model answer contains the expected answer (ignore case,
punctuation, and extra surrounding words). Give 0 if it is wrong or missing.
Reply with ONLY a single number: 1 or 0.
Correctness grader definition
The Correctness grader: a numeric 0 to 1 LLM definition comparing output against expected_output.
2

Test the grader

Click Test run with a sample input to confirm the scoring. For output “Paris” and expected_output “Paris”, the grader returns 1.

Correctness grader test run
Test run of the Correctness grader returning a score of 1 for a matching answer.
3

Build the workflow and deploy

On the canvas, connect Original input to the Correctness grader to Final result. Click Test run to validate the whole flow, then Deploy to publish it as a version.

Simple evaluator workflow on the canvas
The evaluator canvas: Original input to the Correctness grader to Final result.

That is a complete evaluator, ready to attach to an experiment or online eval.

Deploy and versioning

Every deploy publishes a new, immutable version, so you can iterate safely:

  • Test run: validate the full flow against sample data before publishing.
  • Deploy: publish the current canvas as a new version.
  • Versions: view history and load an older version back into the editor.

What’s next

Each example builds on this one by adding a single capability: