router README

The project's README from github.com/weave-os/router. As one markdown file: README.md.

Group 1(1)

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.

Weave Badge Go Tests License: ELv2 Managed deployment

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:

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. The installer asks which tool (Claude Code, Codex, opencode, or pi), walks you through scope (user vs. project), grabs a router key, and wires the right config file. 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/[email protected]                 # 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 a

router (weave-os/router)

llm-gateway
Searching Database…

5.6K ·GitHub
What is this?A drop-in proxy that routes every prompt from your coding agent or app to the best available model across Anthropic, OpenAI, Gemini, and OSS models via OpenRouter, cutting inference costs by 40-70% just by swapping the API endpoint.
Is this a library I import, or a server I point things at?It's a standalone proxy server written in Go. You point Claude Code, Codex, Cursor, or your own app at localhost:8080 (or a hosted endpoint) instead of embedding a library.
How do I get it running?The fastest path is a one-command installer that points Claude Code, Codex, opencode, or pi at the hosted Weave Router - no clone, Docker, or Postgres required. To self-host the full stack instead, drop a provider key into .env.local and run it with Docker Compose.
What do I need before installing it?The quickstart installer requires Node >=18 (plus jq for the Claude Code, opencode, and pi install paths); if you self-host instead, you need a provider API key, with OpenRouter recommended as the baseline.
What's the catch with self-hosting it myself?Self-hosting means setting up your own provider key and dashboard password; inference keeps working even without a password set, but that leaves the dashboard unprotected.
Where do my provider API keys end up?Keys stay on your own box and are encrypted at rest by default (BYOK) rather than being sent to or stored by Weave.
How does the router actually decide which model to use?A cluster scorer derived from the Avengers-Pro approach classifies each upstream API request and picks the best enabled provider for it, replacing a vibes-based prompt classifier. It routes per action, not per conversation turn.
Does it work with open-source models like DeepSeek or Qwen?Yes, it can route to DeepSeek, Kimi, GLM, Qwen, Llama, and Mistral through OpenRouter or any OpenAI-compatible endpoint, alongside Anthropic, OpenAI, and Gemini.
Can I see what requests the router is making?It emits OTLP traces out of the box, viewable in the Weave dashboard or piped into Honeycomb, Datadog, Grafana, or any other OTLP-compatible tool.
Creator
weave-os
Size
29 MB
Stars
5.6K
Updated
CommitOct 17
Age
5mo
Commits · 90 Days