Overview
TheCouncilAsAJudge implements a parallel evaluation system where multiple specialized judge agents evaluate different aspects of a task response simultaneously. Their findings are aggregated into a comprehensive technical report.
You do not pass agents to the council. It builds one judge per dimension and one aggregator itself. Pass the text to evaluate as the task argument of run, including both the original question and the response, because each judge receives that single string as both the task and the response to grade.
Installation
Evaluation Dimensions
The council evaluates responses across six key dimensions:- Accuracy: Factual correctness, source credibility, logical consistency
- Helpfulness: Practical value, solution feasibility, problem-solving efficacy
- Harmlessness: Safety assessment, ethical considerations, bias detection
- Coherence: Structural integrity, logical flow, organization
- Conciseness: Communication efficiency, precision, information density
- Instruction Adherence: Compliance with requirements, constraint adherence
Attributes
Optional[str]
default:"None"
Unique identifier for the council. When omitted, one is generated as
council-as-judge-<32 hex characters>.str
default:"CouncilAsAJudge"
Display name of the council
str
Description of the council’s purpose
str
default:"gpt-5.4"
Model for the six judge agents when
judge_agent_model_name is not set. Setting it to None raises ValueError.str
default:"final"
Type of output to return (
"final", "dict", "list", "json", and so on). "final" returns only the aggregator’s report. Setting it to None raises ValueError.int
default:"128"
Size of the LRU cache for prompts
bool
default:"False"
When
True, model_name is replaced at construction with a model picked at random from a built-in list. Judges then run on that model unless judge_agent_model_name is set. The list mixes providers, so you need API keys for each of them.int
default:"1"
Stored on the instance but not used. Judges and the aggregator always run with
max_loops=1.str
default:"gpt-5.4"
Model name for the aggregator agent that writes the final report.
Optional[str]
default:"None"
Model for every judge agent. When
None, judges run on model_name.Methods
run()
Run the evaluation process using parallel execution.task(str): Task containing the response to evaluate
output_type. With the default "final", this is the aggregator’s report as a string.
Raises: EvaluationError if any step fails, including a single dimension’s judge. The error message names the failing dimension.
Process flow:
- Clears the conversation and records the task as a
Usermessage, so each run starts fresh - Runs the six judges in parallel. Each judge’s analysis is recorded under its own name as it finishes
- Sends the aggregator the task and every judge’s analysis as separate chat turns, each labelled with the judge’s name
- Records the aggregator’s report and returns the formatted conversation
Usage Examples
Basic Evaluation
Custom Model Configuration
Full Conversation History
Specific Judge Model
judge_agent_model_name takes precedence over model_name for the judges.
Evaluation Report Structure
The final aggregated report includes:1. Executive Summary
- Key strengths and weaknesses
- Critical issues requiring immediate attention
- Overall assessment
2. Detailed Analysis
- Cross-dimensional patterns
- Specific examples and their implications
- Technical impact assessment
3. Recommendations
- Prioritized improvement areas
- Specific technical suggestions
- Implementation considerations
Dimension-Specific Evaluations
Each judge provides:- Specific Observations: References exact parts of the response
- Impact Analysis: Explains how issues affect quality
- Concrete Examples: Demonstrates strengths and weaknesses
- Improvement Suggestions: Actionable recommendations
Parallel Execution
The council usesThreadPoolExecutor to evaluate all dimensions simultaneously:
- Workers: Automatically configured based on CPU count (75% of cores)
- Concurrency: All 6 dimensions evaluated in parallel
- Error Handling: If any dimension fails,
runraisesEvaluationErrorand no report is produced - Performance: Significantly faster than sequential evaluation
Example Output
Features
- Multi-Dimensional Evaluation: Comprehensive assessment across 6 key dimensions
- Parallel Processing: All evaluations run concurrently for maximum speed
- Expert Judge Agents: Each dimension evaluated by specialized agent
- Intelligent Aggregation: Senior agent synthesizes all findings
- Technical Analysis: Detailed, actionable feedback for improvement
- Flexible Models: Support for any LLM model via LiteLLM
- Caching: LRU cache for frequently used prompts
- Error Handling: Failures surface as
EvaluationErrorthat names the failing dimension - Multiple Output Formats: Choose from various output types
Use Cases
- Response Quality Assessment: Evaluate LLM outputs before deployment
- Model Comparison: Compare different models’ responses
- Training Data Evaluation: Assess quality of training examples
- Content Review: Evaluate generated content for publication
- Automated QA: Build quality assurance pipelines
- A/B Testing: Compare different prompt variations
Best Practices
-
Output Type Selection:
- Use
"final"for quick summary reports - Use
"dict"to analyze individual dimension evaluations - Use
"json"for integration with other systems
- Use
-
Model Selection:
- Set
model_nameorjudge_agent_model_nameto choose the judges’ model, andaggregation_model_namefor the final report - Use stronger models (
gpt-5.4,claude-sonnet-4-6) for critical evaluations - Use faster models (
gpt-5.4-mini) for development and testing
- Set
-
Performance:
- Council auto-configures workers based on CPU count
- Consider cache_size for repeated similar evaluations
- Monitor costs when using multiple premium models
-
Integration:
- Parse the aggregated report for actionable insights
- Use dimension-specific feedback for targeted improvements
- Store evaluations for tracking quality over time