Metadata-Version: 2.4
Name: prism-proxy
Version: 1.2.1
Summary: Multi-API Intelligent Router CLI — Claude Code-level capabilities with cost-optimizing routing across every AI provider
Project-URL: Homepage, https://github.com/GoparapukethaN/prism-proxy
Project-URL: Repository, https://github.com/GoparapukethaN/prism-proxy
Project-URL: Issues, https://github.com/GoparapukethaN/prism-proxy/issues
Author: Prism Contributors
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,cli,coding-assistant,llm,router
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1.0.0,>=0.27.0
Requires-Dist: keyring>=25.0.0
Requires-Dist: litellm<2.0.0,>=1.0.0
Requires-Dist: packaging>=23.0
Requires-Dist: prompt-toolkit<4.0.0,>=3.0.0
Requires-Dist: pydantic-settings<3.0.0,>=2.0.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: rich<14.0.0,>=13.0.0
Requires-Dist: structlog>=24.0.0
Requires-Dist: typer[all]<1.0.0,>=0.9.0
Requires-Dist: unidiff>=0.7.0
Provides-Extra: all
Requires-Dist: aiohttp<4.0.0,>=3.9.0; extra == 'all'
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'all'
Requires-Dist: chromadb>=0.5.0; extra == 'all'
Requires-Dist: cryptography>=42.0.0; extra == 'all'
Requires-Dist: playwright>=1.40.0; extra == 'all'
Requires-Dist: tiktoken>=0.7.0; extra == 'all'
Requires-Dist: tree-sitter-languages>=1.10.0; extra == 'all'
Requires-Dist: tree-sitter>=0.22.0; extra == 'all'
Provides-Extra: analysis
Requires-Dist: tree-sitter-languages>=1.10.0; extra == 'analysis'
Requires-Dist: tree-sitter>=0.22.0; extra == 'analysis'
Provides-Extra: crypto
Requires-Dist: cryptography>=42.0.0; extra == 'crypto'
Provides-Extra: dev
Requires-Dist: bandit>=1.7.0; extra == 'dev'
Requires-Dist: hypothesis>=6.100.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pip-audit>=2.7.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.5.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Provides-Extra: proxy
Requires-Dist: aiohttp<4.0.0,>=3.9.0; extra == 'proxy'
Provides-Extra: rag
Requires-Dist: chromadb>=0.5.0; extra == 'rag'
Provides-Extra: tokenizer
Requires-Dist: tiktoken>=0.7.0; extra == 'tokenizer'
Provides-Extra: web
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'web'
Requires-Dist: playwright>=1.40.0; extra == 'web'
Description-Content-Type: text/markdown

# Prism Proxy

> Multi-agent AI orchestrator that makes Claude Code smarter and cheaper. Multiple AI models collaborate, debate, and cross-review to produce output better than any single model.

## What is Prism?

Prism is an Anthropic-compatible proxy that sits between Claude Code and your AI providers. Instead of one model answering alone, Prism orchestrates multiple models (GPT, Gemini, Groq, Mistral, Ollama) to work as a team -- researching, debating, reviewing each other's work, and delivering a consensus answer.

```
Claude Code (UI + tools)
       |
       v
Prism Proxy (localhost:8080)
       |
       | classifies task, orchestrates models
       v
+----------+  +----------+  +----------+  +----------+
| Gemini   |  | GPT-4o   |  | Groq     |  | Mistral  |
| researches|  | writes   |  | reviews  |  | validates|
+----------+  +----------+  +----------+  +----------+
       |           |              |             |
       +------+----+----+---------+-------------+
              |         |
         debate + cross-review
              |
       final consensus answer
              |
              v
       Claude Code executes
       (file edits, terminal, git)
```

## Why?

- **Better quality** -- multiple models catch errors, debate approaches, and cross-review. Output is better than any single model alone.
- **Lower cost** -- simple tasks go to cheap/free models. Only complex tasks use premium models.
- **Resilience** -- if one provider is down, others pick up. No single point of failure.
- **Full Claude Code experience** -- you keep all of Claude Code's tools, UI, and agentic capabilities.

