feat(local-models): expand catalog with Hugging Face fallback and opt-in scanning - #1804
Conversation
…atform verification tests
Bump schema to v2 and add label, parameter_count, and size_bytes to each curated entry so curated rows can be shown before any hardware scan has run. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename CatalogResult.recommended/AdvisorCatalog fields to curated and add a scanned flag distinguishing a scan-free result (cache miss, no scan requested) from one served without a scan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…name Persist scan results to a fingerprinted cache file keyed on llmfit version, hardware profile, and max context, so scan() only spawns the expensive scoring subprocess on an explicit refresh=True. Also build a fallback hf.co/<repo> pull target when llmfit doesn't return a native ollama_name, so llama.cpp-runnable models no longer silently drop out of the explore list, with the fit badge downgraded to Marginal when the pull's quant can't be trusted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Build scan-free placeholder rows for curated manifest entries and unmatched installed models so the catalog is useful before any scan runs, and register synthetic install plans for curated placeholders so /install works pre-scan. A curated model now always lands in its own section at whatever fit the scan found, rather than being folded into "More models" by a hidden fit threshold. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename recommended to curated in the ModelCatalog type, key catalog rows by the scan-stable canonical_id instead of the refresh-sensitive catalog_id, and replace the explore section with a "Scan hardware" prompt until data.scanned is true. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Installed models now always sort via the fixed section order in ModelCatalogPage, so callers no longer need to control it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…scan An 'unknown' fit before any scan is every row, all the time, so repeating a badge that says nothing is noise and stays hidden. An 'unknown' fit after a scan means llmfit had no estimate for this specific model despite a real scan having run, which is the rare, actually-notable case and now keeps its badge via a new scanned prop. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Narrowing the explore list to a few matches (or none) shrunk the page's scrollable area, which clamped scrollTop and yanked the whole page upward. Reserve a fixed height for the list while a search query is active so filtering leaves blank space below instead of moving the page. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…pi/05d Relocate LLMFIT_MODEL_CATALOG_EXPANSION_SPEC.md into plans/community-local/api/, alongside 05a-model-recommendations.md which owns the recommendations module this spec extends, and retitle it to match the phase-numbered convention used by its siblings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>"
A bare hf.co/<repo> pull is accepted by Ollama but silently stored as hf.co/<repo>:latest, so every later exact-string match against the ollama_name we handed out (install verification, already-installed detection on rescan) would permanently fail. Request :latest explicitly so the identifier we track matches what Ollama actually names it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ollama pull ids Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…owing the settings dialog Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… on explicit "Scan hardware" Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Grid items default to min-width: auto, same as flex items — without min-w-0, a whitespace-nowrap descendant (the hardware-scan row's buttons) forced this row's grid item past its 1fr track. The extra width rendered honestly, then got hard-clipped with no scrollbar by the settings section's overflow-hidden, cutting off the "Rescan hardware" button and each model row's action buttons once a scan populated enough rows to need scrolling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…lls before and after a scan
Description
hf.co/<repo>[:<quant>]fallback pulls when Ollama's registry lacks a model — ~91 → 1,400+ usable models.curated(staff picks, always visible) andexplore(scan-derived, ranked by fit).best_quantwhen scored againstllama_cpp; untrusted quants get an untagged pull + downgraded "Marginal" fit.:latestmismatch: untagged fallback pulls now request:latestexplicitly, matching what Ollama actually stores — fixes broken install verification and "already installed" detection.provider/reponame shown consistently (Chat summary, model picker, catalog list, Installed) before and after scanning.Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR expands the local model catalog by enabling SurfSense to offer models from Hugging Face GGUF repositories that aren't in Ollama's native registry, increasing available models from ~91 to over 1,400. It introduces a fallback mechanism where
llmfitscan results withgguf_sourcesbut noollama_nameare automatically mapped tohf.co/<repo>pull targets that Ollama natively supports. The implementation adds persistent, fingerprinted caching ofllmfitscan results to avoid expensive rescans, restructures the catalog API to distinguish curated (staff picks, always visible) from explore (scan-derived, ranked by fit), and adds ascannedflag so the UI can show curated models and a "Scan hardware" prompt immediately without blocking on hardware detection. GPU verification on Windows confirmed thatllmfitcorrectly scores these GGUF models with trustworthy quantization tags on non-Mac platforms, validating the approach.⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
LLMFIT_MODEL_CATALOG_EXPANSION_SPEC.mdsurfsense_local/backend/modules/llm/recommendations/types.pysurfsense_local/backend/modules/llm/recommendations/curated_models.pysurfsense_local/backend/modules/llm/recommendations/curated-models.jsonsurfsense_local/backend/modules/llm/recommendations/llmfit.pysurfsense_local/backend/modules/llm/recommendations/dependencies.pysurfsense_local/backend/modules/llm/recommendations/catalog.pysurfsense_local/backend/modules/llm/schemas.pysurfsense_local/backend/tests/unit/llm/recommendations/test_llmfit.pysurfsense_local/backend/tests/unit/llm/recommendations/test_curated_models.pysurfsense_local/backend/tests/unit/llm/recommendations/test_catalog.pysurfsense_local/backend/tests/integration/llm/test_routes.pysurfsense_local/frontend/src/features/model-catalog/api.tssurfsense_local/frontend/src/features/model-catalog/model-catalog-page.tsxsurfsense_local/frontend/src/features/model-catalog/model-card.tsxsurfsense_local/frontend/src/features/model-catalog/model-catalog.test.tsxsurfsense_local/frontend/src/features/model-selection/model-selection-content.tsxsurfsense_local/frontend/src/features/onboarding/onboarding-page.tsxsurfsense_local/frontend/src/features/settings/models-settings.tsxsurfsense_local/frontend/src/app/app-bootstrap.test.tsxsurfsense_local/frontend/src/features/dashboard/dashboard-page.test.tsxsurfsense_local/frontend/src/features/onboarding/onboarding-page.test.tsxsurfsense_local/frontend/src/features/settings/settings-dialog.test.tsx