Open Source Developer Tools API ProxyMulti-ProviderPythonOpenAI CompatibleLoad Balancing

LiteLLM

Python SDK and proxy server that standardises calls to OpenAI, Anthropic, Gemini, Bedrock, and 100+ models behind a single OpenAI-compatible interface.

BerriAI/litellm 19.0k stars 2.4k forks MIT

Install

$pip install litellm

About

LiteLLM's SDK wraps every provider's SDK in a single completion() call with the same input/output format as OpenAI. Code written for GPT-4o works unchanged with Claude, Gemini, or a local Ollama model by changing the model string.

The LiteLLM Proxy (litellm --model ...) starts a local OpenAI-compatible server. You point any OpenAI SDK at localhost and route traffic to any backend, with built-in load balancing, usage logging, and per-key budget limits.

Getting Started

pip install litellm

import litellm

# Same code works for any model
response = litellm.completion(
    model="anthropic/claude-sonnet-4-5",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

# Or start the proxy
litellm --model anthropic/claude-sonnet-4-5

Features

OpenAI-compatible API format for 100+ providers
LiteLLM Proxy — self-hosted gateway with load balancing and rate limiting
Budget tracking and cost logging per model and per user
Fallbacks — automatically retry on a different model if one fails
Streaming support across all providers
Async support (acompletion, aembedding)
Consistent error types across providers
Router — distribute load across multiple deployments of the same model

References & Links

Free Open Source · MIT
View on GitHub Visit Homepage

Project Info

Language Python
License MIT
Stars 19.0k ★
Forks 2.4k
Category Developer Tools

Topics

API ProxyMulti-ProviderPythonOpenAI CompatibleLoad Balancing

Ready to try LiteLLM?

Free and open source. Install in one command, works with Claude Code, Cursor, Windsurf, and more.

$pip install litellm
← Back to Marketplace