Skip to main content

Evaluators

Evals grades AI traces automatically and keeps every score in one place. The Evaluators page is where evaluators and the rules that run them are created; scores are reviewed on the Scores page.

The Evaluators page has two tabs, Evaluators and Rules. Evaluators come in three types:

  • LLM-as-a-judge – Explains each score and suits nuanced checks.
  • Decision model – Answers set questions quickly and cheaply.
  • Code – Grades with exact rules and makes no model call.

1. Evaluators​

An evaluator defines how a trace or a single observation is graded. Each evaluator can be tested on real data before it is saved. Evaluators can start from a template, or from scratch with one of the three types below.

Evals Example

LLM-as-a-judge​

An LLM grades each trace or observation using the instructions you write, and returns a score with its reasoning. Best for checks that need judgement, such as helpfulness or tone.

How to Use It​
  1. Go to the Evaluators page.
  2. Click New evaluator.
  3. Under Start from scratch, select LLM-as-a-judge.
  4. Under Define evaluation method, select what it Grades: One observation or Whole trace.
  5. Select the model that acts as the judge.
  6. Write the instructions for the judge in the prompt message. Click Add message to add more messages.
  7. Select the Score type: a number from a minimum to a maximum, one category, or a boolean. For categories, click Add category and enter each label.
  8. Under Map variables to data, map each variable in the prompt to a field of the observation or trace.
  9. Under Name evaluator, enter the Name and description.
  10. Click Test with sample observations (or Test with sample traces), select a sample from Matching observations and click Run test on this sample.
  11. Review the score and click Create evaluator.

Evals Example

Decision model​

A model answers a fixed set of questions about each observation, and the answers become the scores. Best for simple, repeatable checks at a low cost.

How to Use It​
  1. Go to the Evaluators page.
  2. Click New evaluator.
  3. Under Start from scratch, select Decision model.
  4. Under Define evaluation method, select what it Grades and select the model.
  5. Under Questions, click Add question and select its Type:
    • Choice – Enter the Question and click Add option for each answer.
    • Score – Enter the Question and click Add level for each level, from low to high.
    • Yes / no – Enter the Question and what Yes means and No means.
  6. Enter the Score name for each question. Add more questions as required.
  7. Under Build the state, select the fields the model reads. Click Add field to add more.
  8. Under Name evaluator, enter the Name and description.
  9. Click Test with sample observations, select a sample and click Run test on this sample.
  10. Review the scores and click Create evaluator.

Evals Example

Code​

Code you write grades each observation with exact rules, without calling a model. Best for checks with a clear right answer, such as format or length.

How to Use It​
  1. Go to the Evaluators page.
  2. Click New evaluator.
  3. Under Start from scratch, select Code.
  4. Under Define evaluation method, select the language: TypeScript or Python.
  5. Write the evaluation code in the editor. Click Format to tidy it, and check that it shows Valid.
  6. Under Name evaluator, enter the Name and description. The name is also the score name.
  7. Click Test with sample observations, select a sample and click Run test on this sample.
  8. Review the score and click Create evaluator.

Note: The evaluator type and what it grades cannot be changed after it is created. Code evaluators grade one observation only and cost nothing to run. An LLM-as-a-judge or Decision model evaluator without a model cannot run on rules until a model is selected.

Evals Example


2. Rules​

Rules run evaluators automatically on matching traces, with an optional backfill of past traces. Each rule shows its estimated LLM cost per week, and the one-time backfill cost, before it starts.

How to Use It​
  1. Go to the Evaluators page and click the Rules tab.
  2. Click New rule.
  3. Under Configure rule scope, select the traces dataset, add filters and set the Sampling rate.
  4. Under Attach evaluators, click Attach evaluator and select the evaluator.
  5. To score past traces too, select the backfill option and choose how many and from when.
  6. Check the estimated cost.
  7. Under Name rule, enter the Name and click Save and activate.

Note: A rule can also be created from the Evaluator saved dialog, shown right after an evaluator is created. Code evaluators cost nothing to run.

Availability:​

Available to all users to view; creating and editing evaluators and rules is limited to Admins and Editors.

Evals Example