llm-router
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Stop spending your Claude Pro/Max quota on questions a free model can answer.
llm-router hooks into your coding tool's own lifecycle, reads each prompt before the
model does, and drafts an answer on a free or local model first. No API keys needed
on a Claude subscription — routing runs through MCP tools and local models.
One caveat: routed answers are advisory by default — Claude still takes the
turn unless LLM_ROUTER_ZERO_CLAUDE=1 . By default some tool calls wait until a
prompt is routed; LLM_ROUTER_ENFORCE=off turns that off. Draft-rate and
acceptance figures live in docs/MEASUREMENT.md , with
their n, window and conditions.
📑 Table of Contents
- Why install this
- Quick Start
- Works With
- How It Works
- Features
- Reference
- Savings
- Trust and Security
- Documentation
- Enterprise, Contributing, License
---
Why install this
You are on a Claude Pro or Max plan, have not spent a cent beyond it, and still
hit the five-hour limit — not because you asked too much, but because *every*
prompt went to the premium model: "what does this error mean", "reformat this
JSON", "is the service up" drew the same quota as the question that needed it.
Why a proxy cannot do this
Most routers here are a **proxy**: your agent forwards requests using *your
API keys*. That has a hard limit — a proxy cannot intercept a session
authenticated by a subscription, because there is no key to forward.
| | Pays per token | Pays a subscription |
|---|---|---|
| What runs out | your invoice | your five-hour window |
| Needs API keys | yes | **no** |
| A proxy can help | yes | **no — nothing to intercept** |
| llm-router helps | yes | **yes** |
Honesty as a feature
llm-router status reports **verified** and **unverified** savings
separately, each with its own n — not a blended percentage. This project does
not publish a general savings percentage; any number depends on your own
workload. See Savings below.
---
Quick Start
Works with **no API keys** on a Claude Pro/Max subscription — routing goes
through MCP tools and local models. Adding provider keys widens the pool;
nothing requires them. See **guide/PROVIDERS.md**. To
install into another host, see Works With.
---
Works With
| Host | Install |
|------|---------|
| **Claude Code** (default) | llm-router install |
| **Codex CLI** | llm-router install --host codex |
| **OpenCode** | llm-router install --host opencode |
| **Gemini CLI** | llm-router install --host gemini-cli |
| **GitHub Copilot CLI** | llm-router install --host copilot-cli |
| **OpenClaw** | llm-router install --host openclaw |
| **Trae IDE** | llm-router install --host trae |
| **Pi (pi.dev)** | planned (v16 P2.12); --host pi reports why and exits 2 |
| **Factory Droid** | llm-router install --host factory |
| **Claude Desktop** | llm-router install --host desktop |
| **VS Code** (native MCP) | llm-router install --host vscode |
| **Cursor** | llm-router install --host cursor |
| **GitHub Copilot in VS Code** (capability extension, no cost-routing) | llm-router install --host copilot |
| **Windsurf / Cascade** | llm-router install --host windsurf |
| **Kimi Code (Moonshot AI)** | planned (v16 P2.12); --host kimi reports why and exits 2 |
llm-router install --host all installs or prints every host config in one
pass. Full per-host detail, including what each host genuinely cannot do:
**guide/HOST_SUPPORT_MATRIX.md**.
---
How It Works
Hooks intercept the prompt before your coding tool's own model sees it. A free
regex heuristic classifies it instantly, scoring about half of real prompts
with confidence — **788 of 1,571 measured** (scripts/measure_low_signal_rate.py,