Studio: fix loading split GGUFs from the local HF cache - #7273
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates detect_gguf_model and _find_local_gguf_by_variant to use .absolute() instead of .resolve() to preserve symlink names, ensuring llama.cpp can find sibling split-GGUF shards. It also adds corresponding tests. The feedback suggests wrapping the symlink_to calls in the new tests with try-except blocks to gracefully skip them on platforms like Windows where symlink creation might fail due to restricted privileges.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45f687e0fb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Loading a split (multi-part) GGUF through the local path branch fails with a 500:
The easiest way to hit it is the OpenAI API auto-switch reload of a split variant, e.g. the BF16 of
unsloth/Qwen3.6-27B-MTP-GGUF. Loading the same model by repo id works.Root cause
_find_local_gguf_by_variantanddetect_gguf_modelreturnstr(path.resolve()). HF cache snapshot files are symlinks intoblobs/<sha256>, soresolve()swaps the shard name for a hash. llama.cpp derives the sibling shards of a split GGUF from the-00001-of-000NNsuffix, so the load is rejected before it starts.Fix
Return
str(path.absolute())instead, keeping the symlink name. The direct-file case indetect_gguf_modelalready does this, and path comparisons elsewhere resolve both sides, so nothing relied on getting the blob path.Verification
/api/inference/loadreturned 500 before the fix with llama-server receiving the blob path, and 200 after, with/v1/chat/completionsreplying normally.tests/test_offline_gguf_cache_fallback.py,tests/test_gguf_routing.py,tests/test_mtp_drafter_companion.pyall pass.