diff --git a/.claude/commands/update-litellm-models.md b/.claude/commands/update-litellm-models.md index d41a975c..c4f7051e 100644 --- a/.claude/commands/update-litellm-models.md +++ b/.claude/commands/update-litellm-models.md @@ -2,16 +2,18 @@ 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. +Update the LiteLLM model configuration to use the latest available model IDs, removing outdated versions. Also update the Ollama pull script and sync LiteLLM's local Ollama entries. -## Config file location +## Config file locations -Read the current config via: +Read the current LiteLLM config via: ```bash docker exec litellm cat /app/config.yaml ``` -The source file is at `docker/ai/litellm/config/config.yaml`. +Source files: +- `docker/ai/litellm/config/config.yaml` — LiteLLM model list +- `scripts/get-offline-data-ollama.sh` — Ollama model pull script ## Step 1: Look up latest models per provider (run searches in parallel) @@ -23,38 +25,66 @@ Search the web for the current model IDs for each provider present in the config - **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" +- **Ollama local (≤3B)**: Search "best 3B LLM model Ollama benchmark" → check https://ollama.com/library +- **Ollama local (≤8B)**: Search "best 8B LLM model Ollama benchmark" → check https://ollama.com/library 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 +For Ollama local models, pick the **best-performing model** in each size class based on current benchmarks (HumanEval, MMLU, etc.), not just the newest release date. + ## Step 2: Determine what to change +### LiteLLM cloud models + 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 +### Ollama local models (`scripts/get-offline-data-ollama.sh`) + +The script must always include exactly: +- **One model ≤3B** — best benchmark performer in this size class (e.g. `phi4-mini`) +- **One model ≤8B** — best benchmark performer in this size class (e.g. `qwen3:8b`) +- **Embedding models** — keep as-is unless a clearly better alternative exists + +Update both the pull tags and the inline comments with model size. + +### LiteLLM Ollama entries sync + +After updating `get-offline-data-ollama.sh`, update the `ollama-local-*` entries in `config.yaml` to match: +- `ollama_chat/` must reflect the exact tag used in the pull script +- Update the comment line above each entry (e.g. `# Local model - Phi 4 Mini (3.8B)`) +- Do **not** change `api_base` or `api_key` references -Write the updated config using: +## Step 3: Update the files + +Write the updated LiteLLM config using: ```bash tee "$(git rev-parse --show-toplevel)/docker/ai/litellm/config/config.yaml" > /dev/null << 'EOF' EOF ``` -Also update `router_settings.fallbacks` to reflect any renamed models. +Write the updated Ollama script using: +```bash +tee "$(git rev-parse --show-toplevel)/scripts/get-offline-data-ollama.sh" > /dev/null << 'EOF' + +EOF +``` + +Also update `router_settings.fallbacks` in `config.yaml` to reflect any renamed models. ## Step 4: Verify -Confirm the file was written correctly: +Confirm the LiteLLM config was written correctly: ```bash docker exec litellm cat /app/config.yaml ``` diff --git a/docker/ai/litellm/config/config.yaml b/docker/ai/litellm/config/config.yaml index 6ada0b21..9b4b7f01 100644 --- a/docker/ai/litellm/config/config.yaml +++ b/docker/ai/litellm/config/config.yaml @@ -41,14 +41,14 @@ model_list: # Create API key: https://platform.openai.com/api-keys # Buy credits: https://platform.openai.com/settings/organization/billing/overview - - model_name: gpt-5 + - model_name: gpt-5.4 litellm_params: - model: openai/gpt-5 + model: openai/gpt-5.4 api_key: "os.environ/OPENAI_API_KEY" - - model_name: gpt-5-mini + - model_name: gpt-5.4-mini litellm_params: - model: openai/gpt-5-mini + model: openai/gpt-5.4-mini api_key: "os.environ/OPENAI_API_KEY" # --- Via Google @@ -109,20 +109,26 @@ model_list: model: openrouter/deepseek/deepseek-r1 api_key: "os.environ/OPENROUTER_API_KEY" - # https://openrouter.ai/x-ai/grok-code-fast-1 - - model_name: grok-code-fast-1 + # https://openrouter.ai/x-ai/grok-4.1-fast + - model_name: grok-4.1-fast litellm_params: - model: openrouter/x-ai/grok-code-fast-1 + model: openrouter/x-ai/grok-4.1-fast + api_key: "os.environ/OPENROUTER_API_KEY" + + # https://openrouter.ai/z-ai/glm-5.1 + - model_name: glm-5.1 + litellm_params: + model: openrouter/z-ai/glm-5.1 api_key: "os.environ/OPENROUTER_API_KEY" # --- Local models (Ollama) # LiteLLM provider: https://docs.litellm.ai/docs/providers/ollama#using-ollama-apichat # Models: https://ollama.com/search - # Local model - Phi 3.5 + # Local model - Phi 4 Mini (3.8B) - model_name: ollama-local-phi litellm_params: - model: ollama_chat/phi3.5:3.8b + model: ollama_chat/phi4-mini api_base: "os.environ/LOCAL_OLLAMA_API_BASE" api_key: "none" @@ -135,9 +141,9 @@ model_list: router_settings: fallbacks: - - gpt-5: + - gpt-5.4: - gpt-4.1 - - gpt-5-mini: + - gpt-5.4-mini: - gpt-4.1-mini - ollama-mac-mistral: - ollama-local-phi diff --git a/scripts/get-offline-data-ollama.sh b/scripts/get-offline-data-ollama.sh index c34f3d52..0a382eff 100755 --- a/scripts/get-offline-data-ollama.sh +++ b/scripts/get-offline-data-ollama.sh @@ -20,8 +20,8 @@ ollama_pull() { } # Large Language Models - https://ollama.com/search -ollama_pull llama3.2:latest -ollama_pull qwen2.5-coder:7b +ollama_pull phi4-mini # 3.8B - best-in-class sub-4B; 128K ctx +ollama_pull qwen3:8b # 8B - best-in-class 7-8B; hybrid thinking, top HumanEval # Embedding Models - https://ollama.com/search?c=embedding ollama_pull nomic-embed-text