Discover models across all drives; group split GGUF shards#79
Open
rjckkkkk wants to merge 1 commit into
Open
Conversation
On Windows the model scanner only looked at %USERPROFILE% directories, so models on other drives (D:\models, D:\lmstudio\models, ...) were never found and users had to set AIMA_MODEL_DIR by hand. Split GGUF shards were each registered as a separate model, and mmproj projector files showed up as standalone models — both break one-click deploy from the Web UI (a user clicking a single shard would fail to load the model). Scan discovery: - enumerate fixed/removable drives and probe conventional model dirs that exist (<drive>:\models, <drive>:\lmstudio\models, .ollama, HF hub). This stays targeted — it never walks whole drives, so recycle bins and system folders are not pulled in. - AIMA_MODEL_DIR now accepts a list (os.PathListSeparator) for custom dirs. - honor HF_HOME / OLLAMA_MODELS for relocated caches. - harden scanner.yaml skip list ($recycle.bin, system volume information, node_modules, .git, ...) so even an explicit drive-root scan stays clean. GGUF grouping: - collapse "...-00001-of-000NN.gguf" shards into one logical model whose Path is the first shard (llama.cpp auto-loads the rest) and whose size is the sum of all parts — so deploy targets the whole model, not one piece. - drop mmproj projector files. The scanner already skips "mmproj" *dirs* (scanner.yaml); this covers the file-name form, so projectors no longer appear as deployable models. Pure logic (groupGGUFModels, dedupePaths, DefaultScanPaths multi-path) is table-driven tested. Verified on an AMD Strix Halo Windows box: a clean scan now yields 22 grouped models across D:\model, D:\models, D:\models-gguf and D:\lmstudio (drive auto-probe found the latter two on its own), with no shards-as-models, no mmproj, and no recycle/tooling junk. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
On Windows the model scanner only looked at %USERPROFILE% directories, so
models on other drives (D:\models, D:\lmstudio\models, ...) were never
found and users had to set AIMA_MODEL_DIR by hand. Split GGUF shards were
each registered as a separate model, and mmproj projector files showed up
as standalone models — both break one-click deploy from the Web UI (a user
clicking a single shard would fail to load the model).
Scan discovery:
exist (:\models, :\lmstudio\models, .ollama, HF hub). This
stays targeted — it never walks whole drives, so recycle bins and system
folders are not pulled in.
node_modules, .git, ...) so even an explicit drive-root scan stays clean.
GGUF grouping:
Path is the first shard (llama.cpp auto-loads the rest) and whose size is
the sum of all parts — so deploy targets the whole model, not one piece.
(scanner.yaml); this covers the file-name form, so projectors no longer
appear as deployable models.
Pure logic (groupGGUFModels, dedupePaths, DefaultScanPaths multi-path) is
table-driven tested. Verified on an AMD Strix Halo Windows box: a clean
scan now yields 22 grouped models across D:\model, D:\models,
D:\models-gguf and D:\lmstudio (drive auto-probe found the latter two on
its own), with no shards-as-models, no mmproj, and no recycle/tooling junk.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com