Two LLMs enter. One verdict leaves.
Project description
versus-llm
Two LLMs enter. One verdict leaves.
A Python CLI/TUI where two LLMs debate a question across N rounds — Agent A argues for, Agent B challenges — and then a Judge delivers a final verdict. Powered by OpenRouter, with a Rich terminal UI.
# Classic CLI mode (pass a question)
versus "Is PostgreSQL better than MongoDB?" --file schema.sql --rounds 2
# Interactive TUI mode (no question)
versus
Install
pip install versus-llm
For local development from this repository:
pip install -e .
Setup
You need your own OpenRouter API key. Get one here: https://openrouter.ai/keys
versus setup
versus login does the same thing. The key is saved locally in your user
config directory, so you do not need to create a .env file manually.
OPENROUTER_API_KEY is still supported as an environment variable, and a
.env file in the current working directory is still supported.
Usage
versus "React or Vue?"
versus "Is Rust worth learning in 2025?"
versus "Which database fits this schema?" --file schema.sql
versus "Best state manager for React?" --rounds 3 --models google/gemma-4-31b-it:free openai/gpt-oss-120b:free
versus "Is PostgreSQL better than MongoDB?" --output debate.md # save transcript
versus --version
Arguments
| Arg | Description | Default |
|---|---|---|
question |
positional; omit it to launch the interactive TUI | — |
--file |
path to a file for additional context (max 200KB) | none |
--rounds |
number of debate rounds | 2 |
--models |
two model slugs (Agent A then Agent B) | google/gemma-4-31b-it:free and openai/gpt-oss-120b:free |
--output |
save the full debate transcript as Markdown to a path | none |
--version |
print versus-llm 1.1 and exit |
— |
Commands
| Command | Description |
|---|---|
versus setup |
save your OpenRouter API key to local config |
versus login |
same as versus setup |
Note on free models: the defaults are free-tier models and can occasionally return a transient
429("rate-limited upstream") when providers are busy.versusautomatically retries up to 3 times with backoff (honoring the server'sRetry-After), so most hiccups recover on their own. If it still fails, add your own provider key in your OpenRouter settings, or swap in other models via--models, e.g.:versus "your question" --models google/gemma-4-31b-it:free openai/gpt-oss-120b:free
Interactive TUI
Run versus with no question to launch a full-screen terminal app:
- Input screen — type your question, an optional context file, and pick the number of rounds (1–5).
- Debate screen — Agent A (left, 🟠) and Agent B (right, 🔵) stream their arguments in real time, then the Judge's verdict (⚖️) appears at the bottom.
Keybindings
| Key | Action |
|---|---|
S |
Save the transcript to debate.md |
r |
Restart with a new question |
q |
Quit |
Ctrl+C |
Quit (press twice within 3s to confirm) |
How it works
- Agent A (🟠) makes the strongest case for / proposes the best solution.
- Agent B (🔵) challenges Agent A, finds flaws, proposes alternatives.
- Steps 1–2 repeat for
--roundsrounds. - The Judge (⚖️) reads the full transcript and delivers a decisive verdict.
When --file is supplied, its contents are prepended as context to the question
for both agents.
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 versus_llm-1.1.tar.gz.
File metadata
- Download URL: versus_llm-1.1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d37a57253adabfc8968a1d454a54518432934a9f5db2ec9ca79a57d71324a84a
|
|
| MD5 |
ae3a5ef318a7f59eb6d67768286724b5
|
|
| BLAKE2b-256 |
2d712e15b191dc56f123030c62ec07823a30097b00823f761e65a8e31953e4d8
|
File details
Details for the file versus_llm-1.1-py3-none-any.whl.
File metadata
- Download URL: versus_llm-1.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9172739c91786aa6eef7bf0a6d5ce887a363ad07fb400ade7494f682b4ca79c5
|
|
| MD5 |
73a91f61cb711976584bc8042ce8d85c
|
|
| BLAKE2b-256 |
1d81503a2a53e92686232610ca94025613944968e96a6710ba7c2aa3beccac77
|