Skip to main content

LiteLLM Cheatsheet

LiteLLM is a lightweight LLM API proxy providing a unified OpenAI-compatible interface for 100+ models. Features cost tracking, rate limiting, model fallback, and load balancing — the standard solution for managing multi-model API calls.

Updated: 2026-07-20·12 commands

Quick Start

``bash # Install pip install litellm

# Start proxy for a single model litellm --model gpt-4o --port 4000

# Test with curl curl -s http://localhost:4000/v1/chat/completions \ -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'

# List available models curl -s http://localhost:4000/v1/models | jq . `

Single Model Mode

Quickest way: litellm --model . Supports all OpenAI-compatible models plus Claude, Gemini, Llama, Mistral, and 100+ others through provider-specific configuration.

Multi-Model Config

For production, use a YAML config file defining multiple models with different providers, rate limits, and cost settings. Each model appears as a separate entry in the /v1/models endpoint.

Cost Management

--max-budget` sets a hard monthly cap. LiteLLM logs every request's model, tokens, and cost. The config file supports per-user and per-key spending limits for multi-tenant setups.

Startup & Modes(2)

CommandLevel
litellm --help
Show LiteLLM help
Basic
pip install litellm
Install LiteLLM
Basic

ai-server(10)

CommandLevel
litellm --model
Specify model and start proxy (core usage)
Basic
litellm --model --port
Specify proxy port
Basic
litellm --config
Start proxy with config file
Intermediate
litellm --drop-params
Drop sensitive params from requests
Intermediate
litellm --max-budget
Set monthly cost limit
Intermediate
curl localhost:4000/v1/chat/completions
Send OpenAI-compatible request through proxy
Intermediate
curl localhost:4000/v1/models
List available models through proxy
Basic
curl localhost:4000/health
Check proxy health
Basic
litellm --num_requests
Set max concurrent requests
Intermediate
litellm --request_timeout
Set request timeout (seconds)
Intermediate

FAQ

This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.