router
Model router for agentic systems. Routes every prompt to the right model in <50ms. Cut costs 40-70% with just an endpoint change.
Router is a model routing AI sub-agent that automatically selects the optimal large language model for every prompt in under 50ms, reducing costs by 40-70%. It acts as a drop-in proxy that speaks Anthropic Messages, OpenAI Chat Completions, and Gemini APIs, using an on-box embedder and cluster scorer to route requests across providers including Claude, GPT, Gemini, DeepSeek, and OSS models via OpenRouter. The router integrates seamlessly with Claude Code, Codex, Cursor, opencode, and pi, preserving your BYOK credentials locally with encrypted at-rest storage and full OTLP observability.
Key Features
Use Cases
- 01Reducing LLM costs in production by 40-70% through automatic selection of the most cost-effective capable model
- 02Building multi-model agentic systems that leverage different providers' strengths per task type
- 03Consolidating Claude, GPT, Gemini, and OSS model access through a single endpoint with unified observability
- 04Enabling Claude Code or Cursor users to automatically route between providers without manual model switching
- 05Self-hosting model routing infrastructure with full control over credentials and routing policies
- 06Analyzing routing decisions and usage patterns through exported analytics and OTLP traces
Related Agents
View morehermes-agent
The agent that grows with you
agency-agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.
openinterpreter
A coding agent for open models like Kimi K3
cline
Autonomous coding agent as an SDK, IDE extension, or CLI assistant.
router — FAQ
What is router and what does it do?+
Router is a model routing proxy that automatically selects the best LLM (Claude, GPT, Gemini, DeepSeek, etc.) for every API request using an on-box embedder and cluster scorer. It reduces costs by 40-70% while maintaining API compatibility with Anthropic, OpenAI, and Gemini formats.
How do I install router?+
For hosted deployment, run 'npx @workweave/router' and follow the installer prompts. For self-hosted, add provider keys to .env.local and run 'make full-setup' to start Postgres and the router on port 8080 with a generated rk_ key.
Which AI clients work with router?+
Router integrates with Claude Code, OpenAI Codex CLI, opencode, pi, and Cursor. It also works with any application using Anthropic Messages, OpenAI Chat Completions, or Gemini APIs by pointing the base URL to the router endpoint.
What API keys or prerequisites are needed?+
You need at least one provider API key (OpenRouter recommended as baseline, or Anthropic/OpenAI/Google keys). For self-hosted deployment, Docker and Docker Compose are required. Node ≥18 is needed for the NPX installer, and jq is required for Claude Code/opencode/pi installation paths.
Is router free and open source?+
Router is available under the Elastic License v2 (ELv2). The hosted managed deployment at router.workweave.ai is available, and you can also self-host the entire stack on your own infrastructure.
How does router decide which model to use?+
Router uses a cluster scorer derived from Avengers-Pro research that embeds each action and picks the optimal model from your enabled providers in under 50ms. An optional frozen HMM policy sidecar provides advanced routing strategies when configured.
How do I install router?+
Open the source repository on GitHub and follow its README. router is a agent — MCP Agents Market links you directly to the official repo.
Is router free?+
router is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.