Skip to content

theerud/gemini-llm-council

Repository files navigation

Gemini LLM Council Extension

Consult multiple top-tier LLMs simultaneously with automated peer review and synthesis. Leverage the "Wisdom of the Crowd" to get high-confidence answers for complex architectural and debugging tasks.

Inspired by Andrej Karpathy's llm-council.

Prerequisites

Setup

  1. Link the extension:

    gemini extensions link .
  2. Configure API Key: Use the Gemini CLI to set your OpenRouter API key securely. (Note: This requires Gemini CLI v0.24.0-preview or later)

    gemini extensions config gemini-llm-council "OpenRouter API Key"

    Headless / CI Environments: If the system keychain is unavailable, you can set the API key directly in your shell.

    [!CAUTION] Security Warning: Using the GEMINI_CLI_ prefix whitelists the variable from redaction.

    1. Leakage: Secrets will appear in plaintext in logs (~/.gemini/logs/) and error traces.
    2. Lack of Isolation: These variables are global and visible to all installed Gemini extensions.
    3. Display: These secrets may be displayed in plaintext during verbose output or screen sharing.

    Only use this for ephemeral, headless environments (like CI/CD). For local development, always prefer the keychain-backed method.

    export GEMINI_CLI_OPENROUTER_API_KEY=sk-or-...
  3. Build the extension:

    npm install
    npm run build
  4. Configure Council Members: Run the setup command in your project workspace.

    /council:setup

    Note: For the best setup experience (interactive selection), this extension supports the ask_user_question tool. This tool is inspired by Claude Code's AskUserQuestion and is available in the develop branch of this Gemini CLI fork. If not available, setup will fall back to a text-based workflow.

Commands

Command Description
/council:setup Select and save your preferred models for the current workspace.
/council:ask Consult the Council on a specific query or task.
/council:status Show active council members and the configuration file path.

Usage

Workspace Isolation

Configurations are project-specific and stored in .gemini/llm-council.json within your project root. This allows you to have a "Fast & Cheap" council for one project and a "God Mode" council for another.

Ask the Council

/council:ask "What is the best way to implement a singleton in TypeScript?"

Contextual Review

The Council can review files or research topics if you ask the Chairman to do so.

/council:ask "Review src/index.ts and suggest improvements."

(The Chairman will read the file first, then pass it to the Council).

Architecture

  • Drafting Phase: Selected models provide independent answers.
  • Peer Review Phase: Models critique each other's anonymized answers.
  • Synthesis: The Gemini CLI Agent (Chairman) synthesizes the drafts and reviews into a final consensus answer, prioritizing catches made during peer review.

Inspiration

This project was inspired by Andrej Karpathy's LLM council project, as shared in his Twitter (X) post.

License

MIT

About

Multi-LLM consensus extension for Gemini CLI. Inspired by Andrej Karpathy's llm-council.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published