weave-os /router
Model router for agentic systems. Routes every prompt to the right model in <50ms. Cut costs 40-70% with just an endpoint change.
★ 5,622⑂ 168👁 2⑃ 2,132● 74▤ 1
+0
日增长
5,622
stars
168
forks
2
watchers
2,132
prs
74
issues
1
releases
README
!Built with Weave Router Weave Router Weave Router is a proxy that selects a model for each API request. It works with Anthropic, OpenAI, and Gemini APIs, so you can use it with coding tools or your own application. You can use the hosted router or run it yourself with your own provider keys. For the best experience, use the managed router hosted by Weave. The router uses an HMM classifier policy to choose from enabled models. It supports streaming, tool calls, and vision. Get started For the hosted router, run the installer and follow the setup prompts: bash npx @weave-os/router You'll need Node 18 or later. The hosted setup page can help you get a router key; you can also create one in the Weave dashboard under Settings → API keys. To choose a tool directly, use one of these commands: bash npx @weave-os/router --claude npx @weave-os/router --codex npx @weave-os/router --copilot npx @weave-os/router --opencode npx @weave-os/router --pi The installer configures your selected tool to use Weave. For Copilot, it adds Weave Router to the model picker; you can also start it with copilot --model weave/auto. For example, to switch Codex back to its previous provider, run npx @weave-os/router off --codex. Use on --codex to switch back to Weave, or --uninstall --codex to remove the configuration. See the installation guide for what changes for each tool, project-level setup, and all available options. For client-specific setup, connection checks, switching back, and uninstall, see the Router quickstart, Claude Code guide, and Codex CLI guide. Run it yourself You'll need Docker, Go 1.26 or later, a provider API key, and a local checkout. For example, with an OpenRouter key: bash git clone https://github.com/weave-os/router.git cd router echo 'OPENROUTER_API_KEY=sk-or-v1-...' .env.local echo 'ROUTER_ADMIN_PASSWORD=replace-with-a-strong-password' .env.local make full-setup This starts the router and Postgres, creates a router key, and offers to set up Claude Code. The router listens at and the dashboard is at . The router key (rk_...) is printed during setup; use it to authenticate clients. Your provider key is separate and stays in .env.local. Without an admin password, inference still works but dashboard administration is disabled. To connect another supported tool to the local router, add --local to its installer command, for example: bash npx @weave-os/router --codex --local Cursor routes its Agent and Ask chats through the router. Cursor calls the base URL from its own servers, not from your machine, so a localhost router is unreachable: use the hosted router or a publicly reachable self-hosted URL. In Cursor, open Settings → Models, turn on OpenAI API Key with your rk_... router key, set Override OpenAI Base URL to /v1, and add a custom model named weave-auto (the router rejects other weave- names). Tab completion and Apply stay on Cursor's own models, and BYOK needs a paid Cursor seat. The self-hosted router sends prompts
Top issues
#1659make up-hmm starts the HMM sidecar but the router never uses it2 comments · 2026-10-08#1385Tool schema pattern and strict are stripped, and allowed_tools is not recognised2 comments · 2026-09-19#1466File, audio and document content parts are dropped on cross-format paths1 comments · 2026-09-25#780fix(cluster): Scorer.Route accepts non-finite and zero-norm embeddings1 comments · 2026-07-17#779fix(cluster): computeDialCalibration ignores AlphaFloor — QualityBias dial dead zone on floored bundles1 comments · 2026-07-17#564RotateAPIKey silently drops spend_cap_usd_micros on the replacement key — no API or UI path exists to restore it1 comments · 2026-07-01#1871Opt-in search API executor for Claude Code WebSearch when no provider can run it0 comments · 2026-10-28#1830compactionTracker reports a client trim whenever the user types a prompt (loop-detector window resets)0 comments · 2026-10-25
Latest release
HMM frozen model v1 hmm-model-v1 Pre-release 2026-07-13Portable frozen HMM router artifact for the companion policy sidecar. - Model: hmm-router-frozen-v1 - Embedding contract: google/gemini-embedding-2, 3072 dimensions - SHA-256: b326bda644aac86831bae47d0b69de008046f62324a4b93a1eba702581c174df - Runtime data only: no Python pickle, training rows, prompts, training provenance, or WorkWeave registry dependency This prerelease is intended for the self-hostable HMM sidecar PR. The router remains on cluster routing unless HMM is explicitly configured.