← Back to Leaderboard
Rweave-os

weave-os/router

Go API gateway for per-request model selection across LLM providers

Engineering Health (Methodology)
A · 79/100
Maintenance Activity
● Updated today
Latest Release
Rolling commits (main)
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption13/25
Release Cadence11/20
License Clarity20/20
DockerSelf-HostedAPICLI
Total Stars
★ 5,695
24h Growth
+14
7d Growth
+79
Forks
197

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

weave-os/router Star History (2026-05-14 - 2026-12-04) ALL-TIME STAR HISTORY (2026-05 – 2026-12) +5.7k in 204d · avg +28/day 6k 3k 0 2026-05-14: ★ 12026-05-30: ★ 242026-06-13: ★ 282026-06-27: ★ 4792026-07-11: ★ 8232026-07-25: ★ 8632026-08-08: ★ 9322026-08-22: ★ 9552026-09-05: ★ 3,8232026-09-19: ★ 4,4062026-10-03: ★ 5,4532026-10-17: ★ 5,5272026-10-31: ★ 5,5692026-11-13: ★ 5,5992026-11-26: ★ 5,6152026-12-04: ★ 5,695 ★ 5.7k 2026-05 2026-08 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Weave Router is a Go API gateway, not a model-serving runtime. It authenticates clients with rk_ bearer keys, calls a separate HMM policy sidecar to classify each turn, then selects an enabled model and forwards the request using an environment-provided or BYOK provider key. The sidecar depends on a compatible embedding service and defaults to Google's embedding API.

PostgreSQL holds installation records, router keys, encrypted BYOK credentials and usage data; it also backs the self-hosted dashboard at /ui. The Go manifest includes Gin, pgx/v5, Tink and Google Cloud Pub/Sub v2. Multiple replicas need Pub/Sub for cache invalidation, and an optional OTLP collector receives traces and usage logs. Client protocol entrypoints and configurable model endpoints are the main integration boundaries.

Key Capabilities & Differentiators

The router exposes Anthropic Messages at /v1/messages, OpenAI Chat Completions at /v1/chat/completions, and Gemini requests at /v1beta/models/:action. Upstreams include Anthropic, OpenAI, Gemini, OpenRouter and OpenAI-compatible endpoints. Streaming, tool calls and vision are supported, but test the exact client and upstream pair before assuming feature parity or broader API compatibility.

POST /v1/route lets you inspect the policy's choice without dispatching a generation request. Usage reporting, routing-decision exports and session cost tracking support a rollout against a direct-provider baseline. The installer covers Claude Code, Codex, Copilot, opencode and pi, with --local available for local setup. Cursor's override applies to Agent and Ask, not Tab completion or Apply; it needs a paid BYOK seat and a URL reachable from Cursor's servers.

Trade-offs & Limitations

Compared with calling OpenAI directly, Weave centralizes model choice and usage tracking across providers, but adds a proxy hop, policy classification and a database to operate. With a remote embedding service, routing also depends on another network call. If one provider and a static model policy suffice, direct integration has fewer moving parts. For a multi-provider rollout, compare end-to-end latency, cost and task success with your direct baseline rather than using routing-only timing or headline savings as deployment targets.

The self-hosted policy is frozen and lacks the managed service's training, online learning and registry. The Compose stub sends every turn to one routing group, so it validates plumbing, not selection quality. Apache-2.0 covers the router code, not upstream API access. Self-hosting puts router configuration and usage records under your control, but your providers still process generation requests, and Google supplies embeddings by default.

Hardware & Deployment Guide

The local bootstrap uses Docker, a checkout, Go 1.26 or later and an upstream API key; go.mod specifies Go 1.26.0 and toolchain go1.26.10. make full-setup starts the router and PostgreSQL and creates a router key. The development Compose stack applies migrations but uses default credentials and a single PostgreSQL instance with no resource limits. Keep it on localhost. Dashboard administration requires ROUTER_ADMIN_PASSWORD; requests can still be routed without it.

The default hmm_embedding policy needs a sidecar to boot. Compose supplies a smoke stub; make up-hmm swaps in the real sidecar for local development, not production. The hmm-model-v1 release packages hmm-router-frozen-v1 as a portable frozen policy artifact, with a published SHA-256 and a google/gemini-embedding-2 contract of 3,072 dimensions. Hosted client setup through npx @weave-os/router requires Node 18 or later. Self-hosting does not make the default stack offline: generation and embedding calls still leave it.

Protocol coverage: Anthropic Messages, OpenAI Chat Completions and Gemini request endpoints, with streaming, tool calls and vision support.
Policy isolation: An embedding-based HMM sidecar classifies each turn; the local smoke-test stub assigns every turn to one group.
Decision inspection: POST /v1/route reports which model would be selected without sending a generation request to that model.
Credential separation: Clients use rk_ bearer keys; PostgreSQL tracks installations, usage and encrypted BYOK provider keys.
Operational dependencies: Optional OTLP export, a self-hosted dashboard at /ui and Pub/Sub cache invalidation for multiple replicas.
Portable policy artifact: hmm-router-frozen-v1 requires 3,072-dimensional google/gemini-embedding-2 embeddings and ships without Python pickle or training rows.
Best For

Teams running coding agents or applications across several model providers that want shared routing, separate provider credentials and centralized usage tracking, and can validate the policy on their own traffic.

Skip If

One provider and a fixed model already meet your needs, you need offline inference out of the box, or you expect the self-hosted policy to learn online like the managed service.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedAPICLI
npx @weave-os/router

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
router ★5.7k+79GoApache-2.0Go API gateway for per-request model selection across LLM providers
OmniRoute92.1k+1.5kTypeScriptMITSelf-hosted OpenAI-compatible gateway for multi-provider routing and fallback
gpt-load7.2k+6GoMITSelf-hosted Go gateway for routing LLM traffic across providers and credentials
bifrost10.2k+125GoApache-2.0Self-hosted Go gateway for routing and governing multi-provider LLM traffic

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/weave-os/router.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

weave-os/router Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about router

How do I connect an existing client and test routing without invoking a generation model?

Point a supported client at the router's matching API endpoint and authenticate with an rk_ bearer key. Upstream credentials are separate and come from environment configuration or BYOK. Use POST /v1/route to inspect the routing decision without generating a response from the selected model; the HMM policy can still call its embedding service.

Does self-hosting require a GPU, and what should I size for?

No local model GPU or VRAM requirement is specified for the documented configuration: providers handle generation, and the default HMM sidecar uses Google's embedding API. Size the Go proxy, sidecar and PostgreSQL for concurrent streams and database activity. Measure CPU, memory, connections and end-to-end latency under your own traffic; the stub does not capture real embedding overhead.

Can I self-host commercially, and does that keep prompts on my infrastructure?

The router code is Apache-2.0, which permits commercial use subject to its terms. Review LICENSE, NOTICE and THIRD_PARTY.md before redistribution. Self-hosting does not change upstream provider terms or keep prompts on-premises: generation requests go to your selected provider, and the default embedding configuration uses Google's API.

When is Weave Router preferable to calling the OpenAI API directly?

Use OpenAI's API directly if one provider meets your needs and the application already controls model selection. Use Weave Router if you want a shared model-selection policy across configured upstreams or need entrypoints for multiple provider API formats. It adds a policy sidecar, PostgreSQL and an extra request hop; OpenAI Chat Completions compatibility does not imply coverage of every OpenAI API.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining weave-os/router? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature weave-os/router on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare