fix(vram): report largest GGUF quant instead of whole HF repo for gallery size (#10700)#10707
Merged
Merged
Conversation
…size (mudler#10700) Signed-off-by: Tai An <antai12232931@outlook.com>
Signed-off-by: Tai An <antai12232931@outlook.com>
0e46a39 to
4fca451
Compare
mudler
approved these changes
Jul 7, 2026
Owner
|
Good catch, thanks! |
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.
What / Why
Fixes #10700.
In the Install Models gallery, a model backed by a HuggingFace GGUF repo is reported with the size of the entire repository rather than the single GGUF file that would actually be downloaded. The reporter saw
ornith-1.0-9b-mtp— a 9B model — listed as 71.2 GB · VRAM: 71.2 GB / "May not fit", because the repo ships many quantizations (Q4_K_M, Q5_K_M, Q8_0, F16, ...) and all of them were summed.Root cause
pkg/vram/hf_estimate.go→sumWeightFileBytesadds up every weight file in the repo. That is correct for.safetensors/.binshards (genuine parts of one model, all required together), but wrong for GGUF: the quantizations in a repo are mutually-exclusive alternatives — only one is ever downloaded and run.Fix
sumWeightFileBytesnow:.gguffiles by quantization variant, collapsing multi-part shards (model-00001-of-00003.gguf) onto a single variant key so shards of one quant are summed together..safetensors/.bin/.ptshards are still summed.For the issue's repo this turns "sum of all quants" (~71 GB) into "largest quant" (a realistic single-file size), so the gallery no longer falsely flags small models as too large.
Tests
Added
pkg/vram/hf_estimate_internal_test.gocovering: multi-quant repo (largest variant wins), sharded variant (shards summed), safetensors-only repo (still summed), and LFS-size preference.🤖 Generated with Claude Code