unsloth/studio/backend
Daniel Han 65acefd2a6
feat(studio): infinite scroll for recommended models list (#4414)
* feat(studio): infinite scroll for recommended models list

The model selector showed a hard cap of 4 GGUFs + 4 safetensors in the
Recommended section. Users who wanted to browse more had to search
manually on Hugging Face.

Backend: increase the default model pool from 8+8 to 40+40 (the HF
fetch already pulls 80, so no extra network cost).

Frontend: replace the static 4+4 cap with on-demand lazy loading.
A page counter tracks how many groups of 4 to show per category.
An IntersectionObserver on a sentinel div at the bottom of the list
increments the page when the user scrolls down. Models are interleaved
in groups of 4 GGUFs then 4 hub models per page for a balanced view.

Key implementation details:
- Callback ref for the sentinel so the observer attaches reliably on
  first popover open (useRef would miss the initial mount)
- Observer disconnects after each fire and re-attaches via useEffect
  with a 100ms layout delay to prevent runaway page loading
- VRAM info fetched incrementally via useRecommendedModelVram on the
  visible slice only
- recommendedSet uses visible IDs so HF search dedup stays correct

* refactor: address review feedback on recommended infinite scroll

- Simplify visibleRecommendedIds: use findIndex to locate the GGUF/hub
  split point instead of re-filtering the entire array each time.
  recommendedIds is already sorted GGUF-first, so a single slice is
  enough.

- Fix VRAM refetch churn: pass the full recommendedIds (stable across
  page increments) to useRecommendedModelVram instead of the growing
  visibleRecommendedIds slice. The hook derives its stableKey from the
  sorted+joined input, so passing the same pool on every page avoids
  redundant HF modelInfo requests.
2026-03-18 03:17:01 -07:00
..
assets studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
auth fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
core feat(studio): infinite scroll for recommended models list (#4414) 2026-03-18 03:17:01 -07:00
loggers Final cleanup 2026-03-12 18:28:04 +00:00
models studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
plugins Final cleanup 2026-03-12 18:28:04 +00:00
requirements Trim ~255 MB of unused packages from Studio setup (#4395) 2026-03-17 21:32:38 -07:00
routes studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
state Final cleanup 2026-03-12 18:28:04 +00:00
tests fix(seed): disable remote code execution in seed inspect dataset loads (#4275) 2026-03-13 19:37:43 +04:00
utils studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
colab.py Fix/colab comment edits (#4317) 2026-03-16 16:15:46 -07:00
main.py studio: web search, KV cache dtype, training progress, inference fixes 2026-03-17 00:30:01 -07:00
run.py studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00