refactor(models): merge downloaders into one, driven by models.yml

Replace the per-model downloader services with a single downloader
that reads file/url pairs from models.yml. Downloads now go to a
.part file first, so an interrupted run can't leave a truncated
model that later runs skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
haylanandClaude Bot committed 2026-10-31 16:48:58 +01:00
1 parent 28c102e0d9
commit 8144286946
5 files changed
+26 -26

No files matched your search

+12 -22
View File
@@ -38,34 +38,24 @@ services:
restart: unless-stopped
networks: [ai-stack]
# see docs/operations.md#model-downloads (also covers downloader-classifier)
# see docs/operations.md#model-downloads; the list of files is models.yml
downloader:
image: curlimages/curl:latest
image: alpine:3
profiles: ["tools"]
user: root
volumes:
- models:/models
entrypoint: ["sh", "-c"]
- ./models.yml:/models.yml:ro
entrypoint: ["sh", "-euo", "pipefail", "-c"]
command:
- >
test -f /models/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf} &&
echo "already downloaded, skipping" ||
curl -L --fail --create-dirs -o /models/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf}
https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/resolve/main/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf}
downloader-draft:
image: curlimages/curl:latest
profiles: ["tools"]
user: root
volumes:
- models:/models
entrypoint: ["sh", "-c"]
command:
- >
test -f /models/${LLAMA_DRAFT_MODEL_FILE:-Qwen3.8-27B-DFlash2-Q4_K_M.gguf} &&
echo "already downloaded, skipping" ||
curl -L --fail --create-dirs -o /models/${LLAMA_DRAFT_MODEL_FILE:-Qwen3.8-27B-DFlash2-Q4_K_M.gguf}
https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2-GGUF/resolve/main/${LLAMA_DRAFT_MODEL_FILE:-Qwen3.8-27B-DFlash2-Q4_K_M.gguf}
- |
apk add --no-cache -q curl yq-go
yq -r '.models[] | (.file // "") + " " + (.url // "")' /models.yml | while read -r file url; do
if [ -z "$$url" ]; then echo "models.yml: entry '$$file' needs both file and url" >&2; exit 1; fi
if [ -f "/models/$$file" ]; then echo "$$file: already downloaded, skipping"; continue; fi
curl -L --fail -o "/models/$$file.part" "$$url"
mv "/models/$$file.part" "/models/$$file"
done
# see docs/operations.md#speed-bench
speed-bench: