fix(ruvllm-cli): follow HF 307 redirect on aux-file download#590
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ruvllm download <model>fails on auxiliary files (e.g.tokenizer_config.json):The
hf-hubAPI client does not follow HuggingFace's 307 redirect to the LFS/CDN host for these files. A plaincurl -Lon the same resolve URL returns 200 — so the file is reachable; only the in-crate client misses the redirect. This blocks everyruvllm download(and thusserve/chat) for affected repos.Fix
Add a redirect-following
curl -L --failfallback indownload_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>), honoringHF_TOKEN.curlis already the download mechanism inhub/download.rs, so this is dependency-free and consistent with the codebase.Verification
cargo check/buildclean. Re-runningruvllm download phi: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