LiteLLM: one gateway in front of every model provider
An open-source SDK and proxy that puts 100+ model providers, including your own vLLM servers, behind one OpenAI-compatible endpoint with virtual keys, budgets that deny, rate limits, fallbacks, caching, guardrails and spend tracking.
- Vendor
- BerriAI
- Licence
- MIT (the enterprise/ directory is under a commercial licence)
- Category
- Gateway
- Latest release
- v1.105.0 · 11 Oct 2026 · Release notes (opens in a new tab)
Best for
One OpenAI-compatible endpoint in front of many providers, with per-team keys, budgets, fallbacks and spend tracking
Avoid when
One service calls one provider and needs no keys, budgets or routing; you would add a hop and a database for nothing
On this page
LiteLLM is the gateway between your applications and every model they call. Version 1.105.0 shipped on 11 October 2026. A new stable minor line ships about every week and only the four newest lines get patches, so budget for an upgrade every month.
What it is and where it sits#
One repository holds two products:
- The Python SDK.
litellm.completion(model="anthropic/...", messages=[...])calls any of 100+ providers and always answers in the OpenAI Chat Completions shape. ItsRouterclass adds load balancing, retries and fallbacks inside one Python process. - The AI Gateway (the proxy). A Docker image that serves an OpenAI-compatible and Anthropic-compatible API on port 4000. With Postgres behind it, it issues virtual keys, enforces budgets and rate limits, records spend per request and ships an Admin UI at
/ui. Any OpenAI or Anthropic SDK, and coding agents such as Claude Code and Codex, work against it by changing the base URL.
In the stack it is the gateway layer. Applications and agents call LiteLLM; LiteLLM calls hosted APIs and your self-hosted vLLM servers, and sends metrics and traces to your observability backend.
LiteLLM is built by BerriAI. Everything outside the repository's enterprise/ directory is MIT. Enterprise features turn on with a licence key (LITELLM_LICENSE) on the same image, so there is no separate build to migrate to. Two 2026 incidents are worth knowing before you deploy. On 24 March 2026 attackers published malicious PyPI packages litellm==1.82.7 and 1.82.8 (LiteLLM's investigation pointed to a compromised maintainer account); the official Docker image was not affected, versions 1.78.0 to 1.82.6 are verified clean, and releases from 1.83.0 come from a rebuilt pipeline with cosign-signed images. On 18 March 2026 an advisory disclosed that versions before 1.82.3 could leak authorization headers into spend logs and OpenTelemetry traces when a custom guardrail returned the whole request.
When to pick it#
Pick LiteLLM when:
- Several teams or services call several providers and you want one place for keys, model access and spend.
- Budgets must deny, not just notify. A key, user or team over its budget is rejected with a
budget_exceedederror before the provider is called (HTTP 422 since v1.104.0; setbudget_exceeded_status_code: 429to keep the older code). - One provider's outage or rate limit must not take your product down. Fallbacks move traffic to another model group automatically.
- You serve some traffic from your own GPUs and want it behind the same API and the same keys as hosted models.
Use the SDK alone when a single Python service needs fallbacks and cost tracking and nothing else. Run the proxy as soon as two services, two languages or two teams share keys and budgets.
Skip it when one service calls one provider and needs no routing, budgets or keys: you would add a network hop, Postgres and Redis for nothing. If all you need is visibility into calls, an observability SDK such as Langfuse or Arize Phoenix is less to run.
The nearest alternatives are Portkey's gateway (MIT), Envoy AI Gateway (Apache-2.0, built on Envoy), Bifrost (Apache-2.0, written in Go), managed gateways such as Cloudflare AI Gateway, and hosted model marketplaces such as OpenRouter. Helicone's gateway has been in maintenance mode since Helicone joined Mintlify in March 2026.
How it works#
Everything starts from a config.yaml with four sections. Values written as os.environ/NAME are read from the environment, so secrets never sit in the file.
model_list. Each entry maps a publicmodel_name(the name your apps send) tolitellm_params(the realprovider/model, credentials,api_base, and per-deploymentrpm,tpmorweight). Entries that share amodel_nameform a model group.router_settings. How a model group picks a deployment and survives failures.routing_strategydefaults tosimple-shuffle(weighted random), withlatency-based-routing,usage-based-routing-v2,least-busyandcost-based-routingavailable, and per-group overrides throughrouting_groups. The docs recommend staying onsimple-shuffleat high traffic, because usage-based routing adds Redis lookups to every request. Retries (num_retries, default 2), per-errorretry_policy, cooldowns (allowed_fails, default 3;cooldown_time, default 5 seconds) and fallbacks live here too.litellm_settings. Proxy-wide behavior: request timeout, response caching, logging callbacks, guardrail defaults.general_settings. The master key, the database URL and the operational knobs: spend write batching, connection pool size, retention.
Fallbacks come in three kinds: context_window_fallbacks when a prompt is too long for the model, content_policy_fallbacks when a provider refuses the content, and fallbacks for everything else, such as rate limits and outages. A request fails over only after retries on its own group are exhausted.
Access is layered. The master key is the admin credential and doubles as the Admin UI password. Virtual keys are what you hand to services and people, and each carries an allowlist of models, max_budget with a budget_duration reset, rpm_limit, tpm_limit, max_parallel_requests and free-form metadata. Keys belong to users and teams with their own budgets, and you can budget your own customers through the OpenAI user field. Every request is priced from LiteLLM's model cost map and written to the LiteLLM_SpendLogs table in Postgres.
State is the part people underestimate. Keys, spend and stored config need Postgres. As soon as you run more than one worker process, rate limits, budgets, cooldowns and the cache need Redis, or each worker counts on its own and a limit of 100 requests per minute becomes 100 per worker.
Set it up
Members only below this line
Get the full LiteLLM: one gateway in front of every model provider deep dive free
What you get on this page:
- 6 members sections
Also in the members part
- Production configuration
- Wiring it into the stack
- Operating it
- Alternatives compared
- Learn it hands-on
Sources
Checked against these on 13 Oct 2026.
- LiteLLM docs index (opens in a new tab)docs.litellm.ai
- LiteLLM production best practices (opens in a new tab)docs.litellm.ai
- LiteLLM config settings reference (opens in a new tab)docs.litellm.ai
- LiteLLM routing and load balancing (opens in a new tab)docs.litellm.ai
- LiteLLM fallbacks, retries and cooldowns (opens in a new tab)docs.litellm.ai
- LiteLLM budgets and rate limits (opens in a new tab)docs.litellm.ai
- LiteLLM: what needs Redis (opens in a new tab)docs.litellm.ai
- LiteLLM Enterprise feature list (opens in a new tab)docs.litellm.ai
- LiteLLM OpenTelemetry v2 and vendor presets (opens in a new tab)docs.litellm.ai
- LiteLLM version support policy (opens in a new tab)docs.litellm.ai
- LiteLLM security update: suspected supply chain incident (March 2026) (opens in a new tab)docs.litellm.ai
- LiteLLM: guardrail logging secret exposure incident (18 March 2026) (opens in a new tab)docs.litellm.ai
- LiteLLM Docker image signing and verification (opens in a new tab)docs.litellm.ai
- LiteLLM v1.105.0 release (opens in a new tab)github.com