Skip to content

Studio: loaded models card and live monitor fixes - #14601

Merged
shimmyshimmer merged 11 commits into
studio-system-monitor-auditfrom
studio-floating-panels
Oct 22, 2026
Merged

shimmyshimmer merged 11 commits into
studio-system-monitor-auditfrom
studio-floating-panels

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Stacked on #14592 (same files); the diff below is against that branch.

What changes for users

Loaded models card

  • Real model names for image and video rows. A model loaded from a local snapshot showed snapshots/<sha>; rows now show the Hub id the backend already sends as display_repo_id. Eject still matches on the real repo_id.

  • Kept models no longer look idle. With "Keep multiple models loaded", models answering requests from extra slots were labelled "Still in memory" and treated as inactive. They now show "Also serving" and eject by their own checkpoint, never the active model.

  • Memory per model. The chat, image and video status routes report an additive, best-effort resident_mib:

    • GGUF: llama.cpp's GPU buffers when logged, else the llama-server RSS.
    • Image and video: the budget the GPU scheduler admitted.

    Rows append it, e.g. "Chat · GGUF · Q4_K_M · 1.0 GiB". Unknown stays hidden.

  • The RAG embedding model is listed (owner only, while resident) and can be ejected from the card.

  • Managed accounts: when another account's model holds the GPU, the card shows one "In use by another account" row instead of nothing.

  • Small fixes:

    • Turning the card on with nothing loaded shows "No models loaded" for a few seconds instead of nothing.
    • An unchanged poll no longer re-renders the card.
    • The first Enter on the collapsed pill after a header drag is no longer swallowed.
    • The card's text goes through i18n, in all 14 locales.

Live monitor

  • No more frozen readings. After two failed polls in a row the values dim and the header says "Reconnecting..." until the server answers again. Before, a dead server left the last numbers on screen as if live.
  • No longer covers the Loaded models card. Both rested in the bottom-right corner, so the monitor hid the card. While the monitor is at its default spot it now rests just above the card; positions you dragged it to are never moved.
  • Keyboard and screen readers.
    • Both panels are labelled regions, and Esc closes them when focus is inside.
    • The drag handles are focusable and labelled; arrow keys move the panel (Shift for bigger steps).
    • Double-click the monitor's handle to put it back in its corner, and a drop within 16 px of the corner snaps back.

How it was verified

  • Frontend: npm run typecheck, npm run i18n:check:strict, the full npm test (13423 pass, 0 fail) and npm run build all pass. New tests: loaded-models-floating-polish, loaded-models-eject-serving, floating-monitor-polish, plus a case in loaded-models-dismiss.
  • Backend: new tests/test_loaded_model_resident_mib.py; related status and media tests pass (390). ruff check is clean.
  • Live on an M3 Max with unsloth/Qwen3-0.6B-GGUF Q4_K_M loaded through llama.cpp:
    • /api/inference/status returns resident_mib: 983, and the card row reads "Chat · GGUF · Q4_K_M · 1.0 GiB".
    • With both panels open their boxes do not overlap.
    • Arrow keys move the monitor, double-click returns it to the corner, and Esc closes it.
    • Stopping the server mid-session turns the monitor to "Reconnecting...", and no llama-server process is left behind.

Both panels with a model loaded:

Live monitor resting above the Loaded models card

The monitor after the server stops:

Live monitor showing Reconnecting

Not tested here

  • Image and video sizes and labels, extra-slot "Also serving" rows, the CUDA GPU-buffer path, and the managed-account row. These need GPU models or a second account with a resident model; they are covered by unit tests only.
  • Some row details are still English: kind labels ("Chat", "Image") and runtime names ("GGUF", "BF16") come from a pure sources module whose tests assert on them.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 22, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 22, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 22, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 22, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T06:14:16.141771Z 6e28467 Manual request
🔒 Security Review ✅ Completed 2026-10-22T06:28:14.002482Z 6e28467 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dd1294f57

ℹ️ 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".

Comment on lines +355 to +359
if (!(before.backend_loaded ?? before.loaded))
return { status: "alreadyFree" };
await useEmbeddingModelStore
.getState()
.applyResidency(unloadEmbeddingModel);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify the embedding model identity before ejecting it

If the embedding model is replaced between the card's five-second polls (for example, from another tab), clicking the stale model A row unloads the newly resident model B. The fresh status read only checks whether any embedder is loaded; it never compares before.embedding_model with entry.name, and /api/settings/embedding-model/unload unconditionally releases the current backend. When the fresh response identifies a different loaded model, return a replaced outcome instead of unloading it, as the image and video eject paths already do.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7092913: a different resident embedder now returns replaced instead of being unloaded.

Comment on lines +229 to +232
const decision = await confirmStopRunningChatsIfNeeded(
"Unloading this model",
"unloadOne",
entry.name,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the serving-model stop confirmation by checkpoint

When two kept local models share a display name but have different checkpoints, ejecting the second one checks the first one's running chats: confirmStopRunningChatsIfNeeded passes entry.name to /active-generations, whose model_slots.serving_slot selects the first matching slot. The subsequent unload correctly uses the checkpoint, so the confirmation and unload target different models. This can reject an unload with 409 without offering the required confirmation, or, after confirmation, stop prompt queues belonging to the model that should remain loaded through requestScopedLocalPromptQueueStop(decision.promptQueueThreadIds). Pass checkpoint to the confirmation helper so both operations address the same slot.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7092913: the running-chat check now gets the checkpoint, the same id the unload uses.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 7092913986

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member

The loaded-models indicator Playwright suite fails on this PR, at the same step on two platforms (base 2dd8e33385):

  • "Chat UI, API, Update and GGUF inference" / Loaded-models indicator (WebKit), job 119636527175
  • "Chat UI Tests" Windows chat lane, job 119636527736
[ui-indicator] FAIL in step 'position restore, drag, released pointer' after 63.0s:
TimeoutError: Locator.bounding_box: Timeout 60000ms exceeded.

Main's recent Mac and Windows UI runs pass this suite, and this PR changes the loaded-models card / live monitor that the step drags. The element the step measures is probably no longer rendered, or no longer matched by the suite's locator, after the restore. Either the card should still restore to its saved position, or the suite needs the new selector in this PR.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf5f898a08

ℹ️ 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".

Comment on lines +284 to +285
if (!name || (active && (checkpoint === activeCheckpoint || name === active))) {
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduplicate the active serving row by checkpoint, not label

When the active model and another kept local model share a display name but have different checkpoints (for example, /x/model.gguf and /y/model.gguf), name === active skips both serving entries. The later loaded loop also skips that name, so the second model disappears from the card despite still occupying memory, leaving no eject control for it. When checkpoint identities are available, compare those alone to exclude the active model; use the display-name fallback only when a checkpoint is unavailable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6e28467: with both checkpoints known the active model is excluded by checkpoint only.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6e28467881

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants