Metadata-Version: 2.5
Name: yet-another-council
Version: 1.3.0
Summary: Yet Another Council (YAC): multi-LLM debates on the AI CLIs you already have. No API keys, real web UI, REST API and MCP server.
Project-URL: Homepage, https://github.com/balpars/yet-another-council
Project-URL: Repository, https://github.com/balpars/yet-another-council
Project-URL: Issues, https://github.com/balpars/yet-another-council/issues
Author: Alp
License-Expression: MIT
License-File: LICENSE
Keywords: claude,claude-code,codex,consensus,debate,gemini,glm,llm,llm-council,mcp,mixture-of-agents,multi-agent,ollama
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115.0
Requires-Dist: pydantic>=2.9.0
Requires-Dist: rich>=13.9.0
Requires-Dist: uvicorn>=0.32.0
Description-Content-Type: text/markdown

# 🏛️ YAC · Yet Another Council

[![CI](https://github.com/balpars/yet-another-council/actions/workflows/ci.yml/badge.svg)](https://github.com/balpars/yet-another-council/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/balpars/yet-another-council/blob/main/LICENSE)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-3776AB.svg)](https://www.python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-REST_%2B_SSE-009688.svg)](https://fastapi.tiangolo.com)
[![MCP Server](https://img.shields.io/badge/MCP-Claude_Code_%7C_Cursor-7c3aed.svg)](#-mcp-server-claude-code--cursor--windsurf)
[![No API Keys Needed](https://img.shields.io/badge/API_Keys-Not_Required-10b981.svg)](#-why-yac)

> **Yet another LLM council. This one runs on the AI CLIs you already have (no API keys) and comes with a real web UI.**
>
> Put Claude, Gemini, GLM, Codex and local models in one room: they debate, review each other blindly or stress-test an idea, then a judge delivers the verdict. Five deliberation algorithms, drag-and-drop roles, live streaming, plus a REST API, an OpenAI-compatible endpoint and an MCP server.

```bash
pipx install yet-another-council
yac   # opens the web UI at http://127.0.0.1:8765
```

![YAC demo: Claude, GPT-OSS (via agy) and GLM debate whether AI agents should merge their own PRs, then a judge delivers the verdict](https://github.com/balpars/yet-another-council/raw/main/docs/demo.gif)

---

## ⚡ Why YAC?

Classic multi-LLM deliberation frameworks (such as `karpathy/llm-council` or `togethercomputer/MoA`) need per-token API keys. A single 2-round debate across 3 frontier models plus a Judge synthesis triggers **7+ large LLM calls per question**.

Many developers already have AI subscriptions that come with an official command-line tool. **YAC needs no extra API keys: it drives the CLIs you already have installed and logged in.**

| Subscription / Runtime | CLI Binary / Endpoint | Models |
| :--- | :--- | :--- |
| **Claude Pro / Max** | `claude` (Claude Code CLI) | `sonnet` / `opus` / `haiku` (always the latest) |
| **Google AI Pro / Antigravity** | `agy` (Antigravity CLI) | Live list from `agy models` |
| **Z.ai GLM Coding Plan** | `zcode` (ZCode CLI) | `GLM-5.3` / `GLM-5.3-Flash` |
| **ChatGPT Plus / Pro** | `codex` (OpenAI Codex CLI) | Any model your Codex CLI supports |
| **Local Open-Weights** | `ollama` | Live list of your installed models |
| **External REST APIs** *(Optional)* | `DeepSeek`, `OpenRouter`, `OpenAI`, `Groq`, Custom | Live list from the provider's `/models` |

Model lists are fetched automatically (at most once a day) wherever the provider offers a way to list them, so new models show up without an update. You can always type any model ID by hand.

> **Fair use:** Each council run makes several requests (e.g. 3 members × 2 rounds + judge = 7 calls), which count toward your subscription's usage limits. YAC only calls each provider's official CLI, the same way you would from a terminal; please make sure your usage fits each provider's terms.

**YAC** auto-detects installed CLIs on your machine, orchestrates them **in parallel** using Python `asyncio`, and streams every round of deliberation live to a calm, minimalist Web UI or Rich terminal interface.

### Feature Comparison

| Feature | `karpathy/llm-council` | `togethercomputer/MoA` | **🏛️ YAC** |
| :--- | :---: | :---: | :---: |
| **Works with your existing CLI subscriptions (no API keys needed)** | ❌ | ❌ | ✅ (`claude`, `agy`, `zcode`, `codex`) |
| **Local Models (`ollama`) + External APIs (`DeepSeek`, etc.)** | ❌ | ⚠️ Partial | ✅ Hybrid CLI + REST API |
| **Deliberation Topologies** | 1 (3-Stage) | 1 (MoA) | **5** (`debate`, `karpathy`, `moa`, `blind_vote`, `red_team`) |
| **Drag-and-Drop Specialist Roles & Role Stacking** | ❌ | ❌ | ✅ Single role in Simple, stackable in Advanced |
| **Multi-Seat Cloning (Same/Different Models in Different Roles)** | ❌ | ❌ | ✅ e.g. `Claude #1 [Architect]` vs `Claude #2 [Devil's Advocate]` |
| **Per-Seat Model & Reasoning Effort Selection** | ❌ | ❌ | ✅ (`low`, `medium`, `high`, `xhigh`, `max`) |
| **Reusable Templates + Outbound REST API (`/api/v1/ask`)** | ❌ | ❌ | ✅ + OpenAI-compatible `/v1/chat/completions` |
| **Native MCP Server (`yac-mcp`)** | ❌ | ❌ | ✅ Plug into Claude Code, Cursor, Windsurf |

### Yes, there are other councils

The name is honest: multi-LLM councils are a crowded idea, and some other good tools also use your CLI subscriptions:

- [`consult-llm`](https://github.com/raine/consult-llm) and [`deliberation`](https://github.com/antonbabenko/deliberation) live **inside your coding agent** (skills / MCP / plugins) and are great for a quick second opinion while coding.
- [`mooting`](https://github.com/jyunming/mooting) and [`conclave`](https://github.com/0xDarkMatter/conclave) are **terminal-first** councils.

**YAC is the standalone app:** a web UI where you watch every round stream in, pick from five deliberation algorithms, assign roles by drag-and-drop, and keep a searchable history. The same councils are available from the terminal, a REST / OpenAI-compatible API, and MCP.

---

## ✨ Core Features

![YAC: Claude, GPT-OSS and GLM take different positions on whether AI agents should merge their own PRs](https://github.com/balpars/yet-another-council/raw/main/docs/screenshot.png)

### 1. Auto-Discovery Onboarding & Interactive Spotlight Tour
On first launch (or anytime via the `?` button), YAC scans your `PATH` for installed CLI tools, displays their readiness status, lets you optionally plug in external API keys (such as **DeepSeek API**, **OpenRouter**, **OpenAI**, **Groq**, or any custom OpenAI-compatible endpoint), and offers a 4-step **Interactive Spotlight Tour** that focuses on each area of the interface.

### 2. Progressive Disclosure UI (`Simple` vs. `Advanced` Mode)
- **Simple Mode:** Zero-config, distraction-free workspace. Type your prompt at the top, drag a specialist role (`🌐 General`, `🏗️ System Architect`, `😈 Devil's Advocate`, `🛡️ Security & Risk`, `⚡ Pragmatic Engineer`, `💰 Product & Cost`, `🔬 First-Principles`) onto any detected member, pick one of the 5 algorithms, and click **Convene Council →**.
- **Advanced Mode:** Unlocks power-user controls:
  - **Multi-Seat Cloning (`⧉` / `+ Seat`):** Add multiple seats from the same provider (either with the same model in different specialist roles, or different models/efforts debating each other).
  - **Role Stacking:** Drag multiple roles onto a single seat to combine their system prompts.
  - **Per-Seat Model & Reasoning Effort Drawer:** Click any seat's `model • effort ▾` badge to override its model or reasoning effort level.
  - **Editable Role Prompts (`✎`):** Customize the system prompt of any role.
  - **Template, Judge & Rounds Controls:** Switch or save templates, pick the Supreme Judge, and adjust deliberation rounds.

### 3. Five Consensus & Deliberation Topologies

| Mode (`-m`) | Algorithm | How It Works |
| :--- | :--- | :--- |
| **`debate`** | **Multi-Agent Debate (MAD)** | **Round 1:** All seats answer independently in parallel from their assigned role perspectives.<br>**Round 2..N:** Each seat reads its peers' arguments, critiques logical flaws (with anti-sycophancy instructions), and refines its position.<br>**Final:** The Supreme Judge synthesizes consensus points, resolves disputes, and delivers the final verdict. |
| **`karpathy`** | **Karpathy 3-Stage Council** | **Stage 1 (First Opinions):** Parallel independent responses.<br>**Stage 2 (Anonymous Peer Review):** Responses are masked (`Response_A`, `Response_B`); models critique and rank each other blindly.<br>**Stage 3 (Chairman Synthesis):** Chairman reconciles all first opinions and peer rankings into one verdict. |
| **`moa`** | **Mixture of Agents (MoA)** | *Together AI pattern:* Layer 1 models act as diverse Proposers in parallel; Layer 2 Master Aggregator fuses the strongest insights from every proposer into one superior response. |
| **`blind_vote`** | **Blind Peer-Review Leaderboard** | Candidate answers are anonymized (`Candidate_A`, `Candidate_B`, `Candidate_C`). Models act as blind reviewers scoring each candidate `1–10` in structured JSON. A live leaderboard is computed and the highest-rated answer wins. |
| **`red_team`** | **Devil's Advocate / Stress Test** | Seat 1 proposes a thesis/architecture. Seat 2 (*Devil's Advocate*) ruthlessly attacks hidden assumptions, security flaws, and worst-case edge cases. Seat 3 (*Pragmatic Auditor*) flags over-engineering. The Judge produces a battle-tested synthesis. |

---

## 🧭 Architecture

```mermaid
flowchart LR
    Q["User Prompt / REST API / MCP"] --> O["Async Council Orchestrator"]
    subgraph Seats["Parallel Council Seats (CLI Subscriptions + APIs)"]
        C["Claude CLI (claude -p)"]
        G["Gemini CLI (agy -p)"]
        Z["GLM-5.3 CLI (zcode -p)"]
        X["Codex CLI / Ollama"]
        D["External APIs (DeepSeek / OpenRouter)"]
    end
    O --> C & G & Z & X & D
    C & G & Z & X & D --> A["Consensus Engine\n• Multi-Agent Debate\n• Karpathy 3-Stage Council\n• Mixture of Agents (MoA)\n• Blind Peer-Review\n• Red-Team Stress Test"]
    A --> V["Supreme Verdict\n(SSE Web UI • SQLite History • REST API • Markdown)"]
```

---

## 🚀 Quickstart

You need Python 3.11+ and at least one supported CLI installed and logged in (e.g. `claude`, `agy`, `zcode`, `codex`, or `ollama`).

```bash
# Install (pipx keeps it in its own environment; `pip install yet-another-council` works too)
pipx install yet-another-council

# Start the Web UI (opens http://127.0.0.1:8765 in your browser)
yac
```

If another tool on your machine already uses the name `yac`, the same command is also installed as `yet-another-council`.

Latest development version: `pipx install git+https://github.com/balpars/yet-another-council.git`. From a clone: `pip install -e .` then `yac`, or `python main.py`.

---

## 💻 Terminal CLI Usage

```bash
# Check detected CLI & API providers on your machine
yac --doctor

# Default: 2-Round Multi-Agent Debate across all installed providers
yac "Should we use Kafka, RabbitMQ, or Redis Streams for 15k events/sec?"

# Run with a Built-in or Custom Template (-t)
yac "Evaluate our zero-trust B2B authentication architecture" -t architecture-board

# Karpathy's 3-Stage Council (-m karpathy)
yac "Compare Rust PyO3 vs Cython for CPU-bound Python extensions" -m karpathy

# Mixture of Agents with Gemini as Aggregator and High Reasoning Effort
yac "Design a zero-downtime schema migration strategy for a 2TB Postgres table" -m moa -j gemini -e high

# Blind Peer-Review Leaderboard & Save Verdict to Markdown (-o)
yac "What is the best architecture for real-time collaborative editing (CRDT vs OT)?" -m blind_vote -o verdict.md

# List available templates and saved SQLite history
yac --templates
yac --history
```

---

## 🔌 Outbound REST API & Templates (`/api/v1/ask`)

While `yac` is running, it exposes a REST API and an OpenAI-compatible chat completion endpoint on `http://127.0.0.1:8765`.

### 1. Query with a Template (`default` or custom template)
Built-in templates include `default`, `architecture-board`, and `red-team-audit`. You can also create custom templates from the Web UI or via `POST /api/v1/templates`.

```bash
curl -X POST http://127.0.0.1:8765/api/v1/ask \
  -H "Content-Type: application/json" \
  -d '{
    "question": "Postgres vs ClickHouse for real-time event analytics?",
    "template": "default"
  }'
```

### 2. Parameterized Query (No Template Required)
Pass `algorithm`, `rounds`, `judge`, and custom `participants` (including multi-seat configurations, specific models, efforts, and roles) directly in the request body:

```bash
curl -X POST http://127.0.0.1:8765/api/v1/ask \
  -H "Content-Type: application/json" \
  -d '{
    "question": "Monolith vs Microservices for a team of 6 engineers?",
    "algorithm": "debate",
    "rounds": 2,
    "judge": "claude",
    "participants": [
      {"provider": "claude", "model": "opus", "effort": "high", "role": "System Architect"},
      {"provider": "gemini", "model": "gemini-4-argon-medium", "role": "Devil'\''s Advocate"},
      {"provider": "glm", "model": "GLM-5.3", "role": "Pragmatic Engineer"}
    ]
  }'
```

### 3. OpenAI SDK Compatible Endpoint (`POST /v1/chat/completions`)
Use any standard OpenAI client, LangChain, or n8n node by pointing `base_url` to `http://127.0.0.1:8765/v1` and specifying `model="council/default"` (or `model="council/<template-id>"`):

```bash
curl -X POST http://127.0.0.1:8765/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "council/architecture-board",
    "messages": [
      {"role": "user", "content": "How should we design idempotent webhook consumers?"}
    ]
  }'
```

---

## 🧩 MCP Server (Claude Code / Cursor / Windsurf)

YAC includes a built-in **Model Context Protocol (MCP)** server over `stdio` (`yac-mcp`), exposing `ask_council`, `list_council_templates`, and `list_council_providers`. Your coding agent can automatically convene the council whenever it hits a complex architectural trade-off or bug.

### Add to Claude Code CLI in One Command
```bash
claude mcp add yac -- yac-mcp
```

### Add to Cursor / Windsurf / Antigravity (`mcp.json`)
```json
{
  "mcpServers": {
    "yac": {
      "command": "yac-mcp"
    }
  }
}
```

---

## 🧪 Running Tests

```bash
python -m unittest discover -s tests -v
```

---

## 📄 License

Released under the [MIT License](https://github.com/balpars/yet-another-council/blob/main/LICENSE).
