Back to stack index

AI

LiteLLM

Open gateway that unifies provider APIs.

Short answer

LiteLLM is an open-source Python library and proxy server that translates OpenAI-format requests into calls to more than 100 model providers, including OpenAI, Anthropic, Google, AWS Bedrock, Azure, Mistral, Groq and local servers such as Ollama. Self-hosted chat apps and agents point at the LiteLLM proxy instead of each provider, and the proxy handles keys, per-user and per-team budgets, rate limits, fallbacks between models, caching and spend tracking. The core is MIT-licensed and free to self-host; an Enterprise edition adds features such as SSO and audit logs, with a 30-day trial and pricing by deployment size. On October 21, 2026, attackers published a malicious v1.107.0 to PyPI and Docker Hub for about two hours; LiteLLM pulled it and advised users to pin 1.106.2, so pin an exact version rather than pulling latest. Alternatives in our directory include Portkey AI Gateway, Bifrost and LLM Gateway, which trade some of LiteLLM's provider breadth for speed or a hosted dashboard.

Safe pin after Oct 21 incident
1.106.2
LiteLLM security blog
License
MIT outside the enterprise folder
LiteLLM GitHub
Providers
100+
LiteLLM docs
Enterprise
30-day trial, then by deployment size
LiteLLM

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (4)

  • LiteLLM

    OpenAI-compatible proxy that unifies dozens of model providers behind one key.

  • Portkey AI Gateway

    Production gateway with guardrails, caching, and multi-provider routing.

  • Bifrost

    High-throughput gateway for routing GenAI traffic with failover between providers.

  • LLM Gateway

    Lightweight gateway focused on analytics and provider switching for LLM APIs.

LiteLLM in open-source AI tools: one gateway for 100+ model providers in 2026

What LiteLLM does

LiteLLM comes in two forms. The Python SDK lets code call litellm.completion(model="anthropic/claude-...", messages=...) and get an OpenAI-shaped response regardless of provider. The proxy server wraps the same logic in an HTTP API that any language or app can call.

The proxy is the part most self-hosted setups use. It adds:

  • Virtual keys. Issue a key per user, team or app, with its own model access list and budget.
  • Budgets and rate limits. Daily or monthly spend caps and requests-per-minute limits per key, user or team.
  • Routing and fallbacks. Send gpt-default to one model and fall back to another on errors, timeouts or rate limits; spread load across several deployments.
  • Spend tracking. Store every request's cost in Postgres and show it in the admin UI.
  • Caching. Return stored answers for repeated prompts, using Redis or other backends.
  • Logging. Send traces to Langfuse, OpenTelemetry tools, Datadog and others.
  • Guardrails and MCP gateway. Run content checks and expose MCP tools to models with rate limits.

Which directory projects use it

ProjectRelationship
LiteLLMThe gateway itself
Portkey AI GatewayAlternative gateway written in TypeScript with a hosted control panel
BifrostAlternative gateway written in Go, focused on low overhead
LLM GatewayAlternative open-source gateway with a hosted option

Chat apps such as LibreChat, Open WebUI and LobeChat connect to LiteLLM as an OpenAI-compatible endpoint, which is a common way to give them access to Bedrock, Vertex or Azure models they do not support directly.

Setting up the proxy

  1. Write a config.yaml listing models:
model_list:
  - model_name: claude
    litellm_params:
      model: anthropic/claude-opus-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: local
    litellm_params:
      model: ollama_chat/llama3.1:8b
      api_base: http://ollama:11434
  1. Run the Docker image with the config mounted, a LITELLM_MASTER_KEY, and a DATABASE_URL pointing at Postgres if you want keys and spend tracking.
  2. Open the admin UI at /ui, create virtual keys and teams, and set budgets.
  3. Point apps at http://your-proxy:4000 with a virtual key.

Redis becomes necessary when you run more than one proxy instance, so rate limits and budgets are shared.

Releases and stability

LiteLLM moves fast. The v1.105 and v1.106 lines in autumn 2026 added support for Claude Sonnet 5.5 and Haiku 5.5, a Decisions API, an agent() helper, a standalone Rust service for some components, and rate limits for the MCP gateway. Fast releases mean new models are supported within days, but also that upgrades occasionally break things. Pin a version in production, read release notes before upgrading, and test on a staging proxy first. The project publishes stable tags separately from nightly builds.

Gateways compared

GatewayLanguageLicenseStrength
LiteLLMPythonMIT core, commercial enterprise folderWidest provider coverage, budgets, admin UI
Portkey AI GatewayTypeScriptMITFast edge deployments, hosted observability option
BifrostGoApache 2.0Very low added latency at high request rates
LLM GatewayTypeScriptOpen coreHosted dashboard with self-host option
OpenRouterHosted onlyProprietaryNo infrastructure, one bill for hundreds of models

