# LiteLLM

> Call 100+ LLM APIs with one OpenAI-format interface — as a Python library or a self-hosted gateway/proxy.

LiteLLM lets you call 100+ LLMs (OpenAI, Anthropic, Google, Bedrock, local, and more) through one OpenAI-compatible interface. Use it as a Python library, or run its proxy as a self-hosted gateway with central keys, fallbacks, retries, caching, cost tracking, and rate limits.

Website: https://www.litellm.ai

LiteLLM gives you one interface to call virtually any LLM. Write your code once against the OpenAI format and LiteLLM translates to 100+ providers — Anthropic, Google, Azure, AWS Bedrock, local models, and more — so switching or mixing models is a config change, not a rewrite. It comes in two forms: a **Python library** for in-process calls, and a **proxy server** you run as a centralized gateway.

It is aimed at teams who don't want to be locked to one provider's SDK, and at platform teams who want a single control point for all LLM traffic. The proxy is where it becomes infrastructure: central API-key management, **fallbacks** across providers, retries, caching, **cost tracking**, and rate limits for every app behind it.

## Highlights

- **One format, many providers** — OpenAI-compatible calls to 100+ models; swap models via config.
- **Gateway/proxy** — self-hosted control point with key management, budgets, and per-team rate limits.
- **Fallbacks & retries** — automatically route around a failing or rate-limited provider.
- **Caching & cost tracking** — cut spend and latency, and attribute cost per key/team.
- **Library or server** — embed in code or run centrally for the whole org.

## In an AI-assisted workflow

```python
from litellm import completion
# same call, any provider — just change the model string
completion(model="anthropic/claude", messages=[...])
completion(model="gpt-5",            messages=[...])
```

Run the proxy and point every app at it to centralize keys, fallbacks, and cost.

> [!TIP]
> Use the library for simple multi-provider code; run the proxy when you want one place to manage keys, budgets, fallbacks, and cost across many apps — the gateway pattern in [Calling Any Model](/guides/concepts/calling-any-model-gateways).

## Good to know

LiteLLM is open source (MIT) and free to self-host; an enterprise edition adds advanced gateway features and support. As a hosted-key gateway it's infrastructure you operate — plan for its availability. Compare the fully-hosted [OpenRouter](/tools/openrouter) if you'd rather not run a proxy.

---

_Source: https://agentscamp.com/tools/litellm — Tool on AgentsCamp._
