Router
Model router for agentic systems. Routes every prompt to the right model in <50ms. Cut costs 40-70% with just an endpoint change.
Install
npx @weave-os/routerclaude mcp add router -- npx @weave-os/router{
"mcpServers": {
"router": {
"command": "npx",
"args": [
"@weave-os/router"
]
}
}
}Install command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →One endpoint. Every model. Always the right one.
A drop-in proxy for Anthropic, OpenAI, and Gemini that picks the best model for every request: using a tiny on-box embedder, not a vibes-based prompt.
Built by Weave: The #1 engineering intelligence platform, loved by Robinhood, PostHog, Reducto, and hundreds of others.
What it does
Point Claude Code, Codex, Cursor, or your own app at localhost:8080. The router:
- 🎯 Routes per action. A cluster scorer derived from Avengers-Pro [^1] picks the right model from your enabled providers, for every upstream API request. (See docs/SEMANTICS.md for the canonical terminology: the router routes per action, not per turn.)
- 🔌 Speaks everyone's API. Anthropic Messages, OpenAI Chat Completions, Gemini native. Streaming, tools, vision, the works.
- 🧠 Knows OSS too. DeepSeek, Kimi, GLM, Qwen, Llama, Mistral via OpenRouter (or any OpenAI-compatible endpoint).
- 🔒 BYOK by default. Provider keys stay on your box, encrypted at rest.
- 📊 Observable. OTLP traces out of the box. See them in the Weave dashboard (http://localhost:8080/ui/dashboard) or drop in Honeycomb, Datadog, Grafana, whatever.
30-second quickstart
The fastest way: point Claude Code, Codex, opencode, or pi at the hosted Weave Router with one command. No clone, no Docker, no Postgres.
npx @weave-os/router
That's it. Your browser opens the hosted setup page. To install directly from the terminal, choose a target explicitly. Other flavors:
npx @weave-os/router --claude # skip the picker, Claude Code
npx @weave-os/router --codex # skip the picker, OpenAI Codex CLI
npx @weave-os/router --opencode # skip the picker, opencode
npx @weave-os/router --pi # skip the picker, pi + Loom UI
npx @weave-os/router --scope project # per-repo, commits settings.json (or .codex/ / opencode.json)
npx @weave-os/router --local # self-hosted localhost:8080
npx @weave-os/router --base-url https://router.acme.internal
npx @weave-os/router --email you@example.com # set identity without prompting
npx @weave-os/router --claude --return-url https://app.example.com/onboarding # continue after health + key verification
npx @weave-os/router@0.1.0 # pin a version
Requires Node ≥ 18 (Claude Code, opencode, and pi paths also need jq). Full
flag reference: install/npm/README.md.
The npm package is published as @weave-os/router. The former
@workweave/router package remains available as a compatibility alias and
continues to receive the same releases.
Or: self-host the whole stack
If you want the router (and dashboard) running on your own box:
# 1. Drop a provider key in. OpenRouter is the recommended baseline.
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env.local
# 2. Set a dashboard password. Without one, inference still runs but
# dashboard administration is disabled.
echo "ROUTER_ADMIN_PASSWORD=replace-with-a-strong-password" >> .env.local
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…