What is LiteLLM?
LiteLLM is Llama a más de 100 proveedores de LLM con una única API compatible con OpenAI. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in Python. To get started: instala el SDK de Python.
Resumen

LiteLLM es una pasarela de IA de código abierto que te ofrece una interfaz única y unificada para llamar a más de 100 proveedores de LLM, como OpenAI, Anthropic, Gemini, Bedrock y Azure, todos con el formato de peticiones de OpenAI. En lugar de manejar un SDK, un patrón de autenticación y un tipo de error distintos para cada modelo, escribes tu código una vez y cambias de proveedor cambiando el nombre del modelo.
Puedes usarlo de dos formas. Como SDK de Python, importas la función `completion` y llamas a cualquier modelo directamente desde tu aplicación. Como AI Gateway (servidor proxy), lo despliegas como un servicio central al que apunta todo tu equipo, con claves virtuales, seguimiento del gasto y balanceo de carga gestionados en un solo lugar.
Como gateway de LLM, LiteLLM se sitúa entre tus apps y los proveedores de modelos. Encaja con equipos que quieren estandarizar cómo acceden a los modelos, mantener el código de cliente compatible con OpenAI y añadir seguimiento de costes, presupuestos y mecanismos de respaldo (fallbacks) sin reescribir cada integración.
Qué hace
- Una API unificada para más de 100 LLM, para que no tengas que usar SDK específicos de cada proveedor
- Compatibilidad total con OpenAI: cambia de proveedor modificando la cadena del modelo, no tu código
- Servidor proxy (AI Gateway) con claves virtuales, seguimiento del gasto, guardrails y balanceo de carga
- Panel de administración para gestionar claves y monitorizar el uso desde el primer momento
- Admite muchos tipos de endpoint: chat/completions, responses, embeddings, imágenes, audio, batches y rerank
- Puede invocar agentes A2A (LangGraph, Vertex AI Agent Engine, Bedrock AgentCore, Pydantic AI) mediante el SDK o el gateway
Primeros pasos
LiteLLM funciona como SDK de Python para llamadas directas o como servidor proxy para todo tu equipo. Elige una opción para empezar.
Instala el SDK de Python
Añade LiteLLM a tu proyecto.
uv add litellmHaz tu primera llamada
Configura las claves de API de los proveedores que necesites y luego llama a cualquier modelo con la función `completion` en formato OpenAI. Cambia de proveedor modificando la cadena del modelo.
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!"}])O ejecuta el AI Gateway (servidor proxy)
Instala el extra del proxy e inícialo apuntando a un modelo. Sirve un endpoint compatible con OpenAI en el puerto 4000.
uv tool install 'litellm[proxy]'
litellm --model gpt-4oLlama al gateway con el cliente de OpenAI
Apunta cualquier cliente de OpenAI a la URL base del proxy local para enrutar las peticiones a través de LiteLLM.
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!"}]
)Commands and code are distilled from the project's own documentation — always check the repositorio oficial para lo último.
Cuándo usarlo
- Crear una app que cambie entre OpenAI, Anthropic y Gemini sin reescribir el código del cliente
- Ejecutar un gateway central para que todo un equipo comparta un endpoint con claves virtuales y seguimiento del gasto por equipo
- Añadir fallbacks y balanceo de carga entre proveedores para que las peticiones sigan funcionando cuando un modelo no esté disponible
- Estandarizar las llamadas a muchos tipos de endpoint (chat, embeddings, imágenes, audio, rerank) detrás de una sola API en formato OpenAI
Historial de versiones
Every verified update to LiteLLM that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.
- 2026-10-21v1.107.0
Security incident: the release pipeline was compromised, and litellm 1.107.0 on PyPI plus the v1.107.0, latest, main-latest and main-stable Docker Hub and GHCR images shipped malware that steals credentials and loads remote-code-execution tooling. LiteLLM advises pinning 1.106.2, rebuilding affected environments and rotating every secret the host could reach.
- 2026-09-22v1.102.0
post_call guardrail pipelines now execute on streaming responses, rewriting text and tool calls mid-stream, with legacy post-call hooks running as steps in that pipeline. Streaming latency routing ranks by raw time-to-first-token and adds percentile-based selection, an OCR core arrives with Mistral, Azure, Vertex and Reducto adapters, and an in-container pgbouncer pools connections across workers.
- 2026-09-15v1.101.0
A 1,902-commit release built around routing: heuristic v2 complexity routing, a classifier circuit breaker, auto-escalation for stalled router tasks, and opt-in modality-based routing for image requests. The native MCP Gateway gains semantic tool search, cost tracking learns time-based off-peak pricing, and OpenAI calls can use OIDC token exchange.
- 2026-09-06v1.100.0
LiteLLM v1.100.0 adds native Vertex AI Interactions API support, Grounding with Bing Search as a search provider, and day-0 routing for gemini-3.5-transcribe. Budgets can now be shared across a model access group, backed by a new per-window spend table, and prompt_token_calculator was deleted from utils.
- 2026-08-23v1.98.0
LiteLLM v1.98.0 adds provisioned-throughput billing (flat cost for reserved capacity instead of per-token), shadow evals for the auto-router, and a per-key prompt caching switch.
LiteLLM in the news
- 2026-10-21MAYORLiteLLM 1.107.0 compromised — PyPI and Docker builds stole credentials
- 2026-09-22MAYORLiteLLM v1.102.0 — guardrails finally run on streaming responses
- 2026-09-15MAYORLiteLLM v1.101.0 — smarter complexity routing and a semantic MCP search
- 2026-09-06MAYORLiteLLM v1.100.0 — Vertex AI Interactions API and shared team budgets
- 2026-08-23MAYORLiteLLM v1.98.0 — reserved capacity gets flat-cost billing, not per-token
- 2026-04-29MAYORLiteLLM CVE-2026-42208 — Critical SQL Injection in AI Gateway Exploited Within 36 Hours of Disclosure
- 2026-04-25DESTACADOGoModel — Lightweight AI Gateway in Go, LiteLLM Alternative
- 2026-04-15MAYORAnthropic MCP Design Flaw Enables RCE Across 150M+ Downloads
Del Feed de lanzamientos de AI/TLDR — cada elemento se verifica en la fuente al publicarse.
How LiteLLM compares
LiteLLM alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.
| Herramienta | Estrellas | Qué hace |
|---|---|---|
| OmniRoute | ★ 91.4k | A local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression. |
| Free Claude Code | ★ 74.7k | A local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI. |
| LiteLLM | ★ 64.2k | Llama a más de 100 proveedores de LLM con una única API compatible con OpenAI |
| Kong Gateway | ★ 44.4k | A Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance. |
| magpie | ★ 43.7k | Menu bar app and local gateway that lets Claude Code, Codex, Gemini CLI and dozens of other coding agents run on any provider's model, with routing groups that fail over across accounts when a quota runs out. |
| 9Router | ★ 33k | Local OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens. |
| Experiential | ★ 20.1k | An open-source gateway that puts hosted, BYOK, local and custom models behind one OpenAI-compatible API, with per-identity model and spend limits and routers fitted from your own traces. |
| OpenCodex | ★ 18.8k | Local proxy that translates the Codex Responses API to 40+ providers, so Codex CLI, Claude Code and Grok Build can run on any model, with routing combos, failover and account pooling. |

