Skip to content

fix(vram): report largest GGUF quant instead of whole HF repo for gallery size (#10700)#10707

Merged
mudler merged 3 commits into
mudler:masterfrom
Anai-Guo:fix-gallery-gguf-repo-size-10700
Jul 7, 2026
Merged

fix(vram): report largest GGUF quant instead of whole HF repo for gallery size (#10700)#10707
mudler merged 3 commits into
mudler:masterfrom
Anai-Guo:fix-gallery-gguf-repo-size-10700

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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.gosumWeightFileBytes adds up every weight file in the repo. That is correct for .safetensors/.bin shards (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

sumWeightFileBytes now:

  • Groups .gguf files 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.
  • When GGUF files are present, reports the largest single variant as a conservative estimate instead of the whole repo.
  • Leaves the non-GGUF path unchanged: .safetensors/.bin/.pt shards 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.go covering: multi-quant repo (largest variant wins), sharded variant (shards summed), safetensors-only repo (still summed), and LFS-size preference.

🤖 Generated with Claude Code

Anai-Guo added 2 commits July 6, 2026 19:15
…size (mudler#10700)

Signed-off-by: Tai An <antai12232931@outlook.com>
Signed-off-by: Tai An <antai12232931@outlook.com>
@Anai-Guo Anai-Guo force-pushed the fix-gallery-gguf-repo-size-10700 branch from 0e46a39 to 4fca451 Compare July 6, 2026 22:10
@mudler

mudler commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Good catch, thanks!

@mudler mudler enabled auto-merge (squash) July 7, 2026 11:30
@mudler mudler merged commit 2f33cc7 into mudler:master Jul 7, 2026
64 checks passed
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.

Model ornith-1.0-9b-mtp wrongly reported as "Size: 71.2 GB · VRAM: 71.2 GB" (size of the entire HF repository) in "Install Models" gallery

2 participants