# LiteLLM

> A free tool that lets your code call over 100 models in one way.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** LiteLLM Proxy, LiteLLM SDK, LiteLLM Gateway

## Think of it like

It is like a travel plug. One plug fits the wall in every country.

## Definition

LiteLLM is a free, open-source tool for calling over 100 language models in one way. You write each call in the OpenAI format. LiteLLM turns it into what each provider expects. You name the model with the provider first, like anthropic/ and then the model. It comes as a Python library, or as a proxy server a whole team can share. The proxy adds its own keys, cost tracking and an admin page.

## Example

Jack's team runs the LiteLLM proxy. Each app gets its own key, and moving to another provider is a change to one model name.

## Example code

```python
from litellm import completion

response = completion(
    model="anthropic/claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello, how are you?"}],
)
print(response.choices[0].message.content)
```

The provider comes first in the model name. The reply has the same shape for every provider.

## Why it matters

Apps stop being tied to one provider. Trying a new model, or leaving an old one, is a change to settings instead of a rewrite.

## Common mistake

Thinking every model can do the same things. A shared format cannot give a model a skill it does not have.

## Three principles

- **One format.** OpenAI style for every model.
- **Library or proxy.** In your code, or shared by a team.
- **Provider first.** anthropic/, openai/ and more.

## Related terms

- [LLM Gateway](https://learn.benibix.com/term/development/llm-gateway)
- [Model Routing](https://learn.benibix.com/term/development/model-routing)
- [Model Fallback](https://learn.benibix.com/term/development/model-fallback)
- [OpenAI API](https://learn.benibix.com/term/development/openai-api)
- [OpenAI-Compatible API](https://learn.benibix.com/term/ai/openai-compatible-api)
- [Open Source Software](https://learn.benibix.com/term/development/open-source)
- [Python](https://learn.benibix.com/term/development/python)

## Told apart from

- [LiteLLM vs OpenRouter](https://learn.benibix.com/compare/litellm-vs-openrouter): People think LiteLLM and OpenRouter are the same, since both let one app reach many models. LiteLLM is free code you run yourself. You give it your own key for each provider. OpenRouter is a service that someone else runs. You use one OpenRouter key, and it bills you for every model in one place.

![Several apps send their calls to one gateway. The gateway holds the keys, logs each call, and passes it on to one of several model providers.](https://learn.benibix.com/diagrams/dev-llm-gateway.svg)

---

Source: https://learn.benibix.com/term/development/litellm
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
