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.
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
str
default:"auto-generated"
Unique identifier for the council
str
default:"CouncilAsAJudge"
Display name of the council
str
Description of the council’s purpose
str
default:"gpt-5.4"
Currently has no effect on judge selection. Judge agents are always built with
judge_agent_model_name (see below); reliability_check() only ever overwrites this attribute with a random model string when random_model_name=True, and nothing reads it back afterward.str
default:"final"
Type of output to return (“final”, “dict”, “list”, etc.)
int
default:"128"
Size of the LRU cache for prompts
bool
default:"True"
Currently has no effect on judge selection. When
True, reliability_check() assigns a random model string to self.model_name, but _create_judges() never reads self.model_name — judge models are controlled solely by judge_agent_model_name.int
default:"1"
Maximum number of loops for agents
str
default:"gpt-5.4"
Model name for the aggregator agent. This one does correctly control the aggregator.
Optional[str]
default:"None"
The model used to build every judge agent (
_create_judges() passes it as model_name for each dimension judge). This is the only parameter that controls judge models. Since it defaults to None, judges are built with model_name=None unless you set this explicitly.Methods
run()
Run the evaluation process using parallel execution.task(str): Task containing the response to evaluate
Usage Examples
Basic Evaluation
Custom Model Configuration
Full Conversation History
Specific Judge Model
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: Individual dimension failures don’t stop other evaluations
- 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: Robust exception handling for each 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
judge_agent_model_nameto control which model judges run on —model_nameandrandom_model_namecurrently have no effect on judge selection - Use stronger models (GPT-4, Claude) for critical evaluations
- Use faster models (GPT-4o-mini) for development/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