Skip to content

fix(huggingface): list repos nested more than one directory deep - #12355

Merged
mudler merged 1 commit into
masterfrom
fix/llama-cpp-import-subdir-quants
Sep 29, 2026
Merged

mudler merged 1 commit into
masterfrom
fix/llama-cpp-import-subdir-quants

Conversation

@mudler-agent

@mudler-agent mudler-agent commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Importing https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF failed with no importer matched.

The cause is the HuggingFace file listing, not the llama.cpp importer. The tree API returns each entry's path relative to the repo root (assets/plots, not plots). The recursive listing prefixed the parent directory again, requested assets/assets/plots, got a 404, and failed the whole listing. DiscoverModelConfig then treated the URI as a non-HF repo, so no importer matched. Any repo nested more than one directory deep is affected. Per-quant subfolders one level deep (Q2_0/, IQ3_S/) were fine; the nested assets/plots/ tree is what broke it.

Notes for Reviewers

The existing subfolder test did not catch this because its mock returned the nested directory as "nested" and routed requests by substring. The mock now returns root-relative paths like the real API and routes on the exact tree path, so a doubled path 404s. The test fails on master with the same error seen against the live repo.

How to verify:

  • go run github.com/onsi/ginkgo/v2/ginkgo ./pkg/huggingface-api/ ./core/gallery/importers/
  • Import https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF. With no preference it selects both Q2_0 shards plus mmproj-Qwen3.8-Flash-Next-BF16.gguf, which is set as mmproj: in the config (no q4_k_m exists, so the usual last-group fallback applies). With {"quantizations":"iq3_s"} it selects both IQ3_S shards.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

πŸ€– Generated with Claude Code

The HuggingFace tree API returns each entry's path relative to the repo
root ("assets/plots", not "plots"). The recursive listing prefixed the
parent directory again, so it requested "assets/assets/plots", got a
404, and failed the whole listing. The importer then treated the URI as
a non-HF repo and no importer matched.

This broke the import of GGUF repos that keep per-quant subfolders next
to a nested assets tree, such as
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF.

The test mock now returns root-relative directory paths like the real
API and routes on the exact tree path, so a doubled path 404s.

Assisted-by: Claude:claude-opus-5-5 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler-agent mudler-agent added the bug Something isn't working label Sep 29, 2026
@mudler
mudler merged commit b700da3 into master Sep 29, 2026
1 of 22 checks passed
@mudler
mudler deleted the fix/llama-cpp-import-subdir-quants branch September 29, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants