Skip to content

fix(ruvllm-cli): follow HF 307 redirect on aux-file download#590

Merged
ruvnet merged 3 commits into
mainfrom
fix/ruvllm-download-307-redirect
Jun 19, 2026
Merged

fix(ruvllm-cli): follow HF 307 redirect on aux-file download#590
ruvnet merged 3 commits into
mainfrom
fix/ruvllm-download-307-redirect

Conversation

@ruvnet

@ruvnet ruvnet commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Problem

ruvllm download <model> fails on auxiliary files (e.g. tokenizer_config.json):

Downloading: tokenizer_config.json
Error: Failed to download tokenizer_config.json

The hf-hub API client does not follow HuggingFace's 307 redirect to the LFS/CDN host for these files. A plain curl -L on the same resolve URL returns 200 — so the file is reachable; only the in-crate client misses the redirect. This blocks every ruvllm download (and thus serve/chat) for affected repos.

Fix

Add a redirect-following curl -L --fail fallback in download_with_progress(): try the hf-hub API first, and on failure download directly from the HF resolve URL (https://huggingface.co/<id>/resolve/<rev>/<file>), honoring HF_TOKEN. curl is already the download mechanism in hub/download.rs, so this is dependency-free and consistent with the codebase.

Verification

cargo check/build clean. Re-running ruvllm download phi:

Downloading: tokenizer.json       → Downloaded (15.5 MB)
Downloading: tokenizer_config.json → Downloaded (2.9 KB)   ← was the hard failure
Downloading: config.json          → Downloaded (2.5 KB)

The reported redirect bug is resolved.

Separate follow-up (out of scope)

The run then hits a distinct pre-existing bug: GGUF weights are requested as an unexpanded glob *<suffix>.gguf (404), and the GGUF model alias points at the safetensors repo. Fixing that needs HF file-listing + registry resolution and belongs in its own PR.

🤖 Generated with claude-flow

ruvnet and others added 3 commits June 18, 2026 20:58
…aharness/darwin); live-serve e2e blocked by ruvllm download redirect bug

Co-Authored-By: claude-flow <ruv@ruv.net>
… fallback)

`ruvllm download <model>` failed on aux files like tokenizer_config.json:
'Failed to download tokenizer_config.json'. The hf-hub API client doesn't follow
HuggingFace's 307 redirect to the LFS/CDN host for these files (a plain `curl -L`
on the same resolve URL returns 200). Add a redirect-following `curl -L --fail`
fallback in download_with_progress(): try hf-hub first, fall back to curl from the
HF resolve URL (https://huggingface.co/<id>/resolve/<rev>/<file>), honoring HF_TOKEN.
curl is already the download mechanism in hub/download.rs, so this is dependency-free
and consistent. Verified: tokenizer_config.json + config.json now download (2.9KB/2.5KB).

Note: a SEPARATE pre-existing bug remains — GGUF weights are requested as an unexpanded
glob '*<suffix>.gguf' (404), and the GGUF alias points at the safetensors repo; that
needs HF file-listing + registry resolution and is out of scope for this redirect fix.

Co-Authored-By: claude-flow <ruv@ruv.net>
Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit 946275a into main Jun 19, 2026
49 of 55 checks passed
@ruvnet ruvnet deleted the fix/ruvllm-download-307-redirect branch June 19, 2026 03:06
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