From 095ea5e882a7725709265c044ad64fbed6ac9224 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 16 Sep 2026 15:28:24 +0200 Subject: [PATCH] refactor(ai): preload one small chat model everywhere instead of a CI-only list The catalogue held three models and the development inventory carried a second, CI-only list that both AI roles pulled in through their variant 0. That made the model a variant concern and split one fact across a group_var, an inventory file and two meta files. AI_LOCAL_MODELS now holds the single entry the CI list held, qwen2.5 0.5b instruct at 531 MB in Q8_0, which lms get is already proven to fetch in this stack. AI_LOCAL_MODELS_CI and both variant overrides are gone, so variant 0 states only container_backup and the memory limits. The dropped entries have no consumer: llama3, mistral and nomic appear solely in test fixtures that stub the lookups, and nothing requests an embedding model, the only embed matches being the filters that exclude one when picking the chat model. LITELLM_CHAT_MODEL takes the first non-embed alias, so it resolves and LITELLM_USABLE stays true. Note this changes production, not only CI: a deployment no longer pulls a 7B model or an embedding model. It also shrinks the pre-pull that burned 18796s in job 104622514450 from gigabytes to 531 MB. Co-Authored-By: Claude Opus 5 (1M context) --- group_vars/all/16_ai.yml | 12 +++--------- inventories/development/default.yml | 5 ----- roles/svc-ai-lmstudio/meta/variants.yml | 1 - roles/svc-ai-ollama/meta/variants.yml | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/group_vars/all/16_ai.yml b/group_vars/all/16_ai.yml index 65c6f27bcd..5a5c5f2870 100644 --- a/group_vars/all/16_ai.yml +++ b/group_vars/all/16_ai.yml @@ -22,15 +22,9 @@ LITELLM_LMSTUDIO_BACKEND: >- and (lookup('config', 'svc-ai-litellm', 'services.lmstudio.shared') | bool) }} AI_LOCAL_MODELS: - - alias: llama3:latest - name: llama-3.2-3b-instruct - source: https://huggingface.co/lmstudio-community/Llama-3.2-3B-Instruct-GGUF - - alias: mistral:latest - name: mistral-7b-instruct-v0.3 - source: https://huggingface.co/lmstudio-community/Mistral-7B-Instruct-v0.3-GGUF - - alias: nomic-embed-text:latest - name: text-embedding-nomic-embed-text-v1.5 - source: https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF + - alias: qwen2.5:0.5b + name: qwen2.5-0.5b-instruct + source: https://huggingface.co/lmstudio-community/Qwen2.5-0.5B-Instruct-GGUF AI_REMOTE_ALIASES: >- {{ ['openai/gpt-4o-mini'] * (lookup('api_enabled', 'openai') | int) diff --git a/inventories/development/default.yml b/inventories/development/default.yml index 09aa0a54dd..e498260df5 100644 --- a/inventories/development/default.yml +++ b/inventories/development/default.yml @@ -35,11 +35,6 @@ design: colors: base: "#FFA500" -AI_LOCAL_MODELS_CI: - - alias: qwen2.5:0.5b - name: qwen2.5-0.5b-instruct - source: https://huggingface.co/lmstudio-community/Qwen2.5-0.5B-Instruct-GGUF - API: openai: api_key: "{{ lookup('env', 'INFINITO_API_OPENAI_KEY') }}" diff --git a/roles/svc-ai-lmstudio/meta/variants.yml b/roles/svc-ai-lmstudio/meta/variants.yml index 5ffa7b228c..5a12caf234 100644 --- a/roles/svc-ai-lmstudio/meta/variants.yml +++ b/roles/svc-ai-lmstudio/meta/variants.yml @@ -6,6 +6,5 @@ container_backup: enabled: true lmstudio: - preload_models: "{{ AI_LOCAL_MODELS_CI }}" mem_reservation: 1g mem_limit: 2g diff --git a/roles/svc-ai-ollama/meta/variants.yml b/roles/svc-ai-ollama/meta/variants.yml index 4e89b5aa75..6b9ad2d919 100644 --- a/roles/svc-ai-ollama/meta/variants.yml +++ b/roles/svc-ai-ollama/meta/variants.yml @@ -11,6 +11,5 @@ container_backup: enabled: true ollama: - preload_models: "{{ AI_LOCAL_MODELS_CI }}" mem_reservation: 1g mem_limit: 2g