Skip to content

LiteLLM

LiteLLM is an open-source AI gateway from BerriAI that gives applications a single OpenAI-compatible interface to more than 100 large language model providers:

A Python app calls the LiteLLM SDK or proxy, and a model string routes it to OpenAI, Anthropic, Ollama, or 100+ more.
One Call, Two Modes, 100+ Providers

The Python library exposes a completion() function that takes the same message format as the official OpenAI client. Switching from OpenAI to Anthropic, Gemini, or a locally hosted Ollama model means changing a model string rather than rewriting call sites. LiteLLM normalizes streaming responses and provider errors into OpenAI-style equivalents.

The same project ships a self-hosted proxy server aimed at platform teams that want one key in front of every LLM they use. The proxy issues virtual keys per team or project, tracks spend against budgets, enforces rate limits, and retries or falls back across deployments. Callbacks forward request traces to observability platforms such as MLflow and Langfuse.

LiteLLM routes requests but doesn’t host models, so you bring your own provider credentials and keep your existing billing relationships. Hosted gateways like OpenRouter take the opposite trade and bill every provider through one account, while Portkey and Kong AI Gateway compete with the LiteLLM proxy on governance features rather than on provider coverage.

The core project is MIT-licensed and can run air-gapped. A paid enterprise tier adds single sign-on, JWT authentication, and audit logs.

Official website: litellm.ai

How to Integrate ChatGPT's API With Python Projects

Course

Leverage OpenAI's API in Your Python Projects

Learn how to use the ChatGPT API with Python's openai library to send prompts, control AI behavior with roles, and get structured outputs.

intermediate ai api

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated Aug. 23, 2026