How Evaluation Works
LLM as Judge
AI evaluates AI with human-like reasoning
Accuracy
Compare output vs expected result
Performance
Measure speed and memory usage
Reliability
Verify tools are called correctly
LLM as Judge
The Judge class uses an LLM to evaluate outputs with human-like reasoning. This is the recommended approach for most evaluations.- Quick Start
- With Agent
- Custom Criteria
Judge Types
AccuracyJudge
AccuracyJudge
Compares output against expected output.
CriteriaJudge
CriteriaJudge
Evaluates against custom criteria.
RecipeJudge
RecipeJudge
Evaluates multi-agent workflow outputs.
Judge Registry
Register and retrieve custom judges:Evaluation Types
Accuracy Evaluation
Compare agent output against expected output using LLM-as-judge.- Basic
- Multiple Iterations
- Evaluate Output
Performance Evaluation
Measure runtime and memory usage.- Agent Benchmark
- Function Benchmark
Performance Metrics Available
Performance Metrics Available
| Metric | Description |
|---|---|
avg_run_time | Average execution time |
min_run_time | Fastest execution |
max_run_time | Slowest execution |
std_dev_run_time | Standard deviation |
median_run_time | Median execution time |
p95_run_time | 95th percentile |
avg_memory_usage | Average memory (MB) |
Reliability Evaluation
Verify that expected tools are called.- Expected Tools
- Forbidden Tools
- Pre-recorded
Criteria Evaluation
Evaluate against custom criteria with numeric or binary scoring.- Numeric Scoring
- Binary Scoring
- With Callback
Evaluation Flow
Async Evaluation
All evaluators support async execution:Saving Results
Save evaluation results for later analysis:Evaluation Packages
Run multiple test cases as a batch:Quick Reference
Judge
Accuracy
Performance
Reliability
Best Practices
Start with LLM as Judge
Start with LLM as Judge
Use
Judge for most evaluations - it provides human-like reasoning.Define Clear Criteria
Define Clear Criteria
Be specific: “Response is under 100 words and includes a greeting” is better than “Response is good”.
Use Multiple Iterations
Use Multiple Iterations
Run evaluations multiple times to account for LLM non-determinism.
Save Results
Save Results
Use
save_results_path to track evaluation history over time.Combine Evaluators
Combine Evaluators
Use Accuracy for correctness, Performance for speed, Reliability for tool usage.
Related
Guardrails
Protect agents with input/output validation
Hooks
Intercept and modify agent behavior

