{"name":"Router: Optimize AI Model Selection and Costs for Agentic Systems","description":"The Weave-OS Router is an intelligent model router for agentic systems, optimizing AI model selection for every request. It acts as a drop-in proxy for major AI providers, routing prompts to the most suitable model in under 50ms. This solution helps users significantly cut costs, often by 40-70%, simply by changing an endpoint.","github":"https://github.com/weave-os/router","url":"https://osrepos.com/repo/weave-os-router","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/weave-os-router","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/weave-os-router.md","json":"https://osrepos.com/repo/weave-os-router.json","topics":["Go","AI","Agentic Systems","Model Router","AI Gateway","OpenAI Compatible","Anthropic","Development Tools"],"keywords":["Go","AI","Agentic Systems","Model Router","AI Gateway","OpenAI Compatible","Anthropic","Development Tools"],"stars":null,"summary":"The Weave-OS Router is an intelligent model router for agentic systems, optimizing AI model selection for every request. It acts as a drop-in proxy for major AI providers, routing prompts to the most suitable model in under 50ms. This solution helps users significantly cut costs, often by 40-70%, simply by changing an endpoint.","content":"## Introduction\n\nThe `weave-os/router` is an innovative open-source project designed to revolutionize how agentic systems interact with large language models (LLMs). Acting as a smart proxy, it intelligently routes every prompt to the most appropriate AI model, ensuring optimal performance and significant cost reductions. With a single endpoint change, users can achieve 40-70% cost savings while leveraging the best models from providers like Anthropic, OpenAI, and Gemini. This project, written in Go, has garnered significant attention, boasting over 5,300 stars on GitHub.\n\n## Why Use It and Key Benefits\n\nThe Weave-OS Router offers a compelling set of features that make it an essential tool for developers building agentic AI applications:\n\n*   ? **Routes per action**: An advanced cluster scorer, derived from research like Avengers-Pro, picks the right model from your enabled providers for every upstream API request. This ensures that each action within your agentic system is handled by the most suitable LLM.\n*   ? **Speaks everyone's API**: It supports a wide range of API formats, including Anthropic Messages, OpenAI Chat Completions, and Gemini native, along with features like streaming, tools, and vision capabilities.\n*   ? **Knows OSS too**: Beyond commercial providers, the router integrates with open-source models such as DeepSeek, Kimi, GLM, Qwen, Llama, and Mistral via OpenRouter or any OpenAI-compatible endpoint.\n*   ? **BYOK by default**: Provider keys remain on your local machine, encrypted at rest, ensuring enhanced security and control over your credentials.\n*   ? **Observable**: Out-of-the-box OTLP traces provide deep observability, allowing you to monitor routing decisions and integrate with dashboards like Weave, Honeycomb, Datadog, or Grafana.\n\n## Installation\n\nGetting started with the Weave-OS Router is quick and straightforward.\n\n### 30-second Quickstart (Hosted)\n\nThe fastest way to use the hosted Weave Router is with `npx`:\n\nbash\nnpx @weave-os/router\n\n\nThis command opens the hosted setup page in your browser. You can also choose a target explicitly:\n\nbash\nnpx @weave-os/router --claude              # skip the picker, Claude Code\nnpx @weave-os/router --local               # self-hosted localhost:8080\n\n\nRequires Node ? 18. For a full flag reference, see the [install/npm/README.md](https://github.com/weave-os/router/blob/main/install/npm/README.md){:target=\"_blank\"} file.\n\n### Self-host the Whole Stack\n\nFor a self-hosted solution running the router and dashboard on your own machine:\n\n1.  **Drop a provider key in.** OpenRouter is recommended as a baseline.\n    bash\n    echo \"OPENROUTER_API_KEY=sk-or-v1-...\" >> .env.local\n    \n2.  **Set a dashboard password.**\n    bash\n    echo \"ROUTER_ADMIN_PASSWORD=replace-with-a-strong-password\" >> .env.local\n    \n3.  **Boot Postgres + router on :8080 and seed an rk_ key.**\n    bash\n    make full-setup\n    \n\nThe router will be accessible at `http://localhost:8080` and the dashboard at `http://localhost:8080/ui/`.\n\n## Examples\n\nOnce the router is running, you can interact with it using standard API calls:\n\n### Call it like Anthropic\n\nbash\ncurl -sS http://localhost:8080/v1/messages \\\n  -H \"Authorization: Bearer rk_...\" \\\n  -d '{\"model\":\"claude-sonnet-4-5\",\"max_tokens\":256,\n       \"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'\n\n\n### Or like OpenAI\n\nbash\ncurl -sS http://localhost:8080/v1/chat/completions \\\n  -H \"Authorization: Bearer rk_...\" \\\n  -d '{\"model\":\"gpt-4o-mini\",\n       \"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'\n\n\n### Peek at the routing decision without proxying\n\nbash\ncurl -sS http://localhost:8080/v1/route -H \"Authorization: Bearer rk_...\" -d '...'\n\n\n## Links\n\nFor more detailed information, documentation, and to contribute to the project, please visit the official resources:\n\n*   **GitHub Repository**: [https://github.com/weave-os/router](https://github.com/weave-os/router){:target=\"_blank\"}\n*   **Official Website**: [https://www.workweave.ai](https://www.workweave.ai){:target=\"_blank\"}\n*   **License**: [Apache License 2.0](https://github.com/weave-os/router/blob/main/LICENSE){:target=\"_blank\"}\n*   **Configuration Reference**: [docs/CONFIGURATION.md](https://github.com/weave-os/router/blob/main/docs/CONFIGURATION.md){:target=\"_blank\"}\n*   **Semantics and Terminology**: [docs/SEMANTICS.md](https://github.com/weave-os/router/blob/main/docs/SEMANTICS.md){:target=\"_blank\"}\n*   **Analytics Export**: [docs/ANALYTICS_EXPORT.md](https://github.com/weave-os/router/blob/main/docs/ANALYTICS_EXPORT.md){:target=\"_blank\"}\n*   **Contributing Guide**: [CONTRIBUTING.md](https://github.com/weave-os/router/blob/main/CONTRIBUTING.md){:target=\"_blank\"}","metrics":{"detailViews":0,"githubClicks":0},"dates":{"published":null,"modified":"2026-09-28T07:54:27.000Z"}}