LiteLLM is a free, open source ai development platforms project written in Python and released under a custom open-source licence. It has 59,003 GitHub stars, 11,534 forks and 5,022 open issues, and was last pushed 5 hours ago. On this registry it ranks #13 of 61 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 425 stars over the last 6 tracked days.

What is LiteLLM?

What it is

LiteLLM is an open-source AI gateway that provides a unified interface to call over 100 large language model (LLM) providers—including OpenAI, Anthropic, Azure OpenAI, Amazon Bedrock, Google VertexAI, and vLLM—using the OpenAI-compatible API format. It runs as both a Python SDK for direct integration and as a standalone proxy server for centralized, team- or organization-wide use.

The project solves the fragmentation problem in LLM integration: developers typically face inconsistent SDKs, authentication schemes, request/response formats, and error handling across providers. LiteLLM abstracts this complexity, enabling code portability between models and providers without rewriting application logic.

Key capabilities

  • Unified /chat/completions, /embeddings, /images, /audio, /batches, /rerank, /a2a, and /messages endpoints across 100+ LLM providers
  • Drop-in OpenAI-compatible API: existing OpenAI SDK code works unchanged with any supported provider
  • Virtual keys for access control, per-key spend tracking, and rate limiting
  • Spend tracking and cost monitoring across providers with configurable budget alerts
  • Guardrails (input/output filtering), load balancing across models, and request logging
  • A2A agent protocol support for invoking agents from providers like LangGraph, Vertex AI Agent Engine, and Bedrock AgentCore
  • Self-hosted proxy server with admin dashboard for key management and usage analytics

Who uses it and how

  • Engineering teams at companies like Netflix use LiteLLM to standardize LLM access across internal tools and reduce vendor lock-in
  • Developers integrate LiteLLM as a Python SDK to switch between models (e.g., GPT-4o vs. Claude Sonnet) during testing or fallback scenarios
  • DevOps teams deploy the LiteLLM proxy server as a centralized gateway in Kubernetes or Docker, routing requests to multiple providers with custom routing rules

Getting started

Install via uv add litellm or uv tool install 'litellm[proxy]', then run the proxy with litellm --model gpt-4o. The proxy listens on port 4000 by default and accepts standard OpenAI SDK calls against base_url="http://localhost:4000". Hosted options and enterprise tiers are available via docs.litellm.ai.

When to use it — and when not to

Use LiteLLM when you need multi-provider LLM support with minimal code changes, spend visibility, or centralized access control. It replaces paid API management tools but requires self-hosting infrastructure (e.g., database for key storage, object storage for logs) and operational effort for updates and scaling. Avoid if you only use one LLM provider or cannot maintain a proxy service—its value is in abstraction across providers, not optimizing for a single one.

project readme (upstream, from github) — read inline

🚅 LiteLLM

LiteLLM AI Gateway

Open Source AI Gateway for 100+ LLMs. Self-hosted. Enterprise-ready. Call any LLM in OpenAI format.

Deploy to Render Deploy on Railway

LiteLLM Proxy Server (AI Gateway) | Hosted Proxy | Enterprise Tier | Website

PyPI Version GitHub Stars Y Combinator W23 Whatsapp Discord Slack CodSpeed

LiteLLM AI Gateway

What is LiteLLM

LiteLLM is an open source AI Gateway that gives you a single, unified interface to call 100+ LLM providers — OpenAI, Anthropic, Gemini, Bedrock, Azure, and more — using the OpenAI format.

Use it as a Python SDK for direct library integration, or deploy the AI Gateway (Proxy Server) as a centralized service for your team or organization.

Jump to LiteLLM Proxy (LLM Gateway) Docs
Jump to Supported LLM Providers


Why LiteLLM

Managing LLM calls across providers gets complicated fast — different SDKs, auth patterns, request formats, and error types for every model. LiteLLM removes that friction:

  • Unified API — one interface for 100+ LLMs, no provider-specific SDK juggling
  • Drop-in OpenAI compatibility — swap providers without rewriting your code
  • Production-ready gateway — virtual keys, spend tracking, guardrails, load balancing, and an admin dashboard out of the box
  • 8ms P95 latency at 1k RPS (benchmarks)

