fix(import): derive model name from selected GGUF for repo-root URIs#10589
Merged
mudler merged 1 commit intoJun 30, 2026
Merged
Conversation
When importing a HuggingFace GGUF model from a repository-root URI (no file component, e.g. hf://owner/repo) with the Model Name field left blank, the importer named the model after the repository (filepath.Base(details.URI)) instead of the GGUF file it actually selected from the repo listing (issue mudler#10587). Track whether the user supplied an explicit name; the URI base is now only a fallback. In the HuggingFace branch, once the model group is picked, re-derive the name from the selected GGUF via a new modelNameFromShardGroup helper that uses ShardGroup.Base minus the .gguf extension. For sharded models this yields a clean logical name (e.g. Qwen3-30B-A3B-Q4_K_M) rather than a shard filename like ...-00001-of-00002. An explicit name preference still always wins, and the .gguf/URL/OCI paths are unchanged. Add network-free unit specs covering name-from-GGUF, clean-name-from-shard-base, and explicit-name precedence, and update the live integration specs that had encoded the previous repo-name behaviour. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Adira Denis Muhando <dennisadira@gmail.com>
mudler
approved these changes
Jun 30, 2026
mudler
added a commit
that referenced
this pull request
Jun 30, 2026
…ing (#10589) (#10609) PR #10589 changed repo-root HuggingFace URI imports to name the model after the selected GGUF file rather than the repository. The Open Responses API integration test still requested the old repo-derived name ("Qwen3-VL-2B-Instruct-GGUF"), so every request 404'd on an unknown model and the suite has failed on master since 1a4f68e. Update testModel to the name the importer now registers for the default q4_k_m quant ("Qwen3-VL-2B-Instruct-Q4_K_M") so the specs resolve the model again. The #10589 behaviour change is intentional; only the stale test needed updating. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
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
Fixes #10587.
When importing a HuggingFace GGUF model from a repository-root URI (no file component, e.g.
hf://owner/repo) with the Model Name field left blank, the importer named the model after the repository (filepath.Base(details.URI)) instead of the GGUF file it actually selected from the repo listing. The emittedname:, themodel:path, and the galleryFilenamedirectory all inherited the repo name rather than the model.Fix
nameProvided); the URI base is now only a fallback.modelNameFromShardGrouphelper that usesShardGroup.Baseminus the.ggufextension.Qwen3-30B-A3B-Q4_K_M) rather than a shard filename like...-00001-of-00002.namepreference still always wins. The.gguf/ URL / OCI import paths are unchanged.Tests
llama-cpp_test.go: name-from-single-GGUF, clean-name-from-shard-base, and explicit-name precedence.importers_test.gothat had encoded the previous repo-name behaviour to assert the GGUF-derived name.All importer specs pass;
go vetandgofmtclean.🤖 Generated with Claude Code