open-llm-proxy is a local OpenAI-compatible gateway for routing requests through the models and provider accounts you already use. It gives agents one stable endpoint, configurable fallback chains, provider authentication, attachment handling, rate-limit tracking, and an optional Admin UI backed by PostgreSQL.
- OpenAI-compatible
/v1/chat/completionsand/healthzendpoints. - Provider/model fallback chains and model discovery.
- Named provider accounts with safe credential storage.
- Attachment normalization and optional on-disk spooling.
- Persistent provider rate-limit policy and state.
- Optional LiteLLM Admin UI for keys, requests, and spend tracking.
- Python 3.10 or newer.
uvorpip.- Provider credentials for the models in your configuration.
- PostgreSQL only if you want the Admin UI.
# uv is recommended for a reproducible install; pip is supported as an alternative.
uv tool install .
# or
python -m pip install .mkdir -p ~/.config/open-llm-proxy
cat > ~/.config/open-llm-proxy/agent-config.yml <<'YAML'
opencode:
settings:
model: "openrouter/<provider-model-id>"
YAML
export OPENROUTER_API_KEY="<your-provider-key>"
open-llm-proxy serveIn another terminal, check readiness and send a request:
curl http://127.0.0.1:8765/healthz
curl http://127.0.0.1:8765/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"openrouter/<provider-model-id>","messages":[{"role":"user","content":"Hello"}]}'The default bind is 127.0.0.1. Remote binding is an explicit opt-in and is unauthenticated unless LITELLM_MASTER_KEY is set. Pass secrets through environment variables; CLI secret options remain available but are deprecated.
Attachments are stored under ~/.local/share/open-llm-proxy/attachments by default. Provider account metadata and credentials are stored under ~/.config/open-llm-proxy/ with restricted permissions. Read SECURITY.md before exposing the service.
For the optional Admin UI, copy .env.example to .env, fill in the PostgreSQL and UI credentials, and load that environment before starting the proxy. Keep .env private.
| Guide | Contents |
|---|---|
| Getting started | Full setup, Admin UI, PostgreSQL, and Podman |
| CLI | Commands and options |
| Authentication | Accounts, credentials, and migration |
| Attachments | Normalization and file spooling |
| Rate limits | Plans, setup, and cooldowns |
| Configuration | Config files and environment variables |
MIT; see LICENSE. Contributions are welcome; see CONTRIBUTING.md.