Skip to main content

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 meta-llama/llama-3.3-70b-instruct: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 meta-llama/llama-3.3-70b-instruct:free
--output save the full debate transcript as Markdown to a path none
--version print versus-llm 1.0.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. versus automatically retries up to 3 times with backoff (honoring the server's Retry-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-2-9b-it:free meta-llama/llama-3.3-70b-instruct:free

Interactive TUI

Run versus with no question to launch a full-screen terminal app:

  1. Input screen — type your question, an optional context file, and pick the number of rounds (1–5).
  2. 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

  1. Agent A (🟠) makes the strongest case for / proposes the best solution.
  2. Agent B (🔵) challenges Agent A, finds flaws, proposes alternatives.
  3. Steps 1–2 repeat for --rounds rounds.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

versus_llm-1.0.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

versus_llm-1.0.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file versus_llm-1.0.1.tar.gz.

File metadata

  • Download URL: versus_llm-1.0.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

Hashes for versus_llm-1.0.1.tar.gz
Algorithm Hash digest
SHA256 24dda4289f3ff2ef788183222f3bfb17f38ff0df48a5b3eab002be79b1537b97
MD5 ddbd27bf29a6a61996ae7b30bd93e2e4
BLAKE2b-256 05a35b8e63ef65de23f2e1bf820b396fe6deee2f41b0dc975aef01da1e4a3d38

See more details on using hashes here.

File details

Details for the file versus_llm-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: versus_llm-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for versus_llm-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1928e5480f667f750b7d9607a6c8796fb57b1d733c22e81c6aa47c998ca3e860
MD5 86439ff3fdac5c353df0cf47172c32e4
BLAKE2b-256 dd234c272621e848d8f0bf02b79746f2beaad15c0649fd257b70ef2a4aca44f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page