OSS Adopters

Stripe image Google ADK Greptile OpenHands

Netflix

OpenAI Agents SDK

Features

LLMs - Call 100+ LLMs (Python SDK + AI Gateway)

All Supported Endpoints - /chat/completions, /responses, /embeddings, /images, /audio, /batches, /rerank, /a2a, /messages and more.

Python SDK

uv add litellm
from litellm import completion
import os

os.environ["OPENAI_API_KEY"] = "your-openai-key"
os.environ["ANTHROPIC_API_KEY"] = "your-anthropic-key"

# OpenAI
response = completion(model="openai/gpt-4o", messages=[{"role": "user", "content": "Hello!"}])

# Anthropic  
response = completion(model="anthropic/claude-sonnet-4-20250514", messages=[{"role": "user", "content": "Hello!"}])

AI Gateway (Proxy Server)

Getting Started - E2E Tutorial - Setup virtual keys, make your first request

uv tool install 'litellm[proxy]'
litellm --model gpt-4o
import openai

client = openai.OpenAI(api_key="anything", base_url="http://0.0.0.0:4000")
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

Docs: LLM Providers

Agents - Invoke A2A Agents (Python SDK + AI Gateway)

Supported Providers - LangGraph, Vertex AI Agent Engine, Azure AI Foundry, Bedrock AgentCore, Pydantic AI

Python SDK - A2A Protocol

from litellm.a2a_protocol import A2AClient
from a2a.types import SendMessageRequest, MessageSendParams
from uuid import uuid4

client = A2AClient(base_url="http://localhost:10001")

request = SendMessageRequest(
    id=str(uuid4()),
    params=MessageSendParams(
        message={
            "role": "user",
            "parts": [{"kind": "text", "text": "Hello!"}],
            "messageId": uuid4().hex,
        }
    )
)
response = await client.send_message(request)

AI Gateway (Proxy Server)

Step 1. Add your Agent to the AI Gateway — set protocolVersion to 1.0 or 0.3 per agent

Step 2. Call Agent via A2A SDK (requires a2a-sdk>=1.1.0)

import httpx
from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
from a2a.types import Message, Part, Role, SendMessageRequest
from a2a.utils.constants import TransportProtocol
from uuid import uuid4

base_url = "http://localhost:4000/a2a/my-agent"  # LiteLLM proxy + agent name
headers = {"Authorization": "Bearer sk-1234"}    # LiteLLM Virtual Key

async with httpx.AsyncClient(headers=headers, timeout=60.0) as http_client:
    resolver = A2ACardResolver(httpx_client=http_client, base_url=base_url)
    agent_card = await resolver.get_agent_card()
    config = ClientConfig(
        httpx_client=http_client,
        streaming=False,
        supported_protocol_bindings=[TransportProtocol.JSONRPC, TransportProtocol.HTTP_JSON],
    )
    client = ClientFactory(config).create(agent_card)

    request = SendMessageRequest(
        message=Message(
            message_id=uuid4().hex,
            role=Role.ROLE_USER,
            parts=[Part(text="Hello!")],
        )
    )
    async for event in client.send_message(request):
        populated = event.ListFields()
        if populated and populated[0][0].name in ("message", "msg"):
            print("".join(getattr(p, "text", "") or "" for p in populated[0][1].parts))

Docs: A2A Agent Gateway

MCP Tools - Connect MCP servers to any LLM (Python SDK + AI Gateway)

Python SDK - MCP Bridge

from mcp import ClientSessi

readme truncated — read the full docs on github

Frequently asked questions

Is LiteLLM free to use?

LiteLLM is open source. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does LiteLLM do?

LLM gateway for auth, load balancing, and spend tracking

What is LiteLLM written in?

LiteLLM is primarily written in Python. Its source is publicly available at https://github.com/berriai/litellm, and it has 59,003 GitHub stars.