Python package for role-based LLM debates over OpenAI-compatible APIs.
Project description
council-debates
Run multiple independent LLM roles against the same prompt, optionally rank their responses, and generate a final answer through a chairman model.
council-debates is a small modular Python 3.11+ package for running debates between independent LLM roles through OpenAI-compatible APIs.
The pipeline is deliberately strict:
- Each role is called separately with only its own
system_promptand the original user prompt. - (Optional) A separate ranking LLM receives the original prompt plus all role responses.
- A final chairman LLM receives the original prompt, role responses, and the optional ranking result, then writes the final Markdown answer.
You can omit the ranking block entirely. In that case the chairman aggregates role responses without an external ranker, which prevents the ranker from biasing the chairman's decision.
The package supports OpenAI, OpenRouter, LM Studio, Ollama OpenAI-compatible endpoint, vLLM, LocalAI, and any /v1/chat/completions-compatible provider.
Pipeline
User Prompt
│
▼
┌───────────────┐
│ Role: Judge │
├───────────────┤
│ Role: Skeptic │
├───────────────┤
│ Role: Builder │
└───────────────┘
│
▼
┌────────────────────┐
│ Ranking (optional) │
└────────────────────┘
│
▼
┌────────────────────┐
│ Chairman │
└────────────────────┘
│
▼
Final Markdown Answer
Project layout
council_debates/
├── CHANGELOG.md
├── pyproject.toml
├── README.md
├── config.example.yaml
├── .env.example
├── requirements-dev.txt
├── tests/
└── src/
└── council_debates/
├── __init__.py
├── __main__.py
├── cli.py
├── core/
├── pipeline/
├── presentation/
├── providers/
└── templates.py
Install
Install the latest released version from PyPI:
pip install council-debates
Upgrade an existing installation:
pip install --upgrade council-debates
PyPI package:
Install the latest code directly from GitHub:
pip install "git+https://github.com/ssh-den/council-debates.git"
Install a specific branch, tag, or commit:
pip install "git+https://github.com/ssh-den/council-debates.git@main"
For local development and tests from the repository:
python -m venv .venv
. .venv/bin/activate
pip install -r requirements-dev.txt
Quality checks:
black --check .
ruff check .
mypy src tests
pylint src tests
pytest
Create a config
council-debates init-config
council-debates init-env
cp .env.example .env
Edit config.example.yaml or save it as config.yaml. Set the environment variables referenced by api_key_env.
Run
Prompt from the command line:
council-debates run "Suppose that a judge or magistrate..." --config config.yaml
Prompt from a file:
council-debates run --file prompt.txt --config config.yaml
Save Markdown output:
council-debates run "test prompt" --config config.yaml --output result.md
Show provider/model logging:
council-debates run "test prompt" --config config.yaml --verbose
Configuration
All behavior is configured in YAML:
providers: OpenAI-compatible base URLs and API keys orapi_key_envreferences.defaults: defaulttemperatureandmax_tokens.roles: independent debate roles; each role has its own provider, model, and system prompt.ranking: (optional) separate ranking model config. Omit it if you want the chairman to aggregate responses without external ranking.chairman: final aggregation model config.output: Markdown output options.
Example provider entries:
providers:
openai:
base_url: "https://api.openai.com/v1"
api_key_env: "OPENAI_API_KEY"
openrouter:
base_url: "https://openrouter.ai/api/v1"
api_key_env: "OPENROUTER_API_KEY"
local:
base_url: "http://localhost:11434/v1"
api_key: "ollama"
Local OpenAI-compatible servers usually accept any non-empty API key.
Design Principle
Roles never see each other's responses.
Each role receives only:
- its own system prompt
- the original user prompt
This prevents early consensus, role contamination, and chain-of-thought leakage between participants.
Contributions / Acknowledgments
The original idea of using multiple LLM roles in a council/debate setup comes from Andrej Karpathy's llm-council.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file council_debates-0.1.0.tar.gz.
File metadata
- Download URL: council_debates-0.1.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40fb897cc18b61f9721188383350c0f0cf237163d375cf280154ba69b764dded
|
|
| MD5 |
5aa6256573d2d5db61a5c84a9e81ea74
|
|
| BLAKE2b-256 |
3c868cd34d2b0a1aa4fb802ba307d91f90d779479c1fa2d574a6456ee8906e5e
|
Provenance
The following attestation bundles were made for council_debates-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on ssh-den/council-debates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
council_debates-0.1.0.tar.gz -
Subject digest:
40fb897cc18b61f9721188383350c0f0cf237163d375cf280154ba69b764dded - Sigstore transparency entry: 1819288530
- Sigstore integration time:
-
Permalink:
ssh-den/council-debates@2e2affbd1e6fd418a87505e798dce9b9a4258150 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ssh-den
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2e2affbd1e6fd418a87505e798dce9b9a4258150 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file council_debates-0.1.0-py3-none-any.whl.
File metadata
- Download URL: council_debates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
902e1ad5974bb29d7a1edabe6a39045e74ac2a72a655f558a366b649dadc6dd4
|
|
| MD5 |
58013bd3012b6affd1cb7947c40f9216
|
|
| BLAKE2b-256 |
421a8825df6578096126161eebba52fafd6d6101ed818cbd2442ea5288e2f9a5
|
Provenance
The following attestation bundles were made for council_debates-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ssh-den/council-debates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
council_debates-0.1.0-py3-none-any.whl -
Subject digest:
902e1ad5974bb29d7a1edabe6a39045e74ac2a72a655f558a366b649dadc6dd4 - Sigstore transparency entry: 1819288771
- Sigstore integration time:
-
Permalink:
ssh-den/council-debates@2e2affbd1e6fd418a87505e798dce9b9a4258150 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ssh-den
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2e2affbd1e6fd418a87505e798dce9b9a4258150 -
Trigger Event:
workflow_dispatch
-
Statement type: