Skip to content

Studio: follow a same-model MLX reload in the KV width and int8 prefill settings - #14210

Merged
danielhanchen merged 2 commits into
mainfrom
studio-mlx-same-model-reload-reconcile
Oct 19, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
studio-mlx-same-model-reload-reconcile

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Fixes #8039

Summary

When another tab, or an API auto-switch, reloads the MLX model that is already resident with a different KV cache width or Int8 Prefill setting, this tab kept the old width, the old baseline and the old verdict. The status poll only seeded the MLX group on a model change, plus a recovery branch that needs every field still empty, so once the group held values a same-model reload was ignored. The editor then showed the old width, its verdict badge described a load that is no longer running, and the next Apply re-sent the old width, undoing the other client's change.

The rest of the per-model load settings group already handles this on main: kvCacheDtype, tensorParallel, specDraftNMax, speculativeType and chatTemplateOverride advance their loaded baseline on every settled status and move the control only while it still sits on that baseline (#10627, resolveChatTemplateSeed). The shared Run settings draft (#10851), the matching editor keys in the sidebar and the model picker, and the syncGeneration fence on status reads cover the other parts the issue listed.

This PR puts the MLX group on that same rule and drops the separate recovery branch it no longer needs:

  • loadedMlxKvQuantRequested, loadedMlxInt8PrefillRequested and the verdict fields (mlxKvQuantReason, mlxKvQuantNote, chatTemplateOverrideReason) follow every settled MLX status.
  • mlxKvQuant and mlxInt8Prefill follow while they equal their baseline, or on a model change. A value staged in this tab is kept, and its baseline still advances.
  • A non-MLX status still retires the verdict and leaves the width dormant.

Test plan

  • node --experimental-strip-types --test tests/same-model-reload-load-settings.test.ts: on the merge base the two MLX same-model reload cases fail ('8' !== '4', '8' !== null); with this change all 5 pass. The GGUF case passes on both and pins the existing behaviour.
  • Full frontend suite (npm test): 12681 tests, 0 failures.
  • tsc -p tsconfig.app.json --noEmit clean.
  • pytest tests/studio/test_model_picker_contracts.py tests/studio/test_chat_autoload_failure_gate.py tests/studio/test_cli_attach_load_knobs.py: 355 passed.

Before / after

Two isolated Studio installs, one at this PR's merge base a33463f and one at head 927c1a4. This host has no MLX, so the page is given the status an MLX backend reports for a resident model loaded at 8-bit KV, on a Mac. The status then switches to the same model reloaded at 4-bit by another client, and the window regains focus, which is when Studio re-reads status.

Before, Run settings still shows 8-bit and the 8-bit verdict over a model now running at 4-bit, so Reload would put it back to 8-bit. After, it shows 4-bit and the 4-bit verdict.

Run settings KV Cache Dtype after a same-model MLX reload, before and after

On real Apple Silicon (staging macos-15), a tiny MLX model was loaded twice through Studio's MLX backend at 8-bit and then 4-bit; feeding the two statuses it reported through the merge base leaves the control on 8, and through this PR moves control and baseline to 4.

@danielhanchen danielhanchen self-assigned this Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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 ✅ Completed 2026-10-19T07:32:56.060789Z 927c1a4 Manual request
🔒 Security Review ⚠️ Failed 2026-10-19T07:20:57.461400Z 927c1a4 PR opened
ℹ️ 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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 Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 927c1a40f7

ℹ️ 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 pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 19, 2026
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.

Studio: reconcile the per-model load settings group after a same-model reload

1 participant