LiteLLM

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

Library
PyPI
v1.97.0
56,703stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
92/100Excellent
Development Activity100
Maintenance100
Community76
Maturity52
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
90/100Excellent
Architecture90
Code Quality89
Innovation92
Learning Curve85

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 26 apps in this directory

Python
99%
MIT

Agent Lightning

AI Development

17,500

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
84
Repo Health
68
Technical
69
Dependency
Built with
Python99%
Updated today
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

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
TypeScript59%
Python39%
Updated today
Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

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

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
88%
Apache 2.0

ART

AI Development

10,603

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
72
Dependency
Built with
Python88%
Cuda10%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

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
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
Python
79%
Apache 2.0

changedetection.io

Monitoring

33,241

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

View details
90
Repo Health
80
Technical
69
Dependency
Built with
Python79%
Updated 3 days ago
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

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

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

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
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Python
64%
MIT

Flowfile

Data Engineering

341

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
Python64%
Vue19%
TypeScript16%
Updated today

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

Search