This is a fork of karpathy/llm-council. New in this fork since the previously published state: - Conversation history is complete again: storage loads older runs from backend/data/conversations.json and supports the legacy data/ layout (including data/conversations/ per-conversation JSON files when present), so older runs show up in the UI. - Sidebar no longer truncates early: the frontend now req
Add this skill
npx mdskills install elhamid/llm-councilMulti-LLM collaborative system with decision traceability and anonymized peer review
1# LLM Council2345## Fork notes (elhamid)67This is a fork of `karpathy/llm-council`.89### Update — 2025-12-19 (Stability + auditability pass)1011New in this fork since the previously published state:1213- **Conversation history is complete again:** storage loads older runs from `backend/data/conversations.json` and supports the legacy `data/` layout (including `data/conversations/` per-conversation JSON files when present), so older runs show up in the UI.14- **Sidebar no longer truncates early:** the frontend now requests `/api/conversations?limit=500` so the conversation list reliably shows full history.15- **Stage 2 judge duplication fixed:** Stage 2 now dedupes judge models so evaluation does not silently double-count the same judge.16- **Titles persist correctly:** after Stage 3 completes, a title is derived and saved to the conversation record, so it sticks across refreshes and appears in history.17- **Tooling + reproducibility:** added Stage 2 smoke/quality scripts and supporting evaluation artifacts to make regressions repeatable.18- **Roles updated + clarified:** earlier fork notes described roles as **Analyst / Researcher / Critic / Provocateur**; the implemented role set is now **Builder / Reviewer / Synthesizer / Contrarian** (with a provider-default mapping in `backend/roles.py`). This keeps the “multi-perspective” intent, but with clearer, more actionable role behavior.1920### Value added — 2025-12-14 (decision-quality focused)21- **Decision-auditable runs:** every council response is saved with a compact decision trace (Stage 1 answers, Stage 2 rankings, and the Stage 2→model mapping), so you can inspect *why* the Chairman concluded what it did — not just the final text.22- **Reduced “model-brand” bias in judging:** Stage 2 rankings operate on anonymized responses (Response A/B/C/…), and the label→model mapping is preserved for post-hoc review. This keeps peer review focused on content quality rather than model identity.23- **Role-separated council behavior:** explicit role specs (Analyst / Researcher / Critic / Provocateur + Chairman) make the council behave more like a real review board: one pushes rigor, one hunts missing facts, one stress-tests, one challenges assumptions — then the Chairman synthesizes.24- **Repeatable scoring across runs:** aggregated ranks (average rank + count) are persisted so you can compare council behavior over time and across prompts, instead of treating each run as a one-off chat.2526### Implementation notes (supporting the above)27- Real SSE endpoint (`text/event-stream`) for `/api/conversations/{id}/message/stream` with incremental `stage*_start/complete` events.28- Persist `meta/metadata` (`label_to_model`, `aggregate_rankings`, `model_roles`) so Stage2 renders correctly and the run is reviewable later.29- Frontend Stage2 reads `msg.meta || msg.metadata` so fork/upstream payload shapes both render.3031----3233The idea of this repo is that instead of asking a question to your favorite LLM provider (e.g. OpenAI GPT 5.1, Google Gemini 3.0 Pro, Anthropic Claude Sonnet 4.5, xAI Grok 4, eg.c), you can group them into your "LLM Council". This repo is a simple, local web app that essentially looks like ChatGPT except it uses OpenRouter to send your query to multiple LLMs, it then asks them to review and rank each other's work, and finally a Chairman LLM produces the final response.3435In a bit more detail, here is what happens when you submit a query:36371. **Stage 1: First opinions**. The user query is given to all LLMs individually, and the responses are collected. The individual responses are shown in a "tab view", so that the user can inspect them all one by one.382. **Stage 2: Review**. Each individual LLM is given the responses of the other LLMs. Under the hood, the LLM identities are anonymized so that the LLM can't play favorites when judging their outputs. The LLM is asked to rank them in accuracy and insight.393. **Stage 3: Final response**. The designated Chairman of the LLM Council takes all of the model's responses and compiles them into a single final answer that is presented to the user.4041## Vibe Code Alert4243This project was 99% vibe coded as a fun Saturday hack because I wanted to explore and evaluate a number of LLMs side by side in the process of [reading books together with LLMs](https://x.com/karpathy/status/1990577951671509438). It's nice and useful to see multiple responses side by side, and also the cross-opinions of all LLMs on each other's outputs. I'm not going to support it in any way, it's provided here as is for other people's inspiration and I don't intend to improve it. Code is ephemeral now and libraries are over, ask your LLM to change it in whatever way you like.4445## Setup4647### 1. Install Dependencies4849The project uses [uv](https://docs.astral.sh/uv/) for project management.5051**Backend:**52```bash53uv sync54```5556**Frontend:**57```bash58cd frontend59npm install60cd ..61```6263### 2. Configure API Key6465Create a `.env` file in the project root:6667```bash68OPENROUTER_API_KEY=sk-or-v1-...69```7071Get your API key at [openrouter.ai](https://openrouter.ai/). Make sure to purchase the credits you need, or sign up for automatic top up.7273### 3. Configure Models (Optional)7475Edit `backend/config.py` to customize the council:7677```python78COUNCIL_MODELS = [79 "openai/gpt-5.1",80 "google/gemini-3-pro-preview",81 "anthropic/claude-sonnet-4.5",82 "x-ai/grok-4",83]8485CHAIRMAN_MODEL = "google/gemini-3-pro-preview"86```8788## Running the Application8990**Option 1: Use the start script**91```bash92./start.sh93```9495**Option 2: Run manually**9697Terminal 1 (Backend):98```bash99uv run python -m backend.main100```101102Terminal 2 (Frontend):103```bash104cd frontend105npm run dev106```107108Then open http://localhost:5173 in your browser.109110## Tech Stack111112- **Backend:** FastAPI (Python 3.10+), async httpx, OpenRouter API113- **Frontend:** React + Vite, react-markdown for rendering114- **Storage:** JSON files in `data/conversations/`115- **Package Management:** uv for Python, npm for JavaScript116
Full transparency — inspect the skill content before installing.