SuperAPI AI Directory

router

Weave Router is a model routing proxy for agentic systems that selects the appropriate model for each API request within 50 milliseconds and is claimed to reduce costs by 40%–70% simply by changing the endpoint. It is compatible with the Anthropic, OpenAI, and Gemini APIs, supports streaming output, tool calls, and vision input, and can be used in coding tools or your own applications. Users can choose Weave's hosted routing service or self-deploy using Docker, Go 1.26+, and their own provider keys. The routing policy is based on an HMM classifier that selects from enabled models; the self-hosted version also offers an optional HMM sidecar, a dashboard, OpenTelemetry tracing, and a routing decision inspection endpoint.

Open website

About this tool

Purpose Weave Router is a proxy layer that selects a model for each API request, aimed at agentic systems. It is compatible with the Anthropic, OpenAI, and Gemini APIs, so it can be integrated into coding tools or your own applications. It is officially claimed to complete routing within 50 milliseconds and reduce costs by 40%–70% by changing the endpoint.

Key capabilities

  • Selects a model for each request from enabled models based on an HMM classifier policy.
  • Supports streaming output, tool calls, and vision input.
  • Accepts Anthropic Messages (/v1/messages), OpenAI Chat Completions (/v1/chat/completions), and Gemini requests (/v1beta/models/:action).
  • Provides POST /v1/route to inspect routing decisions without sending a request to a model.
  • The self-hosted version supports OpenTelemetry tracing and provides documentation on the dashboard, routing decision export, and session cost viewing.

Usage Hosted routing: Run the installer and configure it as prompted; Node 18 or later is required. You can obtain a routing key on the hosted settings page, or create one in the Weave dashboard under Settings → API keys. The installer configures the selected tool to use Weave; for Copilot, it adds Weave Router to the model selector, and you can also start it with copilot --model weave/auto. You can use npx @weave-os/router off --codex to switch Codex back to the original provider, on --codex to switch back to Weave, or --uninstall --codex to remove the configuration.

Self-hosting: Requires Docker, Go 1.26 or later, provider API keys, and a local code checkout. Using an OpenRouter key as an example, startup runs the router and Postgres, creates a routing key, and prompts you to configure Claude Code. The router listens on http://localhost:8080,仪表盘位于 http://localhost:8080/ui/。设置过程中会打印路由密钥(rk_...),用于客户端认证;提供商密钥单独保存在 .env.local. When no admin password is set, inference still works, but dashboard management features are disabled. Other supported tools can connect to the local router by adding --local to the installer command.

Cursor's Agent and Ask chats are processed through the router, but Cursor calls the base URL from its servers rather than from the local machine, so a localhost router is unreachable; you need to use a hosted router or a publicly accessible self-hosted URL. In Cursor, open Settings → Models, enable OpenAI API Key with an rk_... router key, set Override OpenAI Base URL to <base-url>/v1, and add a custom model named Weave Auto (the router also accepts weave-auto and rejects other weave- names). Tab completion and Apply still use Cursor's own models, and BYOK requires a paid Cursor seat.

Self-hosted HMM is an optional, stripped-down, frozen version of the policy and does not include the hosted service's training, online learning, or registry. The self-hosted stack uses hmm_embedding by default; the local compose stack starts with a local-development-only stub classifier (smoke/hmmstub) that places all turns into a single routing group; make up-hmm (also local-development-only) swaps in the real sidecar. The HMM sidecar uses a compatible embedding service, and the default configuration calls Google's embedding API. Multi-replica deployments also require Pub/Sub for cache invalidation, and Docker Compose runs an emulator locally.

Use cases Suitable for agent systems, coding tools, and custom applications that want to automatically select models per request, control costs, and unify access to multiple model providers without changing application logic.

Limitations

  • Self-hosted HMM has limited functionality and lacks the hosted service's training, online learning, and registry.
  • Local compose uses the stub classifier by default, and the real HMM sidecar is local-development-only.
  • Cursor cannot reach a localhost router; BYOK requires a paid Cursor seat.
  • Dashboard management is unavailable when no admin password is set.
  • Multi-replica deployments require additional Pub/Sub configuration.
  • Specific pricing, hosted service fees, and results are not yet provided beyond official statements.

License Released under the Apache License 2.0, Apache-2.0 starting from router-v0.24; earlier versions retain the license they had at release.