## Quick Start

### 1. Install

```bash
# macOS
brew install python@3.12 node
python3.12 -m pip install --break-system-packages prism-proxy
npm install -g @anthropic-ai/claude-code
```

### 2. Add API keys (at least 2 for multi-agent)

```bash
prism auth add groq      # free: https://console.groq.com/keys
prism auth add google    # free: https://aistudio.google.com/apikey
prism auth add mistral   # free: https://console.mistral.ai/api-keys
```

### 3. Skip Claude Code login (first time only)

```bash
echo '{"hasCompletedOnboarding": true}' > ~/.claude.json
```

### 4. Start Prism (Terminal 1)

```bash
prism serve
```

### 5. Start Claude Code (Terminal 2)

```bash
ANTHROPIC_BASE_URL=http://localhost:8080 ANTHROPIC_AUTH_TOKEN=prism ANTHROPIC_API_KEY="" claude
```

Done. Claude Code now routes through Prism's multi-agent engine.

## Multi-Agent Strategies

Prism uses 5 research-backed strategies, tried in order:

| Strategy | What it does | When it's used |
|---|---|---|
| **Confidence Cascade** | Try cheap model first, escalate if confidence is low | Most requests |
| **Mixture of Agents** | Multiple models generate in parallel, best parts merged | Design, architecture |
| **Debate** | Models argue positions across rounds, synthesize consensus | Ambiguous questions |
| **Swarm** | Decompose into subtasks, assign to models, cross-review | Large multi-step tasks |
| **Parallel Consensus** | Run 2 models, pick the better answer | Fallback |

Simple tasks (quick questions) skip multi-agent and use a single cheap model for speed.

## Provider Setup

Add API keys with `prism auth add <name>`:

| Provider | Free Tier | Best For |
|---|---|---|
| Groq | Yes | Ultra-fast inference (Llama 3) |
| Google | Yes | Long context (Gemini 2.5 Pro, 1M tokens) |
| Mistral | Yes | Code generation (Codestral) |
| DeepSeek | Yes | Code + reasoning (DeepSeek-V3, R1) |
| Ollama | Local/Free | Offline, privacy-sensitive tasks |
| OpenAI | No | GPT-4o, o1 reasoning |
| Anthropic | No | Claude Opus, Sonnet |
| OpenRouter | No | Access to 100+ models |

The more providers you add, the better the multi-agent collaboration.

## Configuration

```yaml
# ~/.prism/config.yaml
multi_agent:
  enabled: true
  strategies: [cascade, moa, debate, swarm, consensus]
  debate_rounds: 2
  quality_threshold: 0.85
  budget_per_request: 0.50
  min_complexity: medium    # simple tasks skip multi-agent

budget:
  daily_limit: 5.0
  monthly_limit: 50.0

routing:
  quality_weight: 0.7
```

```bash
prism config get multi_agent.enabled
prism config set multi_agent.debate_rounds 3
```

## How It Works

1. Claude Code sends a request to Prism (thinks it's talking to Anthropic)
2. Prism classifies the task complexity (simple/medium/complex)
3. **Simple**: single cheap model responds instantly
4. **Medium/Complex**: multi-agent pipeline runs:
   - Multiple models generate responses
   - Models review and critique each other's output
   - Disagreements are debated and resolved
   - Final consensus answer is returned
5. Claude Code receives the answer and executes tools (file edits, terminal, git)
6. User sees the collaboration process in the response

## Cost Savings

| Scenario | Claude Code alone | With Prism |
|---|---|---|
| Simple question | Opus ($15/M) | Gemini Flash ($0.075/M) |
| Code review | Opus ($15/M) | Groq + Mistral ($0) |
| Complex refactor | Opus ($15/M) | Multi-agent team (~$0.50) |
| Typical session | ~$5-10 | ~$0.50-2.00 |

## Status

```bash
prism status       # check provider health
prism auth status  # check API keys
prism --version    # check version
```

## License

Apache 2.0
