StackMap
Subscribe

LLMRouter vs router

UIUC's LLM routing library: 16+ trainable routers (KNN, MLP, matrix factorisation, Elo, graph, BERT) pick the best model per query, with xRouteBench and a train/serve CLI. — versus — Weave's Go model router: drop-in proxy speaking Anthropic, OpenAI and Gemini APIs that scores each request with an on-box ONNX embedder (Avengers-Pro clusters) and routes to the cheapest fit model.

The curated verdict

Both pick a model per prompt from learned routers; llmrouter is a UIUC research library with 16+ trainable routers, weave router is a deployable proxy with one frozen cluster scorer and an optional HMM policy.

LLMRouterrouter
Stars2.8k4.2k
Forks302116
LanguagePythonGo
LicenseMITNOASSERTION
Last activity2 days agoyesterday
Topicsgateway, traininggateway
Curated connections45

LLMRouter — the curator's take

Reach for LLMRouter when you have many models behind one API and want a *learned* policy deciding which one answers — by task complexity, cost and quality — rather than a hand-written fallback chain. It's a research library from the xRouteBench paper: you train a router on your own traffic (there's a data-generation pipeline over 11 benchmarks), then serve it. NOT a gateway — it doesn't call providers, hold keys or retry; put it in front of LiteLLM or a proxy. And NOT for a two-model setup: below a handful of candidates a rule beats a trained router.

router — the curator's take

Choose it when the goal is *smart* routing, not just multi-provider fan-out: an in-process embedder classifies each action and picks a model per request in under 50ms, with a `/v1/route` endpoint to inspect the decision and OTLP traces out of the box. `npx @weave-os/router` wires Claude Code, Codex, opencode or pi in one step; self-hosting needs Postgres (and Pub/Sub for multi-replica). Don't reach for it if you want a plain gateway (litellm), free-tier pooling (omniroute), or to route through subscription CLIs (cliproxyapi) — and note the Elastic License v2, which is not OSI open source, and that the frictionless quickstart is the hosted service.