Lightweight LLM gateway

One endpoint.
Every model.
No single key can take you down.

Route OpenAI-compatible traffic across providers and API keys with automatic failover, layered limits, usage tracking, and policy-based routing—all from one Go binary.

01 single binary02 self-hosted03 no required services
modelmux start demo boot
$modelmux start
config~/.config/modelmux/config.yamlloaded
providers4 adaptersready
keys10 configuredhealthy
serverhttp://127.0.0.1:8787listening
CLIENTyour applicationOpenAI SDK
>_ModelMux:8787
OpenAI-compatibleAnthropicGeminiCustom
MODE proxyROUTES healthyPORT :8787
connected providers

One interface. Multiple upstreams. Live failover.

ModelMux evaluates provider and key health before every request, applies configured limits, and moves traffic to the next eligible target when an upstream becomes unavailable.

providers4connected
healthy keys10of 11
success rate99.7%demo
average latency842msdemo
modelmux providers --status simulated runtime view
PROVIDERADAPTERKEYSHEALTHLATENCY
OpenAIid=openai
openai-compatiblestream · tools · json
3 / 3 activeonline842ms
Anthropicid=anthropic
native-adapterstream · tools · cache
2 / 2 activeonline1.12s
Geminiid=gemini
native-adapterstream · vision · tools
1 / 2 activedegraded690ms
Custom APIid=custom
passthroughopenai schema · custom base URL
4 / 4 activeonline410ms
incomingPOST /v1/chat
policy + healthmodelmux :8787
OpenAIonline
Anthropiconline
Geminidegraded
Custom APIonline
BUILT FOR FAILURE

Reliability belongs
in your infrastructure.

Your application should not need to understand provider outages, exhausted keys, cooldown timers, or retry policy. ModelMux absorbs those failures before they become client errors.

$modelmux ai explain --request-id request_7f2a
inspect routing and failover
modelmux replay request_7f2ademo trace
REQUESTrequest_7f2a
TARGEThigh-price
STRATEGYfailover
  1. 01
    request received

    POST /v1/chat/completions

    accepted
  2. 02
    primary route selected

    mimo-primary · priority 1

    routing
  3. 03
    upstream rejected request

    rate limit exceeded

    429
  4. 04
    key placed in cooldown

    mimo-primary · retry after 300s

    cooldown
  5. 05
    next healthy route selected

    claude-team · priority 2

    failover
  6. 06
    request completed

    response streamed to client

    200 · 842ms
RESULTrecovered automatically

No application retry. No leaked provider error. One compatible response.

exit 0
RETRY 1/5COOLDOWN 1HEALTHY KEYS 8CLIENT ERRORS 0
01

Automatic failover

Move to the next healthy key or provider without changing application code or asking the client to retry.

429 · 5xx · timeout
02

Layered limits

Apply model, key, token, daily quota, and concurrency limits before an exhausted upstream rejects traffic.

RPM · TPM · quota
03

Observable routing

Trace every selection, retry, cooldown, latency measurement, request ID, and final route from one terminal.

logs · metrics · trace
THREE STEPS

From API keys
to a reliable endpoint.

Configure ModelMux once, validate the route, then keep your application focused on product logic instead of provider-specific recovery code.

  1. 01
    providerConfigure upstream
  2. 02
    routingAttach models and keys
  3. 03
    connectPoint your application
open the full quick start
modelmux init --guidedsetup session
$
Creating a reliable local route

Answer three configuration stages. ModelMux validates each stage before continuing.

  1. PROVIDER

    Configure upstream

    Register the provider adapter and upstream endpoint.

    configured
    provider.id
    mimo
    provider.type
    openai-compatible
    provider.url
    https://api.example.com/v1
  2. ROUTING

    Attach models and keys

    Connect routable models, credentials, and recovery policy.

    routing ready
    model.id
    mimo-v2.5-pro
    strategy
    failover
    keys
    mimo-primary, mimo-backup
  3. CONNECT

    Point your application

    Keep the OpenAI client and replace only its base URL.

    connected
    base_url
    http://127.0.0.1:8787/v1
    auth
    MODELMUX_TOKEN
    compatibility
    OpenAI SDK
READYEndpoint accepting requests
endpoint
http://127.0.0.1:8787/v1
provider
mimo
strategy
failover
healthy keys
2
$curl localhost:8787/v1/models200 OK
PROVIDER 1MODEL 1KEYS 2ROUTE HEALTHYPORT :8787
REQUEST LIFECYCLE X-RAY

Simple to deploy.
Visible at every stage.

Follow one request from authentication to the upstream stream. ModelMux keeps the routing path explicit, measurable, and independent from your application code.

runtime
Go
deployment
single binary
database
optional SQLite
services
none required
default port
:8787
inspect core concepts
modelmux logs --json --limit 1illustrated trace
REQUESTrequest_8a91
METHODPOST /v1/chat
TARGEThigh-price
STREAMtrue
  1. 01
    authentication

    Bearer token verified before proxy work begins.

    passed
  2. 02
    policy + guardrails

    Target group and request policy resolved.

    production
  3. 03
    limit check

    Model RPM, key quota, and concurrency checked locally.

    42/60 RPM
  4. 04
    key router

    Health, priority, cooldown, and strategy evaluated.

    mimo-primary
  5. 05
    provider adapter

    Compatible payload forwarded and response streamed.

    streaming
RESPONSEstream completed

Selected route stayed observable from local checks through upstream delivery.

200 · 842ms
AUTH passedLIMITS healthyRETRY 0BUFFERING minimal
ACTUAL TUI WORKSPACE

Operate the router
where developers already work.

This is the real ModelMux dashboard—not a decorative terminal mockup. Configuration, health, logs, and routing tools stay available without opening a browser control plane.

modelmux tui --theme violetactual product UI
ModelMux Violet terminal dashboard showing the providers workspace
q quitr refresh/ filterenter inspect? help
READY TO ROUTE?

Install one binary.
Expose one reliable endpoint.

Start locally with Go, add a provider and keys, then point your existing OpenAI-compatible client at ModelMux. No external control plane is required.

install modelmux3 commands
[ Go ][ macOS / Linux binary ][ source ]
01install
$go install github.com/livingdolls/yute-modelmux/cmd/modelmux@latest
binary installed
02configure
$modelmux config init && modelmux config validate
configuration valid
03run
$modelmux start
proxy listening on :8787
>_
ENDPOINT READYhttp://127.0.0.1:8787/v1

Use config-defined model IDs from any OpenAI-compatible SDK.

exit 0
BINARY readyCONFIG validROUTE healthyPORT :8787