LiteLLM

Call 100+ LLM APIs from OpenAI to Anthropic to Bedrock through one unified, OpenAI-format Python interface.

Library
PyPI
v1.103.0
59,739 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 100
Maintenance 100
Community 76
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
90 /100 Excellent
Architecture 90
Code Quality 89
Innovation 92
Learning Curve 85

LiteLLM is an open-source Python library that gives you a single, consistent way to call more than 100 large-language-model providers — OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, Vertex AI, vLLM, and many more — all in the familiar OpenAI request/response format. Instead of juggling a different SDK, auth pattern, and error type for every model, you import one completion() function and swap providers by changing a model string.

Beyond the core SDK, the same project ships an AI Gateway (proxy server) that adds virtual keys, spend tracking, load balancing, guardrails, and logging for teams that need centralized control. The library itself stays lightweight and importable, making it a drop-in translation layer between your application code and whichever LLM you point it at.

What You Get

  • A single completion() / acompletion() interface that works across 100+ LLM providers without provider-specific SDKs
  • Drop-in OpenAI-format requests and responses, so existing OpenAI code works by changing only the model string
  • Built-in streaming, async, embeddings, image, audio, batch, and rerank endpoints
  • Consistent exception types mapped from every provider’s native error format
  • Cost tracking and token counting across models via a bundled pricing map
  • An optional AI Gateway (proxy server) for virtual keys, spend limits, load balancing, and logging

Common Use Cases

  • Building provider-agnostic applications that can switch between OpenAI, Anthropic, Gemini, and Bedrock without code rewrites
  • Adding fallback and load balancing across multiple LLMs for reliability
  • Centralizing spend tracking and rate limiting for an organization’s LLM usage through the gateway
  • Prototyping against many models quickly to compare quality, latency, and cost

Under The Hood

Architecture - LiteLLM is layered around a thin public surface in litellm/main.py that exposes completion, acompletion, embedding, and related entrypoints. Each entrypoint dispatches on a provider-prefixed model string into per-provider adapter modules under litellm/llms/, which translate the OpenAI-format request into the provider’s native wire format and map the response and errors back. Cross-cutting concerns — caching (litellm/caching), cost calculation (litellm/cost_calculator.py), logging integrations (litellm/integrations), and exception normalization (litellm/exceptions.py) — are composed via a client decorator applied at function-definition time. The optional proxy/gateway layer wraps this same core in a FastAPI server with routing, virtual keys, and spend tracking.

Tech Stack - The core SDK depends on httpx and aiohttp for transport, openai for format compatibility, pydantic v2 for typed models, tiktoken and tokenizers for token counting, and jinja2 for prompt templating. The proxy extra pulls in FastAPI, Uvicorn/Granian, Redis (rq), boto3, cryptography, and MCP. A Rust core (litellm-rust) accelerates hot paths, and the project targets Python 3.10–3.14. Reproducibility is pinned via uv.lock.

Code Quality - The repository is heavily tested, with over 2,600 Python test files under tests/, and enforces strict static analysis through ruff (strict config plus budgets), basedpyright, and flake8. CI runs via CircleCI with codecov coverage tracking, and the code uses extensive type hints and a large typing surface in the core modules. The scale of the provider matrix makes some modules large, but error handling is centralized and consistently mapped.

API Design - The developer experience is the project’s standout: getting started requires only pip install litellm, setting a provider API key, and calling completion(model=..., messages=[...]), mirroring the OpenAI SDK so existing code ports with near-zero boilerplate. Switching providers is a one-string change, async and streaming follow predictable naming (acompletion, stream=True), and errors surface as familiar OpenAI-style exceptions. Documentation is thorough, with a dedicated docs site, a cookbook/ of examples, and an examples/ directory.

Used by 27 apps in this directory

Python
99%
MIT

Agent Lightning

AI Development

18,515

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
85
Repo Health
68
Technical
69
Dependency
Built with
Python 99%
Updated 5 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 6 days ago
Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 5 days ago
Python
92%
Apache 2.0

ART

AI Development

10,779

Give your LLM agents on-the-job training—ART lets you apply GRPO reinforcement learning to any multi-step agentic workflow with minimal code changes.

View details
85
Repo Health
82
Technical
73
Dependency
Built with
Python 92%
Updated 6 days ago
Python
66%
Other

AutoGPT

AI Assistants · Automation · Productivity

187,596

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
66
Dependency
Built with
Python 66%
TypeScript 33%
Updated 5 days ago
Python
79%
Apache 2.0

changedetection.io

Monitoring

34,605

Self-hosted website change detection with AI-powered smart alerts, browser automation, price tracking, and 85+ notification channels.

View details
91
Repo Health
80
Technical
68
Dependency
Built with
Python 79%
Updated 1 weeks ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 5 days ago
Go
32%
Apache 2.0

CubeSandbox

AI Agents · Developer Tools · Security

12,728

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
82
Repo Health
88
Technical
63
Dependency
Built with
Go 32%
Rust 26%
C 22%
Updated 1 weeks ago
Python
65%
MIT

Flowfile

Data Engineering

363

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python 65%
Vue 17%
TypeScript 17%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers