Skip to main content

high-performance openai/anthropic-compatible llm proxy and load balancer

Project description

rolter

A high-performance, open-source LiteLLM-proxy alternative built in Rust with a TypeScript + shadcn/ui dashboard.

rolter is an OpenAI/Anthropic-compatible AI gateway that proxies commercial providers and load-balances self-hosted OpenAI-compatible fleets (e.g. 20–30 vLLM instances) with cache-aware routing, full RBAC, reload-free configuration, and cost/usage tracking.

Status: early scaffold. The data-plane gateway MVP runs today (OpenAI/Anthropic passthrough + balancing + virtual keys + metrics). The control plane, dashboard, and persistence are being built out — see ROADMAP.md and TODO.md.

Why rolter

  • Fast: a Rust data plane (Axum/Hyper/Tower on Tokio) with lock-free config reads and minimal-copy streaming.
  • Cache-aware load balancing: route prefix-heavy traffic to the vLLM replica most likely to have the KV cache warm — approximate today, precise (KV-events) on the roadmap.
  • Drop-in: speak the OpenAI and Anthropic APIs your clients already use.
  • Operable: virtual keys, budgets, rate limits, cost tracking, RBAC, and reload-free config changes from the UI.

Architecture

flowchart LR
  Client([OpenAI / Anthropic clients]) -->|/v1/*| GW["rolter-gateway<br/>(data plane)"]
  Admin([Dashboard]) --> CTL["rolter-control<br/>(control plane + UI host)"]
  GW -->|balanced + streamed| UP["Upstreams<br/>OpenAI · Anthropic · vLLM pool"]
  CTL -->|writes config| PG[("PostgreSQL")]
  CTL -->|publishes change events| RDS[("Redis")]
  RDS -->|hot-swap snapshot| GW
  GW -->|async batched logs| CH[("ClickHouse")]

See docs/architecture/overview.md for the full design.

Quick start

The whole stack — gateway, control plane, and UI — comes up with one command (just required):

just dev

This creates rolter.toml from the example on first run, installs UI deps (Bun if present, else npm), and runs all three processes with labeled output. No provider API keys are needed to boot — the built-in fake-llm model answers locally, so you can try the gateway before configuring any upstream.

Service URL Notes
UI http://localhost:3000 Vite dev server, proxies /api → control
Gateway http://localhost:4000 OpenAI/Anthropic-compatible data plane
Control http://localhost:4001 management API + built UI host

Send a request to the built-in model (works with no upstream configured):

curl -s http://localhost:4000/v1/chat/completions \
  -H "Authorization: Bearer sk-rolter-dev" \
  -H "Content-Type: application/json" \
  -d '{"model":"fake-llm","messages":[{"role":"user","content":"hello"}]}'

To route to a real provider, edit rolter.toml and export the key its api_key_env references (e.g. export OPENAI_API_KEY=sk-...), then call the model you configured. GET /healthz and Prometheus GET /metrics are also exposed.

Gateway only

cargo run -p rolter-gateway -- --config rolter.toml

Install

# rust
cargo install --path crates/rolter-gateway

# uv (PyPI wheel built with maturin) — see docs/development/packaging.md
uv tool install rolter

# docker
docker compose -f docker/docker-compose.yml up -d

Repository layout

  • crates/rolter-core — config model, domain types, errors, telemetry
  • crates/rolter-balancer — load-balancing strategies (incl. approximate cache-aware)
  • crates/rolter-proxy — upstream forwarding, header injection, streaming
  • crates/rolter-store — repository traits + in-memory store (Postgres/Redis/ClickHouse next)
  • crates/rolter-auth — virtual keys, roles, access checks
  • crates/rolter-gateway — data-plane binary
  • crates/rolter-control — control-plane binary + static UI host
  • ui/ — Vite + React + shadcn/ui dashboard
  • docs/ — architecture, ADRs, API, development and deployment guides
  • migrations/, clickhouse/ — database schemas

Development

cargo build --workspace
cargo test --workspace
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings

Commits and PR titles follow Conventional Commits. See AGENTS.md and docs/development/contributing.md.

License

Apache-2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rolter-0.0.5-py3-none-win_amd64.whl (4.0 MB view details)

Uploaded Python 3Windows x86-64

rolter-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

rolter-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

rolter-0.0.5-py3-none-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file rolter-0.0.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: rolter-0.0.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rolter-0.0.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4be825f764592d6d4a24f652dc8d2b0a7ad0cb75ac8cc4a5feee3b6e9bff4eb8
MD5 4ed34828feadcf5329d752d548435ad1
BLAKE2b-256 a0cea03f0fa96c7f232c3f64e5cc060645976a65fab8133ee0c151f222c8f58a

See more details on using hashes here.

File details

Details for the file rolter-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rolter-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f6092a7ecaa56bab79b6bd453eff85c9d4a5cfaa3a907fc8ff29b0999cf7864
MD5 e88dabdac19ae6f05d7f3471e42ebfac
BLAKE2b-256 a8d3adcfae10d7b7568efcfe15f6ee18d6e07d18ca9cf5bc0e6302205aa5f1f2

See more details on using hashes here.

File details

Details for the file rolter-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rolter-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 57e49e59427e510d782cac1f7dd9d217517069fd2d9778d3e599341690cb8113
MD5 1cfbce5aa50b9abfedf1c70cb952b60b
BLAKE2b-256 6309b326cd4b9e8d20cbb1a0aefa8bd3b7a91ca844908a8b5c0a563b878692d9

See more details on using hashes here.

File details

Details for the file rolter-0.0.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rolter-0.0.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81450f0c67ebd21d8638d978a84711b76d9411a8bbefbaa18192a7444bd51b8a
MD5 b611793e96b3635ca8ca07895a692e23
BLAKE2b-256 dcdb836be18b63e32ae158c85c379e9952a09e8ede3df28a865a68980d57d1f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page