You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Find GGUF models in publisher/model subfolders, and resume interrupted downloads
- listModels() only ever read files directly inside the configured folder.
Tools like LM Studio organize downloads as <publisher>/<model>-GGUF/<file>.gguf
one level deeper than that, so pointing the llama.cpp model storage
location at a shared root (e.g. an existing Ollama/LM Studio models
directory) found nothing. Now walks subfolders (bounded to 6 levels) and
reports each model's path relative to the configured root. Sharded models
are still grouped correctly per-folder, so two different publishers'
same-named shard files no longer collide into one entry.
- LocalGgufModel now separates the real relative path (name, used for
load/delete) from a display label, since a relative path with
subdirectories isn't something you'd want to send to the identity
validation you'd normally do on a bare filename — deleteModel's guard
against path traversal now checks for ".." segments and containment
within the root instead of rejecting any path separator outright, and
sibling-shard cleanup happens in the target's own directory rather than
the top-level root.
- downloadGgufFile() now resumes instead of restarting: an existing
<file>.gguf.part is sent as a Range request, and the response is appended
rather than overwritten. Falls back to a fresh download if the server
ignores the Range header (200 instead of 206) or reports the partial as
stale (416). Errors during streaming — a dropped connection being the
main one — now deliberately leave the .part file in place instead of
deleting it, since that's real resumable progress, not corruption. This
also removes the startup sweep of .part files added in the previous
commit, since blowing away partial downloads on every launch would defeat
the point of being able to resume them.
14 new tests across llamacpp-manager.test.ts and huggingface.test.ts cover
subfolder discovery, per-folder shard grouping, nested deletion, path
traversal rejection, and the resume/fresh-start/stale-416 download paths.
0 commit comments