Repository navigation
feat: search and download local models from the provider cards - #148
Conversation
Record checks 1.1, 1.1b, 1.2 and 1.3 in design.md. A cancelled Hugging Face download now starts again: huggingface_hub 1.27 deletes the partial file, and Xet cancel needs abort_xet_session().
- Follow the Link header of the Hugging Face tree read, capped at 20 pages and to the same host, so a large repo lists every file. - Cancel an open status read before a start or cancel writes its status, so an older answer cannot stop the progress polling. - Show a failed llama.cpp server read as an error, not as an own server. - Give the Ollama list line its own words and a Refresh models button. - Clear the saved line after the restart runs.
- Start lists the files at the revision the user saw, so a newer commit in the repo no longer gives not-found. - Name each file-list radio group after its provider, so two cards that list one repo do not share it. - Show an error when Cancel fails. - Pass the abort signal to the provider model list read.
The live check found that the 60-second stall check stopped a healthy 1.8 GB Xet download. On Xet, huggingface_hub reports the file assembly in large steps, which came 60 seconds apart, while network bytes went to update_transfer about every second. The progress class now has update_transfer, and each call resets the stall clock without adding bytes. A test pins that the library sends network bytes there.
The browser check found that a Xet download showed 0 B until it ended. Progress is now the larger of the assembled bytes and the network bytes, capped at the file size, so the bar moves about every second. Also from the browser check: hide a cancel line left from before the page loaded, and raise the progress track contrast in the dark theme.
The live check found that the panel offered only built-in names and hf.co/ repos, so a name such as smollm2:135m could not be pulled. When the typed text passes the Ollama name rule and no result has it, the panel shows it first with the badge Typed name (design D6).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
Finishing Touches: 💡 1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (94.37%) is below the target coverage (95.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## v3 #148 +/- ##
==========================================
+ Coverage 94.76% 94.80% +0.04%
==========================================
Files 365 370 +5
Lines 29302 30049 +747
Branches 3748 3845 +97
==========================================
+ Hits 27767 28488 +721
- Misses 1012 1028 +16
- Partials 523 533 +10
|
The floor CI job installs the oldest allowed huggingface-hub. Model downloads use the Xet session abort (from 1.20) and the update_transfer progress route (from 1.23), so 5 tests failed at 1.0.0. The download tests pass at 1.23.0, and one fails at 1.22.0.
Sync the model-downloads spec into openspec/specs and point ADR-106 at the archived change and the PR #148 merge.
Summary
Adds a Get a model panel to the llama.cpp and Ollama provider cards. A user searches Hugging Face (GGUF repos only), picks a quantisation, and downloads it with progress and cancel. Ollama also offers built-in library names and a typed name. OpenSpec change:
openspec/changes/add-model-search-and-download/(39 of 39 tasks). Decision record: ADR-106 (Accepted).core/providers/model_sources.py: name, label, revision and query rules, quantisation parser, split-file grouping. A new optionalmodel_sourcefield onConnectionDescriptorturns the panel on (llama.cpp and Ollama only).integrations/huggingface_models.py: search and file list over plain HTTP with no token, a 10 s timeout, a body limit and same-host paging. Downloads usehf_hub_downloadinto the standard Hugging Face cache.integrations/ollama_pull.py: streamedPOST /api/pullwith summed layer progress.transports/api/model_download_job.pyandroutes/model_downloads.py: one job at a time, a 60 s stall check, cancel, shutdown, a free-space check (1 GiB margin) and a gated-repo check. The five new routes need the browser sessionmanagescope.web/src/settings/: the panel, the file list, progress, and the finished state. Use this model shows only when omrs runs the llama.cpp server. For an external server such as the Llama app, the panel shows the cache folder, a relaunch note and Refresh models.Findings fixed during the build
huggingface_hub.utils._xet.abort_xet_session(), and a test pins that it exists. A cancelled download starts again from zero, because the library deletes partial files. The spec says so.Checks
./scripts/local_ci.shpassed on418e3c7d, with no SKIPPED step. Python had 9,440 passed and 149 skipped. Web had 2,205 tests. OpenSpec validated 89 of 89.v3.openspec/changes/add-model-search-and-download/screenshots/.live-checks.md.llama-serverloaded a cached model with no new download.Not in this PR
Summary by CodeRabbit