LiteLLM is the default when you need breadth and budget controls. Teams with very high throughput or strict latency budgets look at Bifrost. Teams that want no servers at all use OpenRouter.

Costs

LiteLLM itself is free. Running it needs a small container (1 to 2 vCPUs and 2 to 4 GB of memory handles most teams), a Postgres database for keys and spend logs, and Redis if you run several instances. On a cloud provider that is roughly $20 to $80 a month. The savings usually come from what it enables: routing simple requests to cheaper models, caching repeated prompts, and catching runaway spend through budgets before the monthly invoice.

A budget plan for a team rollout

A typical setup for a 50-person company giving staff access to several models:

GroupModels allowedMonthly budget per user
EveryoneMid-priced model, local model$10
EngineeringAbove plus Opus-class model$50
Data teamAbove plus long-context model$75
Automations (service keys)Small fast model only$200 per key

Create a team per group in the admin UI, attach models and budgets, and issue each person a virtual key, or connect LiteLLM to your identity provider with the enterprise SSO feature. Budgets reset on the schedule you set, and requests over budget return an error the chat app shows to the user. Review the spend report after the first month and adjust; most companies find a small number of heavy users account for most of the cost.

Observability

LiteLLM records cost and tokens but not the full content of conversations by default. For tracing prompts, responses and agent steps, connect a callback to Langfuse, an OpenTelemetry collector, or another logging tool. Set this up before a rollout, because debugging a bad answer is far easier when you can see the exact prompt the model received. Be deliberate about what you store: conversation logs may contain personal data and fall under the same retention rules as email.

Security

Treat the proxy as a vault, since it holds every provider key your company uses. Run it on a private network, put the admin UI behind single sign-on or a VPN, rotate the master key, and give each app its own virtual key so one leak does not expose everything. Keep provider keys in environment variables or a secret manager such as Infisical rather than in config.yaml. LiteLLM's release pipeline was compromised twice in 2026. On March 24, versions 1.82.7 and 1.82.8 on PyPI carried a credential stealer for about 40 minutes, traced to a compromised Trivy dependency in its CI. On October 21, a malicious v1.107.0 reached PyPI for about two hours and the Docker tags v1.107.0, latest, main-latest and main-stable for about two and a half hours; LiteLLM told users to pin 1.106.2. If you pulled either during those windows, LiteLLM's advice is to assume every key the host could reach was stolen, rebuild the environment and rotate all provider keys, the master key and the database password. Pin exact versions or image digests, never deploy from latest, and subscribe to the project's security advisories.

Common problems

  • Spend logs grow fast. Every request is a row. Set retention or move logs to a separate store on busy deployments.
  • Model names differ by provider. Use LiteLLM aliases so apps request default or fast, and change the real model in one place.
  • Streaming quirks. Some providers stream tool calls differently; test agents that rely on tool calls after any upgrade.
  • Exposed admin UI. Protect /ui and the master key; anyone with it can create keys with unlimited budgets.

Related: OpenAI API stack, Anthropic API stack, Langfuse stack, Redis stack, Stack index.

Frequently asked questions

What is LiteLLM used for?

It sits between your apps and model providers. Apps send OpenAI-style requests to LiteLLM, and it forwards each one to the right provider, converts the response back, records the cost, enforces budgets and retries on failure. Teams use it to give many people access to many models through one key system.

Is LiteLLM free?

The library and proxy are MIT-licensed and free to self-host, including virtual keys, budgets, fallbacks and the admin UI. The Enterprise edition, in a separate folder under its own license, adds SSO, audit logs, advanced guardrails and support.

Do I need LiteLLM if I only use one provider?

Probably not at first. It becomes useful when you add a second provider, need per-user spending limits, want automatic fallback when a provider is down, or need one place to see costs across apps.

Was LiteLLM hacked?

Its release pipeline was. Malicious packages were published on March 24, 2026 (versions 1.82.7 and 1.82.8) and on October 21, 2026 (version 1.107.0 and several Docker tags). Each was pulled within hours. Anyone who installed them should rebuild and rotate every credential the host could reach. LiteLLM advised pinning 1.106.2 after the October incident.

How fast is LiteLLM?

The Python proxy adds a few milliseconds per request under normal load, which is small next to model response times. At very high request rates, Go or Rust gateways such as Bifrost add less overhead. LiteLLM has added a standalone Rust service for some components in 2026.

Can LiteLLM work with Ollama?

Yes. Add a model with the ollama/ or ollama_chat/ prefix and the api_base of your Ollama server. You can then mix local and hosted models behind one endpoint, with fallbacks from one to the other.

Sources

  1. LiteLLM on GitHub
  2. LiteLLM proxy docs
  3. LiteLLM providers
  4. LiteLLM security incident, October 21, 2026
  5. LiteLLM Enterprise