Repository navigation
Studio: add a loaded models indicator with per-model eject - #8082
Conversation
A loaded model is only visible on the page that loaded it. Leave Chat for the Hub or Train and nothing on screen says a model is still holding memory, so the only way to check or release it is to navigate back. Adds a compact card in the bottom-right listing everything resident, with an eject button per row. Chat, images, video and dictation each own a runtime and their own /status, so all four are read and merged. A TTS load is split out from a chat load by audio_type: same picker, but it does not answer prompts. It joins the existing bottom-right stack in provider.tsx alongside the update banners and the download panel, so nothing overlaps. Collapses to a pill, and that choice persists. On by default, with a toggle in Settings, General, Notifications. Reads fail soft per runtime, so a chat-only host missing /video keeps its other rows. Ejecting the active chat model reuses the API monitor's read, unload, re-read sequence, since an API auto-switch can replace the model mid-eject.
afe425c to
5e59588
Compare
Eject the row's own model, not whatever is active. An API auto-switch can land between the poll and the click, and re-reading unconditionally would free a model nobody asked to free while reporting the clicked one as ejected. The sequence moves to eject-chat-model.ts, taking its I/O as deps like api-monitor/unload-resident.ts, so the scoping is under test. Fall back to the top-level STT fields. Servers predating the per-engine split report the resident Transformers model only there, so those installs showed no dictation row and had no eject for it. Bound each status read. authFetch has no timeout, so a runtime that accepts the connection and never answers left the Promise.all pending forever, and with it the in-flight guard that gates every later refresh. Re-sync Images and Video after an eject. Both hold their own status and re-read it on tab activation, not on a timer, so ejecting from the indicator left their controls offering to generate on a freed runtime. Add both preference keys to "Reset all local preferences", which otherwise left the indicator hidden or collapsed after a reset.
|
Went through all five. Every one held up, so all five are fixed in 6e3257a. P1, eject the row's model instead of the latest active model. Correct, and the worst of the five. The row is up to one poll old, so an auto-switch landing before the click meant The read is now scoped to the row: if the resident model does not match the entry, that pass is skipped and the row is unloaded by name instead, leaving the newly active model alone. The mid-eject switch the original code was written for still works, since the re-read simply stops matching. Moved the sequence into P2, legacy STT fields. Correct. P2, bound each status read. Correct. Each read now carries P2, synchronize media pages. Correct. Both pages only re-read status on P2, reset list. Correct, and by the file's own convention: |
/images/unload, /video/unload and the STT unload carry no model id and release whatever their runtime holds, so acting on a row up to one poll old could free a model nobody clicked while reporting the clicked one as ejected. The image and video races need a load landing in that window; dictation loads on demand and releases when idle, so its engine can change with no user action at all. Each now re-reads its runtime and only unloads when the resident model still matches the row. This narrows the window to the round trip rather than closing it, which would take a backend that accepts the model id. Ejecting reports an outcome instead of a bare string, so a stale row says the model is already gone and names what took its place, rather than claiming a success it did not perform. An unreadable dictation status is now an error rather than a false success.
|
Both new ones are right, and they are the same bug I fixed for chat, sitting on the three unloads that carry no model id. Fixed in a0c1af9. Confirmed against the backend: P1, the STT row. Agreed on the severity, and for a reason worth stating: the other two need a load to land inside the poll window, but dictation loads on demand and releases itself when idle, so an engine's resident model changes with no user action at all. The row can go stale on its own. P2, the image row. Same race, and the video path had it too, as noted. Each of the three now re-reads its runtime and only unloads when the resident model still matches the row. That narrows the window to the round trip rather than closing it, which would take a backend that accepts the model id, but the row being a whole poll old was the part worth not trusting. Chat needs no pre-check, since Ejecting now returns an outcome rather than a bare string, so the three cases are distinguishable:
That also removes the false success this raised: a stale row no longer claims an eject it did not perform. One thing I found while fixing it, not in the review: The decision itself is One correction on the image comment. The wrong model does get freed, which is the real problem, but the clicked model is not still resident: the diffusion runtime holds a single pipeline, so A was already gone when B loaded. The fix is the same either way. |
The llama.cpp and whisper.cpp STT sidecars report their engine name as the device (stt_mtmd_sidecar.device is "llama.cpp", stt_ggml_sidecar.device is "whisper.cpp"), so a row read "Dictation - llama.cpp - llama.cpp". Only the Transformers sidecar reports a real device. joinDetail now drops repeated parts, so the engine is named once and a genuine device still shows beside it.
…monitor The card and the Live monitor both anchor to the bottom-right, so opening the monitor buried the card underneath it. The monitor is draggable and resizable, so a fixed offset would only hold until it moved. The monitor now publishes its box. The corner stack lifts above it, but only while it is in the stack's column and low enough to be in the way, so a monitor dragged elsewhere leaves the corner alone. This clears the update banners and the download panel too, which had the same overlap. The card also gets a drag handle: anchored to its corner until moved, then kept where it was left, clamped back into view if the window shrinks. Its position persists and joins the reset list.
The loaded models card and the Train wizard's Model step both take AiBrain01Icon, and the indicator toggle moves above the llama.cpp one so the Notifications section leads with it.
The drag handle only existed in the expanded header, so the pill could not be moved. The pill is now its own handle: a press becomes a drag past a few pixels, below that it stays the click that expands the card, and reading the flag clears it so a keyboard activation is not swallowed. Re-clamping now also runs on a ResizeObserver, so expanding a pill dragged to the bottom edge pulls the taller card back into view instead of growing off screen.
Keep the Chat picker selection when an eject leaves the model resident, so a reload during the run no longer empties the picker while the model still runs. Republish the Live monitor's frame from a layout effect. ResizeObserver does not fire for a position-only change, so dragging the monitor left the overlay stack dodging its old corner. Cap the overlay stack's height to the space above its own bottom inset. Lifting it over the monitor without shortening it pushed the top of a long download list off screen. Measure the stack column from the update banners (448px), not the download panel (400px), so a monitor beside a banner is still dodged. Name the precision an image or video pipeline loaded at, so a quantised build is distinguishable from bf16 in the row.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The card is anchored bottom-right, where a native CSS resize grip has nowhere to grow, so it resizes from a grip at the leading corner instead: the anchored corner is held still and the box opens up and to the left. The grip shares the title icon's slot rather than adding another control to a small header, and double-clicking it returns the card to its default size and corner. The size persists next to the position, is clamped to a floor and to the room available, and is cleared by Reset all local preferences.
Clicking a row now goes to where that model is used: chat models to Chat, image and video pipelines to their tabs, dictation to the Voice settings tab that drives the sidecars. The target follows the runtime holding the weights, not the kind, so a Whisper checkpoint in the chat slot goes to Chat rather than to dictation. Navigation carries no search params, so it only changes page: it does not start a new thread or reload anything. Dictation moves to the Audio page once that lands.
Back to the fixed-size card. Reverts 96749d1. Also read /api/inference/status directly instead of through the chat barrel, matching the dictation read alongside it. The server logs show the indicator's chat read never reaching the backend: across every session the status count sits at roughly half the images/video/dictation count, matching the chat page's own 10s poll rather than the indicator's 5s one, which is why a loaded text model showed no row while an image model did.
…at report work they did not do
Two of these break the feature outright, the rest report success for an eject
that never happened.
The card can become permanently unreachable. use-drag-position captured
panelRef.current once, in an effect keyed [position, reclamp]. The indicator
returns null until the first poll produces a row, so that effect always ran
while the ref was still null: no ResizeObserver was ever constructed, and the
resize listener closed over null. Neither dependency changes when the node
finally mounts, so it never re-ran, and nothing in production ever called
clampToViewport except an active drag. Dragging the card on a 2560x1440 screen
and reopening at 1440x900 left it at x=2502, off screen, taking its own drag
handle and collapse button with it; resizing did not help. The only way back
was devtools or Reset all local preferences. The node now arrives through
state so the effect re-subscribes, and the stored position is clamped as it is
read so it cannot paint off screen even for one frame.
Locale parity fails. CI's first gate is i18n:check:strict and the two new keys
were added to en.ts only, so all 11 overlays were short. Added everywhere.
The chat eject reported ejects it never performed. When nothing matching was
resident it POSTed /unload anyway and returned stillResident: null without
re-reading. The backend answers 200 "unloaded" for a model it never held, so
the user got a success toast for a no-op and their picker selection was
cleared off the back of it. Reachable by an ordinary sequence: loading B
evicts A, and the card shows A for up to one poll. It now reports the same
replaced / already-gone outcomes the runtime rows use, and only names a model
directly for a cached row, which is the one case a status read cannot see.
The dictation eject could release another engine's model. /audio/stt/unload
silently serves gguf from the transformers engine when whisper-server is
absent, and the unload response body is a fixed {loaded_model: null}, so a 200
was not evidence this engine let go. It now re-reads and reports what the
engine actually holds.
No timeout on the eject path. READ_TIMEOUT_MS guarded only readLoadedModels; a
runtime that accepted the connection and never answered left the row disabled
with a spinner until reload. Same bound, raised rather than swallowed.
An audio-input VLM was filed under Speech. The split was audio_type !==
"whisper", but the backend's own is_audio_input_type names two input types,
whisper and audio_vlm. A model that listens was labelled as one that speaks,
which is the confusion this card exists to remove.
A stale poll could restore an ejected row, and the trailing refresh could not
repair it because the in-flight guard was still held by that same read. A
generation counter retires reads issued before an eject, and a pending flag
keeps the trailing refresh.
The drag now captures the pointer, as the Live monitor's does. Without it a
release over another window is never delivered and the card follows the cursor.
Backend: the card polls four runtimes every 5s for as long as the app is open,
and only /api/inference/status was in _QUIET_POLL_PATHS. Its three siblings
are now too, or every desktop tauri.log carries three lines every five seconds.
Tests
tests/loaded-models-platform-matrix.test.ts walks the payloads
[Windows, Linux, WSL, macOS] x [NVIDIA, AMD ROCm, Intel XPU, CPU-only, Apple]
actually produce. None of it is visible from a CUDA box: ROCm reports itself
as cuda, Apple reports mps, XPU reports xpu for images but cpu for dictation
because the STT device probe never checks torch.xpu, and the sd.cpp engine
omits model_kind and puts "gguf" in dtype.
tests/loaded-models-backcompat.test.ts covers the desktop app running against
an older wheel, which is a supported configuration: it ships its own frontend
bundle and adopts a separately installed backend. /video/status and the STT
mtmd block are both days old, so a 404 route, a missing engine block, the
pre-split top-level fields and absent optional fields all have to degrade
rather than blank the rows a working runtime returned. Also pins that fields
a future backend adds are ignored.
tests/loaded-models-drag-restore.test.ts guards the restore geometry and, by
reading the source, the wiring it depends on. Four of its cases fail against
the code before this commit.
tests/studio/playwright_loaded_models_indicator.py runs 28 checks in Chromium,
Firefox and WebKit, covering Chrome, Edge and the WebView2, WKWebView and
WebKitGTK the desktop app embeds. It stubs the four status endpoints with
page.route, so it needs no model, no GPU and no llama.cpp build, and can
therefore replay the AMD, Apple and CPU-only payloads on any runner. The
position restore is here rather than in the node suite because it needs a real
layout and a real ResizeObserver. Wired into the Linux, macOS and Windows UI
workflows alongside the existing permission runs. Against the code before this
commit it reports 25/28, failing exactly on the off-screen card and the
mislabelled audio-input model.
…op racing them Staging CI on macos-14 caught this: every check up to the eject passed, then the run died on a 60s locator timeout. rows() read count() and then indexed nth(i). The eject checks poll it while the row is disappearing, which is the whole point of them, so the row could go between the two calls and nth(1) would block for the full locator timeout rather than reporting a shorter list. evaluate_all takes the snapshot in a single evaluation, so there is no window. card_text had the same count()-then-read shape; it is now bounded and returns empty rather than blocking when the card is mid-change. Test-only. Confirmed 28/28 in Chromium, Firefox and WebKit after the change.
… fix The Windows job failed with 'unsloth: command not found': install.ps1 updates the User PATH through the registry, which a running Git Bash session never sees. Same GITHUB_PATH step the upstream Windows UI workflow carries. Also merges unslothai#8082's fix for the rows() locator race that macos-14 caught.
Run the media pages' full unload cleanup on an indicator eject, not just a status refresh. Images and Video kept lastLoad and canReapply, so Reapply still offered to reload the model that was just ejected, and the stale quantisation stayed on screen. Both now share that cleanup with their own Unload rather than duplicating half of it. Cap the overlay stack under a monitor parked high in its column. Avoidance was skipped entirely whenever the monitor's bottom sat above the midpoint, on the grounds that the corner was free, but the stack grows upwards from the bottom and a full download list plus the card reaches well past halfway. It is capped to the gap below such a monitor instead, since lifting over it would be wrong. stackBottomInset and stackMaxHeight now come from one stackGeometry call, so the two cannot disagree about where the monitor is.
|
@codex review |
Main had gained its own tests in test_inference_status_loaded_gguf.py, for the chat template projection, while this branch added three for what a GGUF load leaves in the registry. The two sets are about different things and the file's first four cases are identical on both sides, so the resolution keeps the union. Nine backend cases pass, and the frontend suite is clean at 1261.
|
@codex review |
Main's on-device GGUF pick fix reworked handleUnload on both media pages, inlining the teardown and adding pickGuard.cancel() so a resolving pick or a staged download cannot load back what was just ejected. This branch had factored that same teardown into dropResidentState for the indicator's eject listener to share. Resolved by keeping the factoring and folding the new cancel into it, so both callers get main's protection: the page's own Unload, and an eject driven from the card, which has the same hazard and previously had no guard at all. 1289 frontend tests pass, typecheck and build clean, and eslint reports the same 20 and 14 pre-existing errors on the two pages as origin/main does, so the merge adds none.
… was covering The loaded models card is the first overlay in the bottom-right stack that is persistent rather than transient, and the chat composer docks to the bottom of that same column once a thread has turns. The card landed on top of the Send button and swallowed the click: Playwright resolved the button, found it visible, enabled and stable, then retried for 60s while "unsloth/gemma-3-270m-it-GGUF ... subtree intercepts pointer events". Caught by the chat UI suite on both ubuntu-latest and macos-14. The stack already knows how to keep clear of something: the Live monitor publishes its box and stackGeometry lifts the stack above it. That store held one box, from one publisher, so the composer had nowhere to say where it is. It now keeps a box per publisher and dodges their union, which is also the right answer while the monitor is mid-exit and two panels are briefly published at once. The composer publishes through a small usePublishedFrame hook, re-measuring on resize and through a ResizeObserver because it grows with its input and moves from centred to docked without a resize event. A hidden composer measures 0x0 and is withdrawn rather than published, which would otherwise pull the union to the top-left and pin the stack there. Verified against a live backend at 1280x900, 1280x720 and 1440x900 with the composer docked: the element under the Send button's centre is the composer, and reverting the publish alone puts the overlay stack back there at all three. 1289 node tests pass, typecheck, i18n parity and build clean.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ffcd701d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // own finally does. | ||
| setBusy((prev) => (prev === "loading" ? null : prev)); | ||
| setQuant(null); | ||
| void refreshStatus(); |
There was a problem hiding this comment.
Ignore status reads started before an eject
On a slow or external Studio server, a tab-activation refreshStatus() can read the loaded pipeline before the eject, but finish after this post-eject refresh and overwrite its empty status. The active Images page then continues offering generation against the freed runtime because it has no periodic status poll; the identical unsequenced refresh exists in Video. Add a request generation or abort older status reads so only the newest refresh can call setStatus.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and both pages had it. They re-read status on tab activation and on their own actions but never on a timer, so an activation read that saw the pipeline loaded can answer after the post-eject read that saw it gone, and nothing comes along to correct it: the controls go on offering to generate against a freed runtime.
Fixed in 950fc4e. Every read takes a ticket before it awaits and only the newest may write. One correction to the scope: the refresh was not the only writer worth gating. The load-progress read and the unload response set status directly too and could overwrite a newer answer just as easily, so all three go through the same gate on both pages. Four cases pin it, all failing with the pages reverted.
| left: Math.min(merged.left, frame.left), | ||
| top: Math.min(merged.top, frame.top), | ||
| right: Math.max(merged.right, frame.right), | ||
| bottom: Math.max(merged.bottom, frame.bottom), |
There was a problem hiding this comment.
Keep independent obstacle frames separate
When the Live monitor is dragged to the left while the chat composer is published near the bottom-right, this union fabricates one large rectangle spanning the empty space between them. For example, a top-left monitor contributes the union's top while the composer contributes its right edge and bottom, so stackBottomInset treats the fabricated rectangle as a full-height obstacle in the stack column and can lift the update/download/model stack to its 120px-room cap even though the monitor is nowhere near that column. Preserve the individual frames and calculate the vertical constraint only from publishers that actually intersect the stack column.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The reasoning about the merged rectangle is right, but the consequence does not reach the stack at this head. 69ed15d already stopped the geometry reading a union: stackGeometry folds the published boxes one at a time, taking the largest lift any single one asks for and the shortest height any allows, and useStackGeometry passes it the frames map rather than the merged box. Nothing read the merged field at all. So a monitor dragged left cannot lift the stack to its 120px cap, which is the case pinned by 'two obstacles are folded one at a time, not as their bounding box' in monitor-stack-inset.test.ts, using exactly that geometry.
Marking this down for that reason rather than because the shape was harmless: it was, in fact, the bug, one round earlier. The field you are pointing at was a leftover summary nothing consumed, and since it is what made this look live I have deleted it in 950fc4e and said in the type why the boxes are kept apart.
…ng box Follow-up to the composer fix. Publishing a second box made the store hold two, and reading their union as one obstacle was wrong: a tall monitor and the wide docked composer share almost no area, so the rectangle around the pair covers most of the viewport. stackBottomInset then lifted the stack to its clamp near the top of the screen and put it back over the monitor it was dodging. The chat UI suite caught it on Windows and macOS as the card swallowing the monitor's Close button, at the step that drags the monitor up the column first, which is exactly when the union is most unlike its parts. stackGeometry now folds per box: each asks for the lift it needs, the stack takes the largest, and the height is the shortest any of them allows. The single-box maths is untouched, so its existing cases still pin it. The store keeps the union as a summary only, and says so. Three cases added: the fold against a monitor parked high, which is the case that diverges, plus an empty list and a single box matching the old calls. 1295 node tests pass, typecheck and build clean, and the docked-composer probe still finds the composer under the Send button at three viewports.
The Images and Video pages hold their own status and re-read it on tab activation and on their own actions, never on a timer. Two reads are therefore in flight across an eject: the activation read that saw the pipeline loaded, and the post-eject read that saw it gone. Responses have no order, so the older one could land last and put the loaded status back, leaving the page offering to generate against a runtime that was already free, with no poll coming to correct it. Both pages had it, identically. Every read now takes a ticket before it awaits, and only the newest may write. All three writers on each page go through the same gate, not just the refresh: the load-progress read and the unload response could overwrite a newer answer just as easily. Also drops the merged rectangle the frame store still exposed. Nothing read it after the fold landed, but it was the shape the review picked up on, and it merged obstacles that do not touch: the rectangle around a left-hand monitor and a bottom-right composer spans the empty space between them. The store keeps the boxes apart and says why; stackGeometry already folds them one at a time. Four cases pin the sequencing, all four failing with the pages reverted. 1299 node tests pass, typecheck, i18n parity and build clean.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
) * Repin six UI contracts on what they guard, not how it was spelled Repo tests (CPU) is red on main with six failures. All six are source-shape contracts whose subject was rewritten by #8082 and #8149; in every case the behaviour they exist to protect is intact, and in two cases it is better than what the assertion described. Three in test_update_release_notes.py asserted the literal Tailwind class max-h-[calc(100dvh_-_2rem)]. #8082 replaced that fixed cap with stackGeometry, which subtracts the same 2rem when nothing is in the way and subtracts more when the Live monitor is, so the stack dodges it instead of sitting under it. The arithmetic is checked numerically in monitor-stack-inset.test.ts, which pins stackGeometry(null, W, H).maxHeight to H - 32 among thirteen other cases. What these tests can still add is that every stack element reads it, so they now count stack containers and require a cap on each. Counting matters: there are two such elements, browser and desktop, and capping one and not the other is the mistake worth catching. A fourth test names the node test, so deleting the numeric check does not quietly leave the cap unguarded. Three in test_model_picker_contracts.py: - The routed pick test pinned diffusionRoutePick's second argument, which was respelled from routeSearch.quant to routedFilename. The catalog spec is the third argument and is the thing the test is named for, so the second is no longer matched. - The GGUF guard test required a toast.error in a branch that used to reject a repo-id pick. #8149 made that branch resolve the repo's own .gguf instead, which is the better answer. The invariant that survives is that the branch does something: a bare return there drops the pick with no request and no message. - The deferred-load test required the flush effect to end with }, [active]); and to call handleLoadRef directly. The load body moved into runStagedLoad, shared with the visible path, so the dependency array grew. It now accepts either spelling and, when the helper is used, follows through into it. Mutation-tested, all eight caught: cap dropped from the browser stack; from the desktop stack alone; desktop stack stops measuring itself; node test stops pinning H - 32; repo-id GGUF pick returns bare; routed pick drops its catalog spec; deferred flush clears the flag and stops; runStagedLoad loads nothing. The first two survived an earlier draft that used a plain substring check, which is why the counting form is there. tests/studio: 3 failed, 2795 passed. The three are test_studio_gguf_export_script_pin.py, which fails identically on main and is outside this job's scope. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Bound the deferred-flush match to its own effect Keying the closing boundary on `[active` let a validly reordered dependency array run the match past the effect and on to the next hook, where loadOrStage's own handleLoadRef call satisfied the loader assertion for a flush that loads nothing. Stop at the first boundary and check the deps separately. * Check the catalog spec by position, not by presence The capture is every argument after `wanted`, so a substring check did not prove the spec reached the third parameter. `diffusionRoutePick(wanted, routedFilename ?? loadSpecFor(wanted, IMAGE_CATALOG)?.filename)` type-checks, passes the catalog filename as the quant and drops the spec, which sends curated single-file artifacts down the GGUF branch, and it satisfied the old assertion. Split the argument list on its own commas and pin the third. * Tighten the repinned contract comments --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: danielhanchen <[email protected]>
) * Studio: put the notification rail back in its bottom-right corner The rail was anchored with `fixed bottom-4 right-4` until #8082, which added the loaded models indicator and, with it, a frame store the rail read: the Live monitor, the API monitor panel and the chat composer publish their boxes, and `useStackGeometry` wrote `bottom` and `maxHeight` as inline styles that dodged them. Every input to that placement moves on its own. The composer grows with its input and goes from centred to docked with no resize event, a download row arrives, release notes expand, a banner is dismissed. Each change re-ran the measurement, and when the room fell short the rail lifted over the obstacle at `viewportHeight - frame.top + STACK_GAP`. On the welcome chat that is the cards in the middle of the window; against a maximised monitor the lift clamped at MIN_STACK_ROOM and parked them at the top. It reads as random because the trigger is measurement timing. The store also had to probe its own output, dropping `max-height` to read `scrollHeight` and restoring it with transitions suppressed, because the placement was feeding on the box it had just sized. It went from 184 lines to 701 over nine follow-up PRs, all of them editing the same arithmetic. So this restores the anchor rather than adding another special case. The rail is `fixed bottom-4 right-4` with the CSS cap again, on the named layer rather than the old hard-coded z-index. The frame store keeps its map of boxes, which api-monitor/panel-placement still needs to open the API panel clear of the monitor and the composer, and loses the dodge arithmetic, the measurement loop and the `coverable` licence. The composer still publishes for that panel's sake. The indicator itself is untouched. Known trade-off, and the pre-#8082 behaviour: in a short window a card can sit over the composer's Send button rather than the rail dodging it. The indicator is off by default, draggable and dismissible. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: scroll the rail at its cap instead of spilling cards off screen Review catch, and it reproduces. The cap alone does not contain anything: the cards that cannot shrink lay out past the rail's bottom edge, which is pinned 16px off the floor, so the overflow goes under the bottom of the window with no way to bring it back. At 320x480 with --ui-font-scale 1.25, three cards up: the llama.cpp banner is in flow with its bottom at 497 against a 480px viewport, and the card after it is squeezed to 0px at 505. scrollHeight 501 against clientHeight 448, and overflow-y visible. The Update button is below the fold for good. Earlier sizes missed it because the download panel is the one min-h-0 card in the rail and absorbed the squeeze on its own. Raising the type size puts the two banner floors over the cap and the slack runs out. So the rail scrolls again, in CSS only. No measurement, no placement: the offset and the cap stay where they were. The gutter comes back with it, since overflow-y forces overflow-x and the card shadows clip without it, and stays horizontal so the bottom card keeps sitting on bottom-4. The rail stays click-through. Verified that the fold is still reachable: elementFromPoint over a card returns a node inside it, so the card is the hit target despite the rail being pointer-events-none, and the rail is that node's nearest scrollable ancestor, which is the chain a wheel scrolls. Focus works too: the Update button measured at bottom 481 in a 480px viewport, and focusing it scrolled the rail to 17 and brought it to 464. * Studio: measure the rail's corner off a card, and drop the stale pointer contract Two fixes to the Playwright suite, both mine to begin with. The corner check measured `fromRight` off the rail's border box. The rail carries the shadow gutter, `-mx-3 px-3`, so its border box sits 4px from the viewport edge while the cards it pads sit at 16. It reported 4 and would have failed at every inspected viewport. Measured at 320x480 and at 921x534, one of the two the pass runs: rail 4, every in-flow card 16. It now takes the right edge from the cards, filtered to the ones in flow, since a dragged loaded models card is `fixed` somewhere else. The bottom still comes off the rail: no vertical margin or padding, and its border box does not move when the cards scroll. Checked at both scroll extremes. The other is a contract this branch already invalidated. The suite asserted the rail takes pointer input exactly when it scrolls, which was #9150 and needed the JS that also placed it. The rail is click-through in every state now, so that check failed whenever the rail scrolled. Verified at 320x480 with the rail actually scrolling, scrollHeight 501 against clientHeight 448: pointer-events none, and a click on the gutter lands on the thread viewport behind it. Both assertions are now unconditional. * CI: drop the install and the artifact dir the deleted rail harness owned The vite install in the banner shard exists for playwright_overlay_rail.py and nothing else, so with the harness gone it is dead. Nothing left in studio-ui-smoke.yml touches npm, npx, node_modules or studio/frontend, so on a frontend-dist cache hit it would run a clean `npm ci` for no consumer. logs/playwright-overlay-rail goes with it: it was only ever written by the two steps this branch removed. Job-level setup-node stays. It predates the harness (#9060) and the installer needs node to build the frontend on a cache miss. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…pattern (#11268) * Find the overlay rails by testid, not by the corner spelled into the pattern #11260 moved the rails flush to the bottom-right corner (right-4 -> right-0, max-h-[calc(100dvh_-_8px)] -> max-h-[100dvh]) and paid the inset as inline px padding. Four tests across two files matched the rail with a regex that spelled the old corner into the pattern, so they found nothing and reported the rails as missing rather than as moved: test_overlay_layering.py::test_the_notification_stack_uses_the_named_layer test_update_release_notes.py::test_the_overlay_stack_fits_the_viewport test_update_release_notes.py::test_the_desktop_stack_is_capped_like_the_browser_one test_update_release_notes.py::test_the_download_panel_can_shrink_inside_the_capped_stack The product change is deliberate and documented; the matchers are what move. Both files now find the rails by data-testid="overlay-rail", which is the same reasoning test_update_release_notes.py already grew _class_on_testid for: an anchor built out of the classes under test cannot survive one of them changing. Where the rail sits is now a claim in its own test rather than a side effect of the matcher, and the gutter rule #11260 introduced gets one too: the cap is the whole viewport and the gutters are paid as inline px, so the cards keep the band they had. That test also holds the two floors the comment gives (22px left and 14px top, from the deepest card shadow) and refuses a rem-valued padding utility, which is the #8082 failure the constants exist to avoid. Sabotage-proved: rail off the corner, cap removed, left gutter cut to 4px, and a px-3 utility restored each fail the right test with a message naming the cause. A pure restyle no longer breaks them, which is what went wrong here. * Require the rail's corner ungated, and bind each padding to its own constant Two review items, both right, both the failure this file exists to catch. _applies passes on a gated rule, so md:fixed md:bottom-0 md:right-0 satisfied the corner guarantee while the rail was unpinned below that breakpoint. The file's own matcher tests say a positive guarantee takes _only_under; the rail assertions were the place that did not. Counting "padding*: STACK_" per file said nothing about which constant reached which property. paddingLeft fed from STACK_CARD_INSET_RIGHT still counted two, left the 22px floor vouching for a 28px constant nothing applied, and rendered a 16px gutter that clips the shadow the floor exists for. Now read per rail as a property-to-constant map and compared whole. Both sabotages fail the right test: gating the three utilities fails the corner test, and swapping paddingLeft's constant fails the gutter test. * Read the cap and the padding utilities through their variants Two more of the same shape, both right. The cap was a substring test, so md:max-h-[100dvh] counted as capped while every viewport below that breakpoint could spill cards off screen again. It takes _only_under now, like the corner assertions. The rem-padding refusal matched a bare token only, so !px-3 walked past it -- and an important Tailwind padding beats the non-important inline px padding outright, which is precisely the rem-scaled offset the constants exist to avoid. It reads through _split_variants now, so the variants and the importance marker come off first, and arbitrary rem values are refused alongside the numeric scale. Sabotages: md:max-h-[100dvh] fails the three capping tests, !px-3 and md:!px-3 each fail the gutter test. All three passed before. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Share one JSX scanner, and refuse padding by property rather than by value Three review items, all right, and two of them the same lesson twice. test_overlay_layering.py found the rail with rfind("<")/find(">"). An attribute holding a comparison starts that scan mid-expression and drops every class before it, so a hard-coded z-index earlier in the className is invisible and the layering test passes over the regression it exists to catch. The bracket- and literal-aware scanner it needed already existed in test_update_release_notes.py, so it moves to tests/_shared/jsx_tags.py and both files import it. tests/conftest.py already puts that directory on sys.path for exactly this reason, in its own words: so the levels "share one module rather than each growing a private copy". The padding refusal enumerated spellings and kept missing them: first !px-3, then px-2.5 (fractional, and this repo uses it) and !pr-[0px] / md:!p-[4px] (arbitrary, non-rem, and !important beats the inline declaration outright). Enumerating values has an endless tail, so it matches the PROPERTY now: the rail's padding comes from the inline px style, and ANY padding utility on it is either rem-scaled or an override. Seven spellings sabotage-proved, including all five named in review, plus a plain pt-4. The truncated-tag case is proved too: a comparison attribute before the test id with z-[99] added to the className now fails the layering test. * Cover the logical padding utilities too ps- and pe- were outside the character class, and this repo uses both (ps-9, ps-1.5, ps-[5px], pe-[calc(...)]), so !ps-3 on a rail would have overridden the inline start gutter with a rem-scaled value and passed. The side letter stays optional and a "-" still has to follow it, so pointer-events-none, peer-* and place-items-center are unaffected; that is asserted as a control alongside the four sabotages (ps-3, !ps-3, pe-[calc(1rem)], md:!pe-2), each of which fails the gutter test. * Keep the rail's pointer-events contract, which the new matcher had dropped The class-anchored matcher this PR replaces carried "pointer-events-none" inside its pattern, so the rule was enforced as a side effect of finding the element. Anchoring on the testid found the rail without it, and nothing else asserted it. That is a behaviour contract, not styling. The rail spans its whole cap with a 28px transparent shadow gutter and a scroll region, and the cards inside opt back in with pointer-events-auto (the download panel by name), so a rail that loses the container rule swallows clicks meant for the UI behind it. Asserted ungated, next to the corner rules. Dropping the class fails the test, and so does gating it behind a breakpoint. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Read prohibitions off the whole class expression, not the always-rendered part _class_value answers what the className renders in EVERY state, which is what the positive corner and cap guarantees need. The padding prohibition was reading the same set, and for a "must never" that is the wrong question: cn("...", compact && "!pl-0") overrides the inline gutter whenever compact is true, and an always-rendered reader never sees the token at all. _rail_class_tokens reads the literals out of the whole expression instead, and the two readers stay side by side with the asymmetry written down: "must always have X" and "must never have Y" cannot be answered from the same set. Sabotage: wrapping both rails as cn("...", isUpdating && "!pl-0") now fails the gutter test and passed before. * Cover Tailwind's arbitrary padding properties as well as its utility family Tailwind has two ways to set padding and the guard only knew one. The arbitrary-property form is emitted with !important and, once _split_variants has taken the marker off, begins with "[", so a pattern anchored on "p" never sees ![padding:0px] or [padding-left:0px]! at all. Both spellings now sit in one named pattern. The side letter stays optional with a "-" required after it, so pointer-events-none, peer-* and place-items-* are still out, and [margin-left:4px] and [position:fixed] are too; that control is asserted alongside the four sabotages (![padding:0px], [padding-left:0px]!, md:![padding-inline:1rem], [padding-block:2px]). --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…pattern (unslothai#11268) * Find the overlay rails by testid, not by the corner spelled into the pattern unslothai#11260 moved the rails flush to the bottom-right corner (right-4 -> right-0, max-h-[calc(100dvh_-_8px)] -> max-h-[100dvh]) and paid the inset as inline px padding. Four tests across two files matched the rail with a regex that spelled the old corner into the pattern, so they found nothing and reported the rails as missing rather than as moved: test_overlay_layering.py::test_the_notification_stack_uses_the_named_layer test_update_release_notes.py::test_the_overlay_stack_fits_the_viewport test_update_release_notes.py::test_the_desktop_stack_is_capped_like_the_browser_one test_update_release_notes.py::test_the_download_panel_can_shrink_inside_the_capped_stack The product change is deliberate and documented; the matchers are what move. Both files now find the rails by data-testid="overlay-rail", which is the same reasoning test_update_release_notes.py already grew _class_on_testid for: an anchor built out of the classes under test cannot survive one of them changing. Where the rail sits is now a claim in its own test rather than a side effect of the matcher, and the gutter rule unslothai#11260 introduced gets one too: the cap is the whole viewport and the gutters are paid as inline px, so the cards keep the band they had. That test also holds the two floors the comment gives (22px left and 14px top, from the deepest card shadow) and refuses a rem-valued padding utility, which is the unslothai#8082 failure the constants exist to avoid. Sabotage-proved: rail off the corner, cap removed, left gutter cut to 4px, and a px-3 utility restored each fail the right test with a message naming the cause. A pure restyle no longer breaks them, which is what went wrong here. * Require the rail's corner ungated, and bind each padding to its own constant Two review items, both right, both the failure this file exists to catch. _applies passes on a gated rule, so md:fixed md:bottom-0 md:right-0 satisfied the corner guarantee while the rail was unpinned below that breakpoint. The file's own matcher tests say a positive guarantee takes _only_under; the rail assertions were the place that did not. Counting "padding*: STACK_" per file said nothing about which constant reached which property. paddingLeft fed from STACK_CARD_INSET_RIGHT still counted two, left the 22px floor vouching for a 28px constant nothing applied, and rendered a 16px gutter that clips the shadow the floor exists for. Now read per rail as a property-to-constant map and compared whole. Both sabotages fail the right test: gating the three utilities fails the corner test, and swapping paddingLeft's constant fails the gutter test. * Read the cap and the padding utilities through their variants Two more of the same shape, both right. The cap was a substring test, so md:max-h-[100dvh] counted as capped while every viewport below that breakpoint could spill cards off screen again. It takes _only_under now, like the corner assertions. The rem-padding refusal matched a bare token only, so !px-3 walked past it -- and an important Tailwind padding beats the non-important inline px padding outright, which is precisely the rem-scaled offset the constants exist to avoid. It reads through _split_variants now, so the variants and the importance marker come off first, and arbitrary rem values are refused alongside the numeric scale. Sabotages: md:max-h-[100dvh] fails the three capping tests, !px-3 and md:!px-3 each fail the gutter test. All three passed before. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Share one JSX scanner, and refuse padding by property rather than by value Three review items, all right, and two of them the same lesson twice. test_overlay_layering.py found the rail with rfind("<")/find(">"). An attribute holding a comparison starts that scan mid-expression and drops every class before it, so a hard-coded z-index earlier in the className is invisible and the layering test passes over the regression it exists to catch. The bracket- and literal-aware scanner it needed already existed in test_update_release_notes.py, so it moves to tests/_shared/jsx_tags.py and both files import it. tests/conftest.py already puts that directory on sys.path for exactly this reason, in its own words: so the levels "share one module rather than each growing a private copy". The padding refusal enumerated spellings and kept missing them: first !px-3, then px-2.5 (fractional, and this repo uses it) and !pr-[0px] / md:!p-[4px] (arbitrary, non-rem, and !important beats the inline declaration outright). Enumerating values has an endless tail, so it matches the PROPERTY now: the rail's padding comes from the inline px style, and ANY padding utility on it is either rem-scaled or an override. Seven spellings sabotage-proved, including all five named in review, plus a plain pt-4. The truncated-tag case is proved too: a comparison attribute before the test id with z-[99] added to the className now fails the layering test. * Cover the logical padding utilities too ps- and pe- were outside the character class, and this repo uses both (ps-9, ps-1.5, ps-[5px], pe-[calc(...)]), so !ps-3 on a rail would have overridden the inline start gutter with a rem-scaled value and passed. The side letter stays optional and a "-" still has to follow it, so pointer-events-none, peer-* and place-items-center are unaffected; that is asserted as a control alongside the four sabotages (ps-3, !ps-3, pe-[calc(1rem)], md:!pe-2), each of which fails the gutter test. * Keep the rail's pointer-events contract, which the new matcher had dropped The class-anchored matcher this PR replaces carried "pointer-events-none" inside its pattern, so the rule was enforced as a side effect of finding the element. Anchoring on the testid found the rail without it, and nothing else asserted it. That is a behaviour contract, not styling. The rail spans its whole cap with a 28px transparent shadow gutter and a scroll region, and the cards inside opt back in with pointer-events-auto (the download panel by name), so a rail that loses the container rule swallows clicks meant for the UI behind it. Asserted ungated, next to the corner rules. Dropping the class fails the test, and so does gating it behind a breakpoint. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Read prohibitions off the whole class expression, not the always-rendered part _class_value answers what the className renders in EVERY state, which is what the positive corner and cap guarantees need. The padding prohibition was reading the same set, and for a "must never" that is the wrong question: cn("...", compact && "!pl-0") overrides the inline gutter whenever compact is true, and an always-rendered reader never sees the token at all. _rail_class_tokens reads the literals out of the whole expression instead, and the two readers stay side by side with the asymmetry written down: "must always have X" and "must never have Y" cannot be answered from the same set. Sabotage: wrapping both rails as cn("...", isUpdating && "!pl-0") now fails the gutter test and passed before. * Cover Tailwind's arbitrary padding properties as well as its utility family Tailwind has two ways to set padding and the guard only knew one. The arbitrary-property form is emitted with !important and, once _split_variants has taken the marker off, begins with "[", so a pattern anchored on "p" never sees ![padding:0px] or [padding-left:0px]! at all. Both spellings now sit in one named pattern. The side letter stays optional with a "-" required after it, so pointer-events-none, peer-* and place-items-* are still out, and [margin-left:4px] and [position:fixed] are too; that control is asserted alongside the four sabotages (![padding:0px], [padding-left:0px]!, md:![padding-inline:1rem], [padding-block:2px]). --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Problem
A loaded model is only visible on the page that loaded it. Load something in Chat, then go to the Hub, Train or Images, and nothing on screen says a model is still holding memory. The only way to see what is resident, or to release it, is to navigate back to where it was loaded.
This gets worse with several runtimes in play, because a TTS model, a GGUF chat model and an image model can all be resident at once and no single view shows that.
What this adds
A compact card in the bottom-right listing everything currently in memory, with an eject button per row. Visible from every page.
It reads all four runtimes and merges them into one list:
/api/inference/status/api/inference/unload/api/inference/images/status/api/inference/images/unload/api/inference/video/status/api/inference/video/unload/api/inference/audio/stt/status/api/inference/audio/stt/unloadA TTS load is split out from a chat load by
audio_type. Both come from the same picker and both hold memory, but only one answers prompts, and telling them apart is most of the point. Each row shows its runtime and quantisation (GGUF Q4_K_M,flux cuda), truncated with the full id on hover.It renders only when something is actually loaded.
Placement
It joins the existing bottom-right stack in
provider.tsxwithpositioned={false}, the same slot the web update banner, the llama.cpp update banner and the Hub download panel already flow through. That stack exists so these never overlap, so nothing is obstructed. Toasts are top-right and untouched.Collapses to a small pill with a count, and that choice persists across reloads. Expanded is the default, since a card you have to open first answers nothing.
Settings
Settings, General, Notifications, "Loaded models indicator". On by default. Only an explicit off is stored, mirroring
use-llama-update-pref.ts.Notes on the implementation
unloadResidentfrom the API monitor: read, unload, re-read. An API auto-switch can replace the model between those steps, and/unloadnaming a replaced model is a documented 200 no-op, so a single pass would report success over a model still holding VRAM.images/api,video/apiandapi-monitor/unload-residentare imported directly rather than through their feature indexes, matchingapi-monitor-page.tsx. Those indexes re-export their pages, which__root.tsxdeliberately keeps out of the eager bundle behindlazy(), and this mounts from the root.Tests
10 cases in
tests/loaded-models-sources.test.tscovering the status to row mapping: nothing loaded, an unreachable runtime, GGUF variants, TTS against whisper, a cached non-active model, per-engine dictation rows, absent detail fields, merge order and dedupe, and local path labels.Rebased onto current main and re-run there:
New English strings only. The parity check allows other locales to fall back.