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
- Accuracy Check
- Criteria Check
- With Agent
Judge Types
AccuracyJudge
Compares output against expected output
CriteriaJudge
Evaluates against custom criteria
Configuration
LLM model to use for judging
Temperature for LLM calls (lower = more consistent)
Score threshold for passing (1-10 scale)
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 aSCORE: 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
JudgeResult
Quality score from 1-10
Whether score >= threshold
Explanation for the score
Improvement suggestions
CLI Usage
Async Support
Best Practices
Choose the Right Mode
Choose the Right Mode
- Use accuracy mode when you have a known expected output
- Use criteria mode for subjective quality evaluation
- Create custom judges for domain-specific evaluation
Set Appropriate Thresholds
Set Appropriate Thresholds
- Default threshold is 7.0 (70%)
- Increase for critical evaluations
- Decrease for exploratory testing
Use Specific Criteria
Use Specific Criteria
- 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.

