Skip to main content
Judge provides a simple, unified API for evaluating agent outputs using LLM-as-judge. It supports accuracy evaluation, criteria-based evaluation, and custom judges.

How It Works

Quick Start

Judge Types

AccuracyJudge

Compares output against expected output

CriteriaJudge

Evaluates against custom criteria

Configuration

model
string
default:"gpt-4o-mini"
LLM model to use for judging
temperature
float
default:"0.1"
Temperature for LLM calls (lower = more consistent)
threshold
float
default:"7.0"
Score threshold for passing (1-10 scale)
criteria
string
Custom criteria for evaluation

Custom Judges

1

Create Custom Judge

2

Register Judge

3

Use Judge

Response format

A custom judge’s prompt asks the model for a SCORE: line and a REASONING: line, which the shared parser turns into a numeric score and an explanation.
MediaEvaluator accepts the same SCORE: / REASONING: shape for its image and text branches. Its parser matches the labels case-insensitively and keeps multi-line reasoning. See Media Evaluator.

Registry Functions

The same registry is reachable from the shell:
Output:

JudgeResult

score
float
Quality score from 1-10
passed
bool
Whether score >= threshold
reasoning
string
Explanation for the score
suggestions
list
Improvement suggestions

CLI Usage

Async Support

Best Practices

  • Use accuracy mode when you have a known expected output
  • Use criteria mode for subjective quality evaluation
  • Create custom judges for domain-specific evaluation
  • Default threshold is 7.0 (70%)
  • Increase for critical evaluations
  • Decrease for exploratory testing
  • Be specific in your criteria
  • Include measurable aspects
  • Avoid vague terms like “good” or “nice”
Judge uses lazy loading - litellm is only imported when you actually run an evaluation, ensuring zero performance impact when not in use.