From b1c9bff15ffda84fa0617e56b505612d958a2bcf Mon Sep 17 00:00:00 2001 From: William Gill Date: Sun, 19 Apr 2026 10:41:29 -0500 Subject: [PATCH] Match init-models.sh to the live preseed list Five models from the production GPU host's current pull set. Picks up the idempotency-checking loop pattern from the source script so re-runs print "already present" instead of re-pulling. Co-Authored-By: Claude Opus 4.7 (1M context) --- deployments/ai-stack/init-models.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/deployments/ai-stack/init-models.sh b/deployments/ai-stack/init-models.sh index 1b3fd0f..dfc9714 100644 --- a/deployments/ai-stack/init-models.sh +++ b/deployments/ai-stack/init-models.sh @@ -1,12 +1,22 @@ #!/bin/sh # Preseed Ollama with the models the stack should have available at startup. # Runs once via the model-init service (see docker-compose.yml). Safe to -# re-run — `ollama pull` is a no-op for models already present. +# re-run — already-present models are skipped. # -# Add or remove pulls to taste. The host needs enough disk for everything -# listed here; check sizes at https://ollama.com/library before adding. +# Add or remove tags to taste. The host needs enough disk for everything +# listed; check sizes at https://ollama.com/library before adding. set -e -ollama pull mistral-nemo:12b -ollama pull llama3.2:3b +MODELS="dolphin3:8b llama3.1:8b ministral-3:8b mistral-nemo:12b qwen3.6:latest" + +for model in $MODELS; do + if ollama list | awk 'NR>1 {print $1}' | grep -qx "$model"; then + echo "✓ $model already present" + else + echo "→ Pulling $model…" + ollama pull "$model" + fi +done + +echo "Done."