LiteLLM
LiteLLM is a self-hosted library in the Routing & Gateways layer of the AI stack. OpenAI-format proxy translating across 100+ model providers.
By Kunj ShahFacts verifiedmethod
- Licence
- MIT
- Language
- Python
- Cost
- free
- Owned by
- ML Platform
Use LiteLLM when
The widest provider coverage, deployed the least committal way.
Skip LiteLLM when
You want routing policy to live in a SaaS console.
Decides which model answers, and what it costs. See every routing tool.
Badge this entry
[](https://lattice.kunjshah.in/routing-gateways/litellm)Rules of thumb
- Route on measured quality, not on price alone. A cheaper model that fails your eval set is not cheaper.
- A gateway is in the request path, so it adds latency to every call. Measure that overhead before you add policy to it.
- Fallbacks that switch models silently change your output. Log which model answered every request, or you cannot debug quality.
Quick answers
- Is LiteLLM open source?
- Yes. LiteLLM is open source under the MIT licence. It is free to use.
- What are the alternatives to LiteLLM?
- The closest alternatives to LiteLLM are Portkey, Cloudflare AI Gateway and Envoy AI Gateway.
Ask an AI about this page
Opens the assistant with this page’s link and a question already filled in.
Compared in
- LiteLLM vs Portkey vs Cloudflare AI GatewayLLM gateways compared on provider coverage, caching, where the data goes and whether the routing logic is yours or theirs.
- Gateway vs guardrails vs evals: what to build firstA gateway, a guardrail layer and an eval suite compete for the same first week of work. What each catches, what each misses, and the order to adopt them in.
Reading on routing
- Do you need an AI gateway?Every team needs one place where model calls go through. Not every team needs a gateway product to be that place, yet.
- The gateway is the productThe interesting engineering is not calling a model. It is deciding which model, failing over safely, and staying inside a budget while you do it.
- Build a cost model before you optimiseTeams optimise the thing they can see in the dashboard. The dashboard shows tokens. The number that matters is cost per successful outcome, and nobody is measuring it.
- Choosing a model is a routing problemThere is no best model. There is a best model for a task, at a quality bar, within a latency and cost budget, and that decision is a routing policy, not a benchmark.
Alternatives to LiteLLM
compare 3 →Listed as an alternative to
- PortkeyPortkeyAI gateway with routing, caching and guardrails in one layer.proprietary · saas · usage-based
Use when A managed gateway with guardrails and analytics already bundled.
Skip when Prompts cannot leave your infrastructure.
- OpenRouterOpenRouterSingle API key and billing across many hosted models.proprietary · saas · usage-based
Use when One key and one bill across many hosted models, while experimenting.
Skip when You need self-hosting or per-provider SLAs.
- Envoy AI GatewayEnvoy AI GatewayCNCF-track gateway for LLM traffic on an Envoy data plane.Apache-2.0 · self-hosted · free
Use when A Kubernetes shop that already runs Envoy and needs the gateway in-cluster.
Skip when You want a gateway configurable without a data plane.
- BifrostBifrostHigh-throughput LLM gateway with drop-in OpenAI compatibility.proprietary · self-hosted · free
Use when A high-throughput OpenAI-compatible proxy with a small footprint.
Skip when You need the breadth of a full routing stack.
Also in routing
- PortkeyPortkeyAI gateway with routing, caching and guardrails in one layer.proprietary · saas · usage-based
Use when A managed gateway with guardrails and analytics already bundled.
Skip when Prompts cannot leave your infrastructure.
- Cloudflare AI GatewayCloudflare AI GatewayEdge gateway adding caching, retries and rate limiting.proprietary · saas · free-tier
Use when Edge caching and latency dominate, on Cloudflare already.
Skip when Requests must not transit a third party's network.
- OpenRouterOpenRouterSingle API key and billing across many hosted models.proprietary · saas · usage-based
Use when One key and one bill across many hosted models, while experimenting.
Skip when You need self-hosting or per-provider SLAs.
- MartianMartianModel router that optimizes for quality, cost and latency.proprietary · saas · usage-based
Use when Routing tuned on your own traffic rather than a public benchmark.
Skip when You want the routing rule to be plain config you can read.
- Envoy AI GatewayEnvoy AI GatewayCNCF-track gateway for LLM traffic on an Envoy data plane.Apache-2.0 · self-hosted · free
Use when A Kubernetes shop that already runs Envoy and needs the gateway in-cluster.
Skip when You want a gateway configurable without a data plane.
- BifrostBifrostHigh-throughput LLM gateway with drop-in OpenAI compatibility.proprietary · self-hosted · free
Use when A high-throughput OpenAI-compatible proxy with a small footprint.
Skip when You need the breadth of a full routing stack.
- RouteLLMRouteLLMLearned router that cuts cost by matching difficulty to model size.Apache-2.0 · self-hosted · free
Use when Cutting cost by matching query difficulty to model size, with a learned router.
Skip when You cannot evaluate the quality you would be trading away.
- Not DiamondNot DiamondRouting and prompt optimisation tuned on your own traffic.proprietary · saas · usage-based
Use when Routing and prompt optimisation tuned on your own traffic.
Skip when Self-hosting or auditability is a requirement.
- TrueFoundryTrueFoundryGateway plus observability and guardrails as one deployment.proprietary · managed · subscription
Use when Gateway, observability and guardrails as one managed deployment.
Skip when You want to adopt the pieces independently.