Getting Started Tutorial
End-to-End tutorial for LiteLLM Proxy to:
- Add an Azure OpenAI model
- Make a successful /chat/completion call
- Generate a virtual key
- Set RPM limit on virtual key
Quick Install (Recommended for local / beginners)
New to LiteLLM? This is the easiest way to get started locally. One command installs LiteLLM and walks you through setup interactively — no config files to write by hand.
1. Install
curl -fsSL https://raw.githubusercontent.com/BerriAI/litellm/main/scripts/install.sh | sh
This detects your OS, installs litellm[proxy], and drops you straight into the setup wizard.
2. Follow the wizard
$ litellm --setup
Welcome to LiteLLM
Choose your LLM providers
○ 1. OpenAI GPT-4o, GPT-4o-mini, o1
○ 2. Anthropic Claude Opus, Sonnet, Haiku
○ 3. Azure OpenAI GPT-4o via Azure
○ 4. Google Gemini Gemini 2.0 Flash, 1.5 Pro
○ 5. AWS Bedrock Claude, Llama via AWS
○ 6. Ollama Local models
❯ Provider(s): 1,2
❯ OpenAI API key: sk-...
❯ Anthropic API key: sk-ant-...
❯ Port [4000]:
❯ Master key [auto-generate]:
✔ Config saved → ./litellm_config.yaml
❯ Start the proxy now? (Y/n):
The wizard walks you through:
- Pick your LLM providers (OpenAI, Anthropic, Azure, Bedrock, Gemini, Ollama)
- Enter API keys for each provider
- Set a port and master key (or accept the defaults)
- Config is saved to
./litellm_config.yamland the proxy starts immediately
3. Make a call
Your proxy is running on http://0.0.0.0:4000. Test it:
curl -X POST 'http://0.0.0.0:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your-master-key>' \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
You can skip the curl install and run litellm --setup directly after uv tool install 'litellm[proxy]'.
Pre-Requisites
Choose your install method. Docker Compose users complete their full setup inside the tab and are done. Docker and LiteLLM CLI users continue with the steps below the tabs.
- Docker
- LiteLLM CLI
- Docker Compose (Proxy + DB)
docker pull docker.litellm.ai/berriai/litellm:main-latest
$ uv tool install 'litellm[proxy]'
Docker Compose bundles LiteLLM with a Postgres database. Follow the steps below — the proxy will be fully running by the end.
Step 1 — Pull the LiteLLM database image
LiteLLM provides a dedicated litellm-database image for proxy deployments that connect to Postgres.
docker pull ghcr.io/berriai/litellm-database:main-latest
See all available tags on the GitHub Container Registry.
Step 2 — Set up a database
Complete all three config files before running docker compose up. The proxy server will not start correctly if any of these are missing.
2.1 — Get docker-compose.yml and create .env
# Get the docker compose file
curl -O https://raw.githubusercontent.com/BerriAI/litellm/main/docker-compose.yml
# Add the master key - you can change this after setup
echo 'LITELLM_MASTER_KEY="sk-1234"' > .env
# Add the litellm salt key — cannot be changed after adding a model
# Used to encrypt/decrypt your LLM API key credentials
# Generate a strong random value: https://1password.com/password-generator/
echo 'LITELLM_SALT_KEY="sk-1234"' >> .env
# Add your model credentials
echo 'AZURE_API_BASE="https://openai-***********/"' >> .env
echo 'AZURE_API_KEY="your-azure-api-key"' >> .env
2.2 — Create config.yaml
The default docker-compose.yml starts a Postgres container at db:5432. Your config.yaml must include database_url pointing to it:
model_list:
- model_name: gpt-4o
litellm_params:
model: azure/my_azure_deployment
api_base: os.environ/AZURE_API_BASE
api_key: os.environ/AZURE_API_KEY
api_version: "2025-01-01-preview"
general_settings:
master_key: sk-1234 # 🔑 your proxy admin key (must start with sk-)
database_url: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"