Skip to content

gguf-puller: pull public GGUF repos without the HF token secret#53

Merged
AlienWalker1995 merged 1 commit into
mainfrom
fix/gguf-puller-token-optional
Jun 23, 2026
Merged

gguf-puller: pull public GGUF repos without the HF token secret#53
AlienWalker1995 merged 1 commit into
mainfrom
fix/gguf-puller-token-optional

Conversation

@AlienWalker1995

Copy link
Copy Markdown
Owner

Problem

ordo-ai-stack-llamacpp-1 crash-looped because its model file was missing; restoring it surfaced that docker compose run gguf-puller hard-fails whenever the SOPS-managed hf_token secret file is absent (or its ${HOME} source mis-resolves inside a Hermes/ops-controller compose subprocess — the same is not a valid Windows path error seen in the audit log). Even public GGUF pulls fail, so the puller couldn't be used to recover.

Fix

scripts/pull_gguf_models.py already falls back from HF_TOKEN_FILE to the HF_TOKEN env var and pulls public repos anonymously. So for gguf-puller only:

  • Replace HF_TOKEN_FILE=/run/secrets/hf_token + secrets: [hf_token] with optional HF_TOKEN=${HF_TOKEN:-}.
  • Empty by default → public repos pull token-free and compose run never hard-fails. Set HF_TOKEN in .env for gated repos.

The runtime services (ops-controller, dashboard, comfyui, comfyui-model-puller) keep the SOPS file secret unchanged — this is deliberately scoped to the puller, not a stack-wide secrets change.

Why not env-provider / a stack-wide change

A secrets.hf_token.environment: HF_TOKEN provider was tried first — it also hard-fails when HF_TOKEN is unset (environment variable "HF_TOKEN" required by secret … is not set). Compose's only non-fatal mechanism is ${VAR:-} on a plain env var. Ripping the secret out of all 5 services would diverge from the SOPS+age design (per repo convention) for no benefit, so this PR touches just the puller.

Note: comfyui-model-puller has the same latent trap but uses a different script (pull_comfyui_models.py); left untouched pending verification of its token handling.

Validation

docker compose --profile models run --rm gguf-puller with no secret and no HF_TOKEN pulls a public GGUF successfully (Done., exit 0). docker compose config resolves clean.

🤖 Generated with Claude Code

The gguf-puller service declared the SOPS-managed `hf_token` Docker secret
(file: ${HOME}/.ai-toolkit/runtime/secrets/hf_token). When that file is absent
— or when its ${HOME} source mis-resolves inside a Hermes/ops-controller
compose subprocess — `docker compose run gguf-puller` aborts before the script
runs, so even public-repo pulls fail.

pull_gguf_models.py already falls back to the HF_TOKEN env var and downloads
public repos anonymously. Swap the file secret for an optional
`HF_TOKEN=${HF_TOKEN:-}` env on gguf-puller only: empty by default (public pulls
work token-free, never hard-fails), set HF_TOKEN in .env for gated repos. The
runtime services (ops-controller, dashboard, comfyui, comfyui-model-puller)
keep the SOPS file secret unchanged.

Validated: `docker compose --profile models run --rm gguf-puller` with no secret
and no HF_TOKEN pulls a public GGUF successfully (exit 0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlienWalker1995 AlienWalker1995 merged commit 6b4df79 into main Jun 23, 2026
5 checks passed
@AlienWalker1995 AlienWalker1995 deleted the fix/gguf-puller-token-optional branch June 23, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant