Blog
Self-hosting an LLM gateway: the math nobody puts on the README
LiteLLM and friends cost nothing to download and something real to run. At two engineer-hours a week, 'free' is about $1,000 a month. Here is the whole ledger, and the two cases where self-hosting still wins.
A self-hosted LLM gateway like LiteLLM costs $0 in licences and roughly $1,000/month in real operations at two loaded engineer-hours a week. It beats a $49/month control plane only under about six minutes of weekly ops, or when data locality forces it, or when an existing platform team has genuinely spare on-call capacity.
The ledger, honestly
Count everything: hosting, upgrades, dependency patching, rate-limit and retry tuning, incident response, and the attention tax of one more service on the pager. At a modest two loaded engineer-hours a week and $120 an hour, the line is about $1,039 a month. Against Portkey's $49 flat, the break-even is under six minutes of ops per week; against OpenRouter's 5.5%, self-hosting wins on fees alone only past roughly $18,000 a month of spend.
None of this is an argument that self-hosting is bad. It is an argument that its price tag is written in a different currency, and most comparisons quietly convert it at zero.
The two cases where it truly wins
Data locality: if traffic cannot leave your infrastructure, self-hosting is not an option but the option; every hosted layer is disqualified first. Spare platform capacity: teams already running infrastructure with on-call absorb one more service at near-zero marginal cost, and for them self-hosted is the best economics in the category, no fee, no markup, full control.
If neither describes you, you are volunteering for a second job to avoid a $49 line item. The interactive version of this math is in our platform-teams page, sliders included.
Every fee structure at your spend
OpenRouter 5.5% on credit top-ups; Requesty 5% token markup; Portkey $49/month flat; LiteLLM $0 licence with ops estimated at ~$1,000/month (two loaded engineer-hours a week) unless the box is ticked. Fees verified 2026-07-28. The crossover between 5.5% and $49 flat sits near $891/month.
What self-hosting does not solve
The gateway you run yourself still leaves model selection with you, in a config file this time, re-opened at every market reprice: three flagship-tier events in nine months. It also does nothing about provider variance if you route open-weights models across hosts.
Both problems live a layer above the plumbing, in who picks the model. Owning that job well is a discipline (we wrote it up); delegating it per request is a category, the blended model, which is ours, so audit the receipts before taking our word.
Questions, answered
Is LiteLLM the best self-hosted gateway?
It is the category's default and what we price in our comparisons. The honest evaluation is less about which software and more about whether your team can own another service; the ops line dwarfs feature differences.
What does self-hosting actually cost?
Roughly your weekly engineer-hours times loaded rate times 4.33. At 2 hours and $120: ~$1,039/month. With genuinely spare platform capacity, near zero, which is the case that changes the answer.
When is self-hosting cheaper than OpenRouter?
On pure fees, past roughly $18,000/month of spend (where 5.5% exceeds $1,000). With spare ops capacity, at any spend. Below both thresholds, hosted options win the ledger.
Does self-hosting reduce latency?
It can: a gateway inside your own network can beat the +68ms median hop we measured to a hosted layer. A neglected deployment can also be far worse. Operations quality, not architecture, decides.
Compare any two models
Rates verified 2026-07-28. "Measured task" = our identical dashboard-generation prompt, metered where marked ✓ and list-math otherwise. Verbosity from the Verbosity Index, Edition 1. Data: prices.json.