█

AI/TLDR

Me pague um café
Me pague um café

LiteLLM

Chame 100+ provedores de LLM por uma única API compatível com OpenAI

Gateways & RoutingCódigo aberto
Latest
v1.107.0
Atualizado
21 Oct 2026
Idioma
Python
Coverage
8 stories
$uv add litellm

What's new

v1.107.021 Oct 2026

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.

Últimas notícias

all 8 ↓
EM RESUMO

What is LiteLLM?

LiteLLM is Chame 100+ provedores de LLM por uma única API compatível com OpenAI. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in Python. To get started: instale o SDK Python.

Atualizado Versão em Markdown ↗

Visão geral

Diagram: a developer calls LiteLLM in the centre, which fans out to A2A agents, MCP tools and LLM APIs from OpenAI, Anthropic and Google
The gateway shape: application code talks to LiteLLM, and LiteLLM talks to A2A agents, MCP tools and the provider APIs behind them.BerriAI/litellm README ↗

LiteLLM é um gateway de IA de código aberto que oferece uma interface única e unificada para chamar 100+ provedores de LLM, incluindo OpenAI, Anthropic, Gemini, Bedrock e Azure, usando sempre o formato de requisição da OpenAI. Em vez de lidar com um SDK, um padrão de autenticação e um tipo de erro diferente para cada modelo, você escreve seu código uma única vez e troca de provedor mudando o nome do modelo.

Você pode usá-lo de duas formas. Como SDK Python, importa a função `completion` e chama qualquer modelo diretamente na sua aplicação. Como AI Gateway (servidor proxy), você o implanta como um serviço central que toda a sua equipe usa, com chaves virtuais, controle de gastos e balanceamento de carga gerenciados em um só lugar.

Como gateway de LLM, o LiteLLM fica entre suas aplicações e os provedores de modelos. Ele é indicado para equipes que querem padronizar o acesso aos modelos, manter o código do cliente compatível com a OpenAI e adicionar controle de custos, orçamentos e fallbacks sem reescrever cada integração.

O que faz

  • Uma API unificada para 100+ LLMs, para você evitar SDKs específicos de cada provedor
  • Compatibilidade direta com a OpenAI — troque de provedor mudando a string do modelo, não o seu código
  • Servidor proxy (AI Gateway) com chaves virtuais, controle de gastos, guardrails e balanceamento de carga
  • Painel de administração para gerenciar chaves e acompanhar o uso, já pronto para usar
  • Suporta vários tipos de endpoint: chat/completions, responses, embeddings, imagens, áudio, batches e rerank
  • Pode invocar agentes A2A (LangGraph, Vertex AI Agent Engine, Bedrock AgentCore, Pydantic AI) pelo SDK ou pelo gateway

Primeiros passos

O LiteLLM funciona como SDK Python para chamadas diretas ou como servidor proxy para toda a sua equipe. Escolha um para começar.

Instale o SDK Python

Adicione o LiteLLM ao seu projeto.

bashbash
uv add litellm

Faça sua primeira chamada

Defina as chaves de API dos provedores de que você precisa e chame qualquer modelo com a função `completion` no formato da OpenAI. Troque de provedor mudando a string do modelo.

pythonpython
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!"}])

Ou execute o AI Gateway (servidor proxy)

Instale o extra do proxy e inicie-o apontando para um modelo. Ele serve um endpoint compatível com a OpenAI na porta 4000.

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

Chame o gateway com o cliente da OpenAI

Aponte qualquer cliente da OpenAI para a URL base do proxy local para direcionar as requisições pelo LiteLLM.

pythonpython
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 repositório oficial para as novidades.

Quando usar

  • Crie um aplicativo que alterna entre OpenAI, Anthropic e Gemini sem reescrever o código do cliente
  • Rode um gateway central para que uma equipe compartilhe um único endpoint, com chaves virtuais e controle de gastos por equipe
  • Adicione fallbacks e balanceamento de carga entre provedores para manter as requisições fluindo quando um modelo está fora do ar
  • Padronize chamadas a vários tipos de endpoint (chat, embeddings, imagens, áudio, rerank) por trás de uma única API no formato OpenAI

Histórico de versões

Every verified update to LiteLLM that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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

  1. 2026-10-21GRANDELiteLLM 1.107.0 compromised — PyPI and Docker builds stole credentials
  2. 2026-09-22GRANDELiteLLM v1.102.0 — guardrails finally run on streaming responses
  3. 2026-09-15GRANDELiteLLM v1.101.0 — smarter complexity routing and a semantic MCP search
  4. 2026-09-06GRANDELiteLLM v1.100.0 — Vertex AI Interactions API and shared team budgets
  5. 2026-08-23GRANDELiteLLM v1.98.0 — reserved capacity gets flat-cost billing, not per-token
  6. 2026-04-29GRANDELiteLLM CVE-2026-42208 — Critical SQL Injection in AI Gateway Exploited Within 36 Hours of Disclosure
  7. 2026-04-25NOTÁVELGoModel — Lightweight AI Gateway in Go, LiteLLM Alternative
  8. 2026-04-15GRANDEAnthropic MCP Design Flaw Enables RCE Across 150M+ Downloads

Do Feed de lançamentos do AI/TLDR — cada item é verificado na fonte quando é publicado.

How LiteLLM compares

LiteLLM alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

FerramentaEstrelasO que faz
OmniRoute★ 91.4kA 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.7kA 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.2kChame 100+ provedores de LLM por uma única API compatível com OpenAI
Kong Gateway★ 44.4kA 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.7kMenu 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★ 33kLocal 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.1kAn 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.8kLocal 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.