Skip to main content

Overview

The CouncilAsAJudge 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:
  1. Accuracy: Factual correctness, source credibility, logical consistency
  2. Helpfulness: Practical value, solution feasibility, problem-solving efficacy
  3. Harmlessness: Safety assessment, ethical considerations, bias detection
  4. Coherence: Structural integrity, logical flow, organization
  5. Conciseness: Communication efficiency, precision, information density
  6. 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"
Model name for judge agents (if not using random models)
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"
Whether to use random model names for diversity
int
default:"1"
Maximum number of loops for agents
str
default:"gpt-5.4"
Model name for the aggregator agent
Optional[str]
default:"None"
Specific model for judge agents (overrides model_name)

Methods

run()

Run the evaluation process using parallel execution.
Parameters:
  • task (str): Task containing the response to evaluate
Returns: Formatted evaluation report based on output_type

Usage Examples

Basic Evaluation

Custom Model Configuration

With Random Model Diversity

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:
  1. Specific Observations: References exact parts of the response
  2. Impact Analysis: Explains how issues affect quality
  3. Concrete Examples: Demonstrates strengths and weaknesses
  4. Improvement Suggestions: Actionable recommendations

Parallel Execution

The council uses ThreadPoolExecutor 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

  1. Response Quality Assessment: Evaluate LLM outputs before deployment
  2. Model Comparison: Compare different models’ responses
  3. Training Data Evaluation: Assess quality of training examples
  4. Content Review: Evaluate generated content for publication
  5. Automated QA: Build quality assurance pipelines
  6. A/B Testing: Compare different prompt variations

Best Practices

  1. Output Type Selection:
    • Use "final" for quick summary reports
    • Use "dict" to analyze individual dimension evaluations
    • Use "json" for integration with other systems
  2. Model Selection:
    • Enable random_model_name=True for diverse perspectives
    • Use stronger models (GPT-4, Claude) for critical evaluations
    • Use faster models (GPT-4o-mini) for development/testing
  3. Performance:
    • Council auto-configures workers based on CPU count
    • Consider cache_size for repeated similar evaluations
    • Monitor costs when using multiple premium models
  4. Integration:
    • Parse the aggregated report for actionable insights
    • Use dimension-specific feedback for targeted improvements
    • Store evaluations for tracking quality over time