Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .claude/commands/update-litellm-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
description: Update LiteLLM config/config.yaml to use the latest model versions from each provider
---

Update the LiteLLM model configuration to use the latest available model IDs, removing outdated versions.

## Config file location

Read the current config via:
```bash
docker exec litellm cat /app/config.yaml
```

The source file is at `docker/ai/litellm/config/config.yaml`.

## Step 1: Look up latest models per provider (run searches in parallel)

Search the web for the current model IDs for each provider present in the config:

- **Anthropic**: Search "Anthropic Claude latest models API model IDs" → check https://docs.anthropic.com/en/docs/about-claude/models/overview
- **OpenAI**: Search "OpenAI latest models API model IDs" → check https://platform.openai.com/docs/models
- **Google Gemini**: Search "Google Gemini latest models API model IDs" → check https://ai.google.dev/gemini-api/docs/models
- **OpenRouter (Meta Llama)**: Search "Meta Llama latest models openrouter model IDs"
- **OpenRouter (DeepSeek)**: Search "DeepSeek latest models openrouter model IDs"
- **OpenRouter (xAI Grok)**: Search "xAI Grok latest models openrouter model IDs"

For each provider, identify:
1. The **latest stable** model ID (not preview/experimental unless that's the only option)
2. Whether the currently configured model has been **superseded** by a newer release
3. The **exact API model ID string** to use in LiteLLM params

## Step 2: Determine what to change

For each model in the config, decide:
- **Update**: A newer stable version exists → update the `model_name` key and `litellm_params.model` value
- **Keep**: Still the latest stable model → no change needed
- **Remove**: Superseded by a newer model already listed in the same config (avoid duplicates)

Preserve without changes:
- Local Ollama models (`ollama_chat/...`) — these are managed separately
- The overall YAML structure, comments, and provider groupings
- `api_key` and `api_base` references

## Step 3: Update the file

Write the updated config using:
```bash
tee "$(git rev-parse --show-toplevel)/docker/ai/litellm/config/config.yaml" > /dev/null << 'EOF'
<updated content>
EOF
```

Also update `router_settings.fallbacks` to reflect any renamed models.

## Step 4: Verify

Confirm the file was written correctly:
```bash
docker exec litellm cat /app/config.yaml
```

## LiteLLM model ID format reference

| Provider | LiteLLM format |
| ---------------------- | ---------------------------------- |
| Anthropic (direct) | `anthropic/<model-id>` |
| OpenAI (direct) | `openai/<model-id>` |
| Google Gemini (direct) | `gemini/<model-id>` |
| OpenRouter | `openrouter/<provider>/<model-id>` |
| Ollama (local) | `ollama_chat/<model-name>` |

Example: `openrouter/meta-llama/llama-4-maverick`, `anthropic/claude-sonnet-4-6`

## Summary output

After completing the update, show a table of what changed:

| Model | Old ID | New ID | Action |
| ----- | ------ | ------ | ------------------------ |
| ... | ... | ... | Updated / Removed / Kept |
43 changes: 19 additions & 24 deletions docker/ai/litellm/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,19 @@ model_list:
# Create API key: https://platform.claude.com/settings/keys
# Buy credits: https://platform.claude.com/settings/billing

- model_name: claude-sonnet-4-0 # RECEIVED MODEL NAME
- model_name: claude-sonnet-4-6 # RECEIVED MODEL NAME
litellm_params: # All params accepted by litellm.completion() - https://docs.litellm.ai/docs/completion/input
model: anthropic/claude-sonnet-4-0 # MODEL NAME sent to `litellm.completion()`
model: anthropic/claude-sonnet-4-6 # MODEL NAME sent to `litellm.completion()`
api_key: "os.environ/ANTHROPIC_API_KEY" # Does os.getenv("ANTHROPIC_API_KEY")

- model_name: claude-sonnet-4-5
- model_name: claude-opus-4-6
litellm_params:
model: anthropic/claude-sonnet-4-5
api_key: "os.environ/ANTHROPIC_API_KEY"

- model_name: claude-opus-4-5
litellm_params:
model: anthropic/claude-opus-4-5
model: anthropic/claude-opus-4-6
api_key: "os.environ/ANTHROPIC_API_KEY"

- model_name: claude-haiku-4-5
litellm_params:
model: anthropic/claude-haiku-4-5
model: anthropic/claude-haiku-4-5-20251001
api_key: "os.environ/ANTHROPIC_API_KEY"

# --- Via OpenAI
Expand Down Expand Up @@ -78,16 +73,16 @@ model_list:
# Create API Key: https://openrouter.ai/settings/keys
# Buy credits: https://openrouter.ai/settings/credits

# https://openrouter.ai/openai/openai/gpt-4o
- model_name: gpt-4o
# https://openrouter.ai/openai/gpt-4.1
- model_name: gpt-4.1
litellm_params:
model: openrouter/openai/gpt-4o
model: openrouter/openai/gpt-4.1
api_key: "os.environ/OPENROUTER_API_KEY"

# https://openrouter.ai/openai/gpt-4o-mini
- model_name: gpt-4o-mini
# https://openrouter.ai/openai/gpt-4.1-mini
- model_name: gpt-4.1-mini
litellm_params:
model: openrouter/openai/gpt-4o-mini
model: openrouter/openai/gpt-4.1-mini
api_key: "os.environ/OPENROUTER_API_KEY"

# https://openrouter.ai/openai/o4-mini-high
Expand All @@ -96,16 +91,16 @@ model_list:
model: openrouter/openai/o4-mini-high
api_key: "os.environ/OPENROUTER_API_KEY"

# https://openrouter.ai/meta-llama/llama-3.3-70b-instruct
- model_name: llama-3.3-70b-instruct
# https://openrouter.ai/meta-llama/llama-4-maverick
- model_name: llama-4-maverick
litellm_params:
model: openrouter/meta-llama/llama-3.3-70b-instruct
model: openrouter/meta-llama/llama-4-maverick
api_key: "os.environ/OPENROUTER_API_KEY"

# https://openrouter.ai/deepseek/deepseek-r1-distill-llama-70b
- model_name: deepseek-r1-distill-llama-70b
# https://openrouter.ai/deepseek/deepseek-v3.2
- model_name: deepseek-v3.2
litellm_params:
model: openrouter/deepseek/deepseek-r1-distill-llama-70b
model: openrouter/deepseek/deepseek-v3.2
api_key: "os.environ/OPENROUTER_API_KEY"

# https://openrouter.ai/deepseek/deepseek-r1
Expand Down Expand Up @@ -141,8 +136,8 @@ model_list:
router_settings:
fallbacks:
- gpt-5:
- gpt-4o
- gpt-4.1
- gpt-5-mini:
- gpt-4o-mini
- gpt-4.1-mini
- ollama-mac-mistral:
- ollama-local-phi