Metadata-Version: 2.4
Name: magi-consensus
Version: 0.1.0
Summary: MAGI — a three-model consensus CLI (Claude, Gemini, ChatGPT), styled after Evangelion's MAGI system
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.40
Requires-Dist: google-genai>=1.0
Requires-Dist: openai>=1.50
Requires-Dist: pydantic>=2.7
Requires-Dist: pyfiglet>=1.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rich>=13.7
Requires-Dist: typer>=0.12
Description-Content-Type: text/markdown

# MAGI

A CLI that puts a decision to a vote across three LLMs — Claude, Gemini, and ChatGPT — styled after the MAGI supercomputer system from *Neon Genesis Evangelion*. Each model is one independent unit (Melchior-1 / Balthasar-2 / Casper-3); a verdict requires a 2-of-3 majority, or the system reports a deadlock.

## Install

```bash
git clone <your-repo-url>
cd magi
python -m venv .venv && source .venv/bin/activate
pip install -e .
```

Or, once published to PyPI:

```bash
pipx install magi-cli
```

## Configure

Copy `.env.example` to `.env` and add your API keys:

```bash
cp .env.example .env
```

```
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
OPENAI_API_KEY=sk-...
```

## Usage

```bash
magi decide "Should we migrate the pipeline to Rust?"

magi decide "Rust or Go for the new service?" --options Rust,Go

magi units          # show which model is wired to which unit
```

Running `decide` boots the system (an ASCII "MAGI" banner + a per-unit ONLINE handshake), then shows a live hexagonal diagram — Balthasar on top, Casper and Melchior below, all converging on a central MAGI hub — with each node pulsing and spinning while its model is actually thinking. Once resolved, it reveals each unit's full vote with reasoning, then a final verdict panel — **CONDITION GREEN** for a clear 2/3 majority, **CONDITION RED** for a deadlock. The hex diagram needs at least ~70 terminal columns; narrower terminals automatically fall back to a plain vertical list.

Pass `--plain` (or set `NO_COLOR=1` / `MAGI_PLAIN=1`) to strip all of that down to plain text — for scripts, CI, or anyone who just wants the answer.

## Notes

- **Model IDs move fast.** The defaults in `src/magi/config.py` (`claude-sonnet-5`, `gemini-3.1-pro-preview`, `gpt-5.6-sol`) were current as of August 2026. If a call fails with a "model not found" error, check each provider's current model list and override via `MAGI_CLAUDE_MODEL` / `MAGI_GEMINI_MODEL` / `MAGI_OPENAI_MODEL` env vars, or edit `config.py` directly.
- **Reassign units** by editing the `UNITS` tuple in `config.py` — swap which provider sits behind Melchior/Balthasar/Casper, or add a fourth/fifth unit (the tally logic generalizes; the "2-of-3" framing in `render_verdict` is the only MAGI-specific part).
- **Publishing to PyPI**: `pip install build twine && python -m build && twine upload dist/*` — see the project's earlier chat thread for the full walkthrough.

## License

MIT
