Skip to main content
Agent as Judge evaluations let you define custom quality criteria and use an LLM to score your Agent’s responses. You provide evaluation criteria (like “professional tone”, “factual accuracy”, or “user-friendliness”), and an evaluator model assesses how well the Agent’s output meets those standards.

Basic Example

Here, AgentAsJudgeEval takes the Agent’s input and output and scores the response against the criteria you set.
agent_as_judge.py

Custom Evaluator Agent

You can use a custom agent to evaluate responses with specific instructions:
agent_as_judge_custom_evaluator.py

Params

Methods

run() / arun()

Run the evaluation synchronously (run()) or asynchronously (arun()).
Provide either (input, output) for single evaluation OR cases for batch evaluation, not both.

Run in a Suite

To gate many judge checks in CI, declare a Case per input with criteria and run them as a suite. judge_mode and judge_threshold on the Case map to scoring_strategy and threshold here, with the same defaults. See Eval Suites.

Examples

Basic Agent as Judge

Basic usage with numeric scoring and failure callbacks

Agent as Judge as Post-Hook

Automatic evaluation after agent runs

Developer Resources