Millwright is a self-hosted LLM router written in Rust that routes requests to the cheapest healthy model based on policy, while preserving prompt-cache affinity per session.

Stars

44

7-day growth

No data

Forks

0

Open issues

0

License

Apache-2.0

Last updated

2026-07-25

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It combines policy-driven cost control, cache-aware concurrency, and built-in spend analysis in a single Rust binary, making it easy to self-host and inspect routing decisions without a hosted control plane.

Who it is for

  • Developers building AI applications that consume LLM APIs
  • Engineering teams looking to manage and reduce LLM spend across multiple providers
  • Infrastructure operators who want to keep provider credentials on their own infrastructure
  • Organizations that need auditability and cost analysis for LLM usage

Use cases

  • Route cheap tasks to low-cost models while reserving frontier models for complex or high-risk requests
  • Maintain prompt-cache reuse by keeping the same session on the same provider and model
  • Switch LLM providers (e.g., OpenAI to Anthropic) without changing application code
  • Analyze historical spend and simulate cost savings with different routing policies

Strengths

  • Single self-contained Rust binary with Docker support, no external dependencies beyond a store
  • Policy engine classifies requests into cheap/mid/frontier roles and selects lowest-cost healthy route
  • Cache-aware concurrency preserves independent affinity lanes per role within a session
  • Built-in ledger and CLI commands (spend, models, trace, top, analyze) for cost visibility and planning

Considerations

  • Early release (v0.1.0) with limited production track record; only Linux and macOS platforms currently supported
  • Not an agent orchestrator—does not manage agent lifecycles or inspect prompts
  • Requires Rust 1.97+ to build from source; cross-protocol routing translates only a subset of features

README quick start

Quick Start

Description

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

Related repositories

Similar projects matched by category, topics, and programming language.

nethical6
Featured
nethical6 GitHub avatar

conversation-steganography

A tool that hides encrypted secret messages inside innocent-looking AI-generated chat text for private communication over any messaging platform.

Go
1,149
programmersd21
Featured
programmersd21 GitHub avatar

flow

flow is a minimalist terminal dashboard that displays real-time network throughput with smooth animations, multiple responsive modes, and zero configuration.

Developer ToolsCLI & Terminal
277
MobAI-App
MobAI-App GitHub avatar

simslim

simslim reduces iOS simulator memory usage by 4x by disabling unnecessary background daemons, allowing many more simulators to run on a single Mac.

Go
248