BYOK is live — 1,000,000 free BYOK requests every month, no top-up requiredLearn more

Comparisons6 min read

LiteLLM vs Hosted LLM Gateways: Which Should You Run?

LiteLLM is good software. Its core is open source under the MIT licence, it is widely deployed, and it does the central job of an LLM gateway well: it takes requests for many providers and exposes them through one OpenAI-format interface, so an application talks to a single API. If you self-host it, the licence costs nothing. That is usually where the comparison stops, and it is where it should start. This article sets out what each option actually costs, what each one trades away, six questions that settle the decision for most teams, and the hybrid arrangement many of them end up with.

What LiteLLM does well

LiteLLM comes in two parts: a Python SDK that calls many providers with one function signature, and a proxy server that sits between your applications and those providers. The proxy is the part teams compare with hosted gateways. It handles request translation, virtual keys, per-key budgets, spend tracking and fallbacks between deployments you configure.

The licence detail matters for planning. According to the project's LICENSE file, everything outside the enterprise/ directory is MIT, while that directory has its own commercial licence. In practice the core proxy runs in production without a key, and some features, such as single sign-on beyond a small number of users, need a paid Enterprise licence. Check which features your security team will ask for before you assume the whole stack is free.

LiteLLM is not the only self-hostable option. Portkey made its full gateway open source in March 2026 under the MIT licence, and Helicone, which is built around logging and cost analytics, is open source under Apache 2.0. The category map is in What Is an LLM Gateway.

Two ways to run a gateway

Self-hosted means the router runs inside your own infrastructure. Requests reach the provider without passing through a third party, you control the deployment, and you can read every line of code that handles your traffic.

Hosted means someone else runs it. You get an endpoint and a key. Routing, failover, catalog upkeep and billing happen on the other side of that URL.

Neither is the more serious choice. They divide the same work differently: with self-hosting, your team owns the gateway; with hosting, a vendor owns it and you own the vendor relationship.

What self-hosting actually costs

The licence is free. The rest is not.

  • Infrastructure. A small server costs tens of dollars a month. But a gateway sits in the critical path of every model call, so a single unmonitored box is a real risk. Redundancy, a database for keys and spend, and monitoring push the bill and the effort up.
  • Upgrades. Provider APIs change, new models ship every week, and parameters behave differently from one provider to the next. Someone on your team has to keep up. This cost surprises people, because it never ends and never appears as a budget line.
  • Operations. Key storage, rotation, access control, alerting and incident response all become yours. Done well, they are a project. Done badly, they are a liability.
  • Catalog upkeep. You decide which models to connect, check their prices, and keep the model names and parameters mapped correctly. A hosted gateway does this as its product.

None of this argues against self-hosting. It is why the honest comparison is not "free versus paid" but "your engineering time versus a vendor's fee or margin."

What a hosted gateway trades away

The same honesty applies in the other direction.

  • A third party sits in the request path. For some compliance positions, that rules it out regardless of the vendor's practices. Ask what the vendor stores. BoostRail, for example, does not store request or response content by default and keeps only the metadata needed for billing and troubleshooting, as set out on the business pricing page.
  • Availability is shared. If the gateway has a bad day, so do you. Failover across providers protects you from provider outages, not from gateway outages.
  • The catalog is curated. You get the models the platform has connected. Usually that is a feature, because everything is priced and maintained, but it is still a limit.
  • There is another vendor to manage. One more account, one more bill and one more support channel.

LiteLLM or hosted: the decision in six questions

  1. Must requests stay inside your network boundary? If yes, self-host. This overrides everything below.
  2. Does someone own infrastructure? Not someone who could learn it: someone who owns it, with time set aside. Without that person, a self-hosted gateway slowly falls behind.
  3. How many providers, and how often do they change? One or two stable providers is a light load. Ten providers with weekly model launches is a job.
  4. Is the gateway in your critical path? If it is, compare the uptime you can realistically achieve with that of a platform whose whole business is that uptime.
  5. What is your engineering time worth? At loaded cost, a few hours a month of upkeep often costs more than a hosted platform charges.
  6. Do you need per-model billing, invoices and usage reports? Building these well is a project of its own.

Teams that answer yes to the first question have their answer. For the rest, questions two to five usually decide it, and the answer often changes as the team and its traffic grow.

The hybrid: BYOK behind a hosted gateway

The choice is less binary than it looks, because bring your own key (BYOK) covers much of the middle ground. With BYOK you keep your own provider accounts and any contract prices you have negotiated, while a hosted gateway handles the single endpoint, routing and failover. Inference on those requests is billed by the provider to your own account.

That gives you much of what self-hosting is usually for, namely your own contracts and provider relationships, without running the infrastructure. On BoostRail, the free BYOK plan includes 1,000,000 BYOK requests a month across three providers. When your own key fails or runs out of credit, requests can continue on platform routes for the same model if you keep a balance; for strict data boundaries, you can turn platform routes off per provider so requests never leave your own accounts. How the routing order works is covered in BYOK: Using Your Own Provider Keys.

Common shapes:

  • Frontier models on your own contracts where you have negotiated prices, with the long tail of models on platform routes.
  • Sensitive workloads pinned to your own provider agreements, with everything else on the platform.
  • Self-hosted LiteLLM for internal traffic, with a hosted gateway for overflow and for models you have not connected yourself.

Moving between them later

Both approaches speak the OpenAI format, so the decision is cheap to reverse. Moving from a self-hosted proxy to a hosted gateway, or back, is a change of base URL and key:

from openai import OpenAI

# Self-hosted LiteLLM proxy
client = OpenAI(api_key="sk-litellm-...", base_url="http://litellm.internal:4000")

# Hosted gateway: same code, different endpoint
client = OpenAI(api_key="YOUR_BOOSTRAIL_KEY", base_url="https://api.boostrail.com/v1")

Model names are the part to check. Each gateway has its own naming, so keep model IDs in configuration rather than scattered through code. The OpenAI-compatible migration guide covers the remaining details, such as streaming and tool calls, and the models page lists the names BoostRail uses.

Frequently asked questions

Is LiteLLM production-ready?

Yes. It runs at real scale in many companies. The question has never been software quality; it is whether operating a gateway is a good use of your team's time, and whether the features you need fall under the MIT core or the Enterprise licence.

Is LiteLLM completely free?

The core SDK and proxy are MIT-licensed and free to run. Code in the enterprise/ directory is under a separate commercial licence, and some features, such as single sign-on beyond a small number of users, need a paid key. Your own server and provider bills apply either way.

Can I use LiteLLM and a hosted gateway together?

Yes. A common setup routes internal traffic through a self-hosted LiteLLM proxy and adds a hosted gateway as one of its providers, for overflow and for models you have not connected yourself. Because both use the OpenAI format, LiteLLM treats the hosted gateway like any other OpenAI-compatible provider.

What if I need observability more than routing?

Then this is the wrong comparison. Helicone and Portkey are built around logging, cost analytics and governance. OpenRouter Alternatives in 2026 compares them with catalog-style gateways.

Start with one API key.

BoostRail is one OpenAI-compatible API for 75 text, image and video models. An API key takes about a minute.

Last updated: 2026-11-23