A LiteLLM proxy on a cheap VPS is an architectural decision that changes the entire workflow: all tools and clients point at a single address, while routing, fallbacks and limits live in one config. From the round tables of practitioners, the pairing “OMP + LiteLLM on a VPS with priorities” has been recognized as the standard. The full config and the commands.
Why a proxy
Without a proxy: every tool keeps its own keys and addresses; a provider change = edits in every place; fallbacks are written in code in every project. With a proxy: clients see “one model” (for example, worker), and the proxy decides — which real provider, which fallback, which limit. A provider change is a one-line edit in the proxy config.
Additional benefits of a VPS: a permanent IP (anti-regional blocks for yourself), 24/7 availability, logging of all requests in one place, hiding keys from clients (clients only know the proxy key).
Installation on a VPS
pip install 'litellm[proxy]'
# конфиг
nano litellm_config.yaml
# запуск
litellm --config litellm_config.yaml --port 4000
# сервис через systemd для 24/7
# клиенты: base_url = http://IP_VPS:4000/v1Config with priorities and fallbacks
model_list:
- model_name: worker # клиенты просят "worker"
litellm_params:
model: openai/glm-4.7-flash
api_base: https://api.z.ai/api/paas/v4
api_key: os.environ/ZAI_KEY
- model_name: worker # то же имя — вторая запись
litellm_params:
model: deepseek/deepseek-chat
api_key: os.environ/DEEPSEEK_KEY
router_settings:
fallbacks:
- worker: [boss] # если worker упал — boss
- model_name: boss
litellm_params:
model: anthropic/claude-opus
api_key: os.environ/ANTHROPIC_KEY
general_settings:
master_key: os.environ/LITELLM_MASTERThe scheme from practice: priorities (cheaper models first) + fallbacks (the free one fails — move to the paid one) + a single entry point for all tools. Switching a harness is changing the base URL: the OMP/OpenCode/Zcode harnesses work with the proxy as with an ordinary provider.
Proxy security rules
- Master key — the only key clients know; the real provider keys live only in the VPS environment.
- HTTPS: behind nginx with a certificate (certbot) — otherwise keys travel in plain text.
- Firewall: port 4000 only from your IPs, if the pipeline is internal.
- Logs: LiteLLM writes usage per model — your token journal is collected automatically.
Before and after the proxy: a summary table
The decision to move is easier to make line by line than paragraph by paragraph. On the left — the typical scheme, where every tool keeps its own keys and addresses; on the right — the scheme with a LiteLLM proxy on a VPS from the config above.
| Aspect | Without a proxy | With a proxy on a VPS |
|---|---|---|
| Provider keys | Scattered across all tools | Only in the VPS environment; clients know the proxy key |
| Provider change | An edit in every project | One line in the proxy config |
| Fallbacks | Code in every application | A fallbacks block in router_settings |
| Token journal | Collected manually for every service | Usage per model is written automatically |
| Availability | As long as your work laptop is running | 24/7 together with the VPS and systemd |
| IP address | Dynamic, risk of regional blocks | A permanent IP removes the blocks for yourself |
| Limits and budgets | Left to each client’s conscience | Virtual keys with limits for each one |
| New client | Keys and addresses in every place | One base_url and a proxy virtual key |
The “Provider keys” row is the main one: after the move, a leak from one client does not drag the keys of the other providers along with it, because the clients never saw them. The remaining rows are time savings that grow with every new tool in the harness: OMP, OpenCode, Zcode connect to the proxy as to an ordinary provider, and every new client is added without edits to old projects.
Separately about the “Availability” and “IP address” rows: night pipelines and webhooks stop depending on whether your work laptop is switched on, and a permanent IP cures the situation where a provider blocks dynamic addresses by whole ranges. That is exactly why practitioners call the “OMP + LiteLLM on a VPS” pairing the standard: it is not exotic but basic pipeline hygiene, which is cheaper to set up right away than to repair later. A month after the move, reread the table: the rows that seemed like a pleasant bonus are by then working on every request.
Frequently asked questions
Is latency added? The VPS is close to you and to the providers — a few milliseconds; unnoticeable.
Multi-provider proxy keys? Yes: virtual keys with limits and budgets per client — for a team.
Which VPS? A minimal one (1 GB RAM) — the proxy is lightweight; location (close to you and to the APIs) and a permanent IP matter more.
An alternative to LiteLLM? OpenRouter as a “cloud proxy” — without your own VPS, but with their quotas; your own proxy gives control and key hiding.
Is a systemd unit mandatory? For 24/7 — yes: a manual launch dies together with the SSH session. The unit restarts the proxy after a VPS reboot and writes logs to journalctl — that is the “service via systemd” from the command block above. The template is short: ExecStart with the launch command, Restart=always and an EnvironmentFile with the secrets.
Where to keep the environment variables with keys? In the unit’s EnvironmentFile or in a separate .env with 600 permissions. The config reads them via os.environ/ — including the master key and the keys of all providers, so only the structure without secrets gets into the repository. The firewall and HTTPS from the security rules are set up before the first client, not after the first incident.
How do the two worker entries in one config work? Entries with the same model_name form a pool: LiteLLM distributes requests between the providers, and on failure goes down the fallbacks to “boss”. The order of entries in model_list is what sets the priority — the cheaper provider goes first. The clients keep seeing one model and one address.
What gets into the proxy logs? Usage per model: the token journal is collected automatically, without third-party counters. If nginx sits in front of the proxy, access logs are added — you can see which tool and when called “worker” or “boss”. A virtual key’s budget overrun is visible in the same records before the provider’s bill arrives.
LiteLLM on a VPS is moving the pipeline into operational mode: one address, a config instead of code, logs instead of guessing. An hour of setup pays off on every provider change. The config is current as of autumn 2026.
