Router: Optimize AI Model Selection and Costs for Agentic Systems

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Router: Optimize AI Model Selection and Costs for Agentic Systems

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.

Repository Information

Analyzed by OSRepos on September 28, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

The 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.

Why Use It and Key Benefits

The Weave-OS Router offers a compelling set of features that make it an essential tool for developers building agentic AI applications:

  • ? 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.
  • ? 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.
  • ? 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.
  • ? BYOK by default: Provider keys remain on your local machine, encrypted at rest, ensuring enhanced security and control over your credentials.
  • ? 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.

Installation

Getting started with the Weave-OS Router is quick and straightforward.

30-second Quickstart (Hosted)

The fastest way to use the hosted Weave Router is with npx:

npx @weave-os/router

This command opens the hosted setup page in your browser. You can also choose a target explicitly:

npx @weave-os/router --claude              # skip the picker, Claude Code
npx @weave-os/router --local               # self-hosted localhost:8080

Requires Node ? 18. For a full flag reference, see the install/npm/README.md file.

Self-host the Whole Stack

For a self-hosted solution running the router and dashboard on your own machine:

  1. Drop a provider key in. OpenRouter is recommended as a baseline.

    echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env.local
    
  2. Set a dashboard password.

    echo "ROUTER_ADMIN_PASSWORD=replace-with-a-strong-password" >> .env.local
    
  3. Boot Postgres + router on :8080 and seed an rk_ key.

    make full-setup
    

The router will be accessible at http://localhost:8080 and the dashboard at http://localhost:8080/ui/.

Examples

Once the router is running, you can interact with it using standard API calls:

Call it like Anthropic

curl -sS http://localhost:8080/v1/messages \
  -H "Authorization: Bearer rk_..." \
  -d '{"model":"claude-sonnet-4-5","max_tokens":256,
       "messages":[{"role":"user","content":"hi"}]}'

Or like OpenAI

curl -sS http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer rk_..." \
  -d '{"model":"gpt-4o-mini",
       "messages":[{"role":"user","content":"hi"}]}'

Peek at the routing decision without proxying

curl -sS http://localhost:8080/v1/route -H "Authorization: Bearer rk_..." -d '...'

Links

For more detailed information, documentation, and to contribute to the project, please visit the official resources:

Related repositories

Similar repositories that may be relevant next.

Memoh: An Open-Source Multi-Agent Platform with Dedicated AI Workspaces

Memoh: An Open-Source Multi-Agent Platform with Dedicated AI Workspaces

September 26, 2026

Memoh is an innovative open-source multi-agent platform designed to provide each AI agent with its own dedicated cloud computer. This includes a filesystem, desktop, browser, network, and persistent long-term memory, ensuring agents remain online 24/7. Users can integrate their own API keys or host existing AI models, fostering a versatile and always-on environment for AI development and deployment.

agentaiai-companion
llm-d Router: Intelligent Orchestration for Multi-Phase LLM Inference

llm-d Router: Intelligent Orchestration for Multi-Phase LLM Inference

September 25, 2026

The `llm-d-router` is a sophisticated Go service designed as an intelligent entry point for large language model (LLM) inference requests. It orchestrates complex, multi-phase LLM inference pipelines across specialized worker pools, routing requests through an Inference Gateway to disaggregated vLLM workers. By exposing OpenAI-compatible APIs, it simplifies integration and leverages Kubernetes for scalable, efficient deployments.

aigateway-apiinference
Inference Gateway: Unifying LLM Providers with a High-Performance API

Inference Gateway: Unifying LLM Providers with a High-Performance API

September 25, 2026

Inference Gateway is an open-source, cloud-native, high-performance proxy server designed to unify access to various language model APIs. It provides a single OpenAI-compatible endpoint, simplifying interactions with multiple LLM providers, from local solutions like Ollama to major cloud platforms. This gateway enables seamless integration and management of diverse AI models, enhancing portability and data privacy.

LLM GatewayOpenAI API ProxyCloud-Native AI
Agent Orchestrator: Supervise Teams of Coding Agents from Planning to Merge

Agent Orchestrator: Supervise Teams of Coding Agents from Planning to Merge

September 23, 2026

Agent Orchestrator is a powerful tool designed to run and supervise teams of coding agents throughout the entire development lifecycle, from initial planning to code merge. It supports a wide array of agent harnesses, including Claude Code and Codex, and operates across desktop, web, mobile, and cloud environments. This platform offers a unified workspace to manage and coordinate multiple agents, ensuring efficient and organized agent-driven development.

agent-orchestrationmulti-agentAI

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️