Skip to main content

AI Response Quality Evaluation System

This example demonstrates how to evaluate AI-generated content across multiple quality dimensions using CouncilAsAJudge — perfect for quality assurance, model benchmarking, and response improvement workflows.

Step 1: Get Your API Key

  1. Visit https://swarms.world/platform/api-keys
  2. Sign in or create an account
  3. Generate a new API key
  4. Set it as an environment variable:

Step 2: Setup

Step 3: Configure the Evaluation Request

CouncilAsAJudge does not take a custom agents roster — the API’s SwarmRouter never forwards your agents list to it, so any agents you supply are never run. The council always runs its own fixed panel: one judge per evaluation dimension (accuracy, helpfulness, harmlessness, coherence, conciseness, instruction_adherence, named <dimension>_judge in the output, e.g. accuracy_judge), then a fixed aggregator_agent that synthesizes all six into one report. The request must still include one placeholder agent: agents: [] or omitting the field returns 400 “A list of agents is required”. The placeholder is billed the per-agent fee but never executed.The only swarm-type-specific field is council_judge_model_name (SwarmSpec, default gpt-5.4, listed under parameters for CouncilAsAJudge by GET /v1/swarms/available). It sets the model of the six dimension judges; the aggregator always runs on gpt-5.4.
Each dimension judge and the aggregator run with the framework’s own fixed prompts - you only supply the task and the response to evaluate:

Step 4: Run the Evaluation

Expected Output:

Step 5: Batch Evaluation for Model Comparison

Use CouncilAsAJudge to compare responses from different models on the same task:
CouncilAsAJudge evaluates responses across 6 fixed dimensions in parallel: accuracy, helpfulness, harmlessness, coherence, conciseness, and instruction adherence. Each dimension judge works independently, then aggregator_agent synthesizes all evaluations into a single comprehensive report with prioritized recommendations. Neither the dimensions, the judges’ prompts, nor the agent roster are configurable - only council_judge_model_name (and the standard name/description/task) tune this swarm type; the swarm-level max_loops is not passed to it.