Skip to main content

Multi-API Intelligent Router CLI — Claude Code-level capabilities with cost-optimizing routing across every AI provider

Project description

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

# 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)

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)

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

4. Start Prism (Terminal 1)

prism serve

5. Start Claude Code (Terminal 2)

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

# ~/.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
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

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

License

Apache 2.0

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

prism_proxy-1.0.7.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

prism_proxy-1.0.7-py3-none-any.whl (626.9 kB view details)

Uploaded Python 3

File details

Details for the file prism_proxy-1.0.7.tar.gz.

File metadata

  • Download URL: prism_proxy-1.0.7.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for prism_proxy-1.0.7.tar.gz
Algorithm Hash digest
SHA256 20e3e45e57c412f4f537afafe6ef0b6917e302ee3f4d22b5b1dc52671969d71b
MD5 2316b12eb6a91feed597d430b61f0c9d
BLAKE2b-256 1e458ba5bff5aa66310b6fee5565b6215a6cca8be9b9a38a95853a2c43fea2a9

See more details on using hashes here.

File details

Details for the file prism_proxy-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: prism_proxy-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 626.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for prism_proxy-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f8f3dbf6888fe66683c7f73cd9a95ac8628637099c163f09050e91bfdf4c25
MD5 d8d4ba12017b7c47d44675657ecb56f4
BLAKE2b-256 163b401ec286078a5675ce15ab29ccab1737c8e37593228b840a45eb9730e5c7

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