Back to browse
GitHub Repository

Self-hosted LLM router. Cost effective, deterministic, and fast. Secure and private by default.

24 starsRust

Millwright – Rust-based, self-hosted LLM router

by AndrewLiu96·Jul 22, 2026·4 points·2 comments

AI Analysis

●●SolidSolve My ProblemNiche Gem

Cache affinity lanes prevent serializing concurrent agent traffic unlike Vercel's gateway.

Strengths
  • Role-scoped session lanes keep concurrent agents moving without blocking each other.
  • Wire-protocol translation handles OpenAI and Anthropic formats without app code changes.
  • Built-in cost analysis models candidate economics before routing decisions are made.
Weaknesses
  • No Windows support limits adoption for mixed-OS engineering teams right now.
  • Lacks a visual dashboard for spend tracking, requiring CLI or log parsing.
Target Audience

Engineering teams running high-volume AI workloads

Similar To

OpenRouter · LiteLLM · Vercel AI Gateway

Post Description

Hey HN,

With the news of OpenRouter possibly being acquired and proliferation of hosted LLM routers (i.e. Ramp Router, Vercel’s AI Gateway), I saw the need for a self hosted solution focused on cost savings, transparency, and performance. So, I built an open sourced router with a simple CLI interface that can easily sit between coding agents and GenAI workloads.

For the curious and lazy, at the moment, Millwright has the tools for,

- Providers: OpenAI-compatible APIs, Anthropic, Amazon Bedrock

- Routing: policy-controlled model roles (cheap, mid, frontier), cheapest healthy route selection

- Protocols: OpenAI Chat Completions, Anthropic Messages, text and tool translation

- Cache Affinity: role-scoped session lanes without serializing concurrent agent traffic

- Spend Tracking: per-team costs, cache usage, model/provider mix, request traces

- Cost Analysis: measured usage and modeled candidate economics (HTML, Markdown, JSON)

- Reliability: bounded failover, circuit breakers, timeouts, concurrency limits

- Setup: interactive provider, model, and pricing configuration without storing provider secrets

- Deployment: one Rust binary, Docker, SQLite or PostgreSQL

Full disclosure: parts of the codebase were built with AI coding agents. All feedback is welcome, I’d especially value feedback on the routing policy, provider coverage, and anything that would block you from self-hosting it. Feel free to open feature/request and/or contribute as well.

Similar Projects