Skip to main content

Investment Strategy Council

This example demonstrates how to use LLMCouncil to get independent responses from multiple agents, have them peer-review and rank each other’s work, then synthesize the best elements into a final answer — inspired by Andrej Karpathy’s llm-council concept.

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: Define the Council

Create council members with distinct perspectives. Each member will independently answer the query, then review and rank all anonymized responses before a chairman synthesizes the final answer:

Step 4: Run the Council

Expected Output:

How LLMCouncil Works

The council follows a 3-phase workflow:

Step 5: Customize the Chairman

Pass chairman_model on the SwarmSpec (a sibling of swarm_type and agents, not an agent field) to change which model synthesizes the final answer - it defaults to gpt-5.1:
LLMCouncil is inspired by Andrej Karpathy’s llm-council concept. Each agent responds independently (role = agent name), then every member evaluates all anonymized responses (recorded as <agent_name>-Evaluation). A Chairman agent (model set by chairman_model, default gpt-5.1) synthesizes everything — original responses plus rankings — into a final answer that incorporates the strongest elements from each perspective. output contains one entry per member’s response, one -Evaluation entry per member, and one final Chairman entry.