unsloth/studio/backend
Daniel Han 3f6057a2b2 Bound the gallery blob cache, and three interlock fixes
Four review findings, all reproduced first:

- The gallery object-URL caches were unbounded. A clip runs from a few MB to a
  few hundred, both pages stay mounted after their first visit, and entries were
  only dropped on delete, so scrolling pinned everything for the session. Both
  pages now share a byte-budgeted LRU (512 MB video / 192 MB images) keyed off
  the visibility signal the near-viewport fetching already provides. On-screen
  media, the selected clip or image, and the item just fetched are never
  evicted, so eviction is invisible and a single item larger than the whole
  budget cannot evict itself into a refetch loop.

- The image, video and chat load guards ran two independent training probes but
  returned early when the FIRST one raised, so an unreadable LLM backend
  disabled the diffusion interlock and a load could proceed straight into an
  active diffusion trainer on the same GPU. The probes are independent now.

- An engine switch swallowed a failed teardown and published the new engine
  anyway, which is exactly the leak the unload exists to prevent: the arbiter's
  evictor, /images/unload and the next load all resolve through
  get_active_diffusion_engine(), so the still-resident pipeline (or a live
  sd-server) became unreachable and the next load allocated on top of it. The
  switch now fails and leaves the old engine published, so it stays reclaimable.

- The native generation timeout was 30 minutes while the Images page waits up to
  6 hours (SETTLE_MAX_MS), so slow-but-progressing CPU jobs died deterministically
  at the deadline. Measured on GPU-less runners, a 512x512 4-step Q2_K generation
  took 900 s on Linux and 1465 s on Windows, so larger images or step counts clear
  half an hour easily. The ceiling now matches the page's window and applies to
  the whole request: chunks of a split batch share one deadline instead of each
  getting a full budget. Cancellation is unchanged.

Declined: gating the huggingfacenotorch extra off Python 3.9 over the
conditional diffusers marker. The marker is deliberate and its comment says why:
diffusers dropped 3.9 in 0.38, so pinning >=0.39 outright leaves pip no candidate
and the whole extra unresolvable there. The pipelines it names live in
studio/backend, which cannot install on 3.9 anyway (studio.txt pins
matplotlib==3.10.9 and fastmcp>=3.0.2, both requires_python >=3.10), and the
extra is the general core one, so the alternative drops 3.9 for library users who
never touch Studio.
2026-07-27 05:08:45 +00:00
..
assets feat(studio): add DoRA support to studio (#7315) 2026-07-24 03:24:16 -07:00
auth Studio: reject whitespace-only passwords (#7341) 2026-07-23 00:44:37 -07:00
core Bound the gallery blob cache, and three interlock fixes 2026-07-27 05:08:45 +00:00
hub Stop adopting an unknown scoped download, leaking raced blobs and resurrecting deleted clips 2026-07-27 03:26:10 +00:00
loggers Studio: quiet noisy logs, log real progress, and speed up Windows/macOS dataset prep (#7087) 2026-07-15 06:49:52 -07:00
models Match the file's typing idiom for flow_shift 2026-07-27 04:32:05 +00:00
picker Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
plugins Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
requirements Merge origin/main into image-generation (PR #6763) 2026-07-25 00:34:38 -07:00
routes Bound the gallery blob cache, and three interlock fixes 2026-07-27 05:08:45 +00:00
state Studio: shareable per-checkpoint preview links (#6486) 2026-06-24 06:31:53 -07:00
storage fix(studio): persist connection model selections for remote clients (#7298) 2026-07-23 19:11:50 -07:00
tests Bound the gallery blob cache, and three interlock fixes 2026-07-27 05:08:45 +00:00
utils Do not stub out triton on a GPU host when the Xet backend fails to import 2026-07-27 02:23:26 +00:00
__init__.py
_platform_compat.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
cloudflare_tunnel.py Studio: fix stuck composer prompt on first send and unreachable --secure Cloudflare links (#7340) 2026-07-23 00:39:14 -07:00
colab.py fix(studio/colab): fix OutStream startup crash and tidy the notebook cards (#7404) 2026-07-25 04:11:03 -07:00
main.py Trim the comments across the diffusion backend 2026-07-26 20:31:19 +00:00
mcp_server.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
run.py fix(studio): support hostname-based enterprise proxies (#7416) 2026-07-26 02:53:00 +01:00
startup_banner.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00