Skip to content

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

Closed

Description

@danielhanchen

Split out of #8007, where it was raised against the MLX KV width but is not specific to it.

What happens

When another tab, or an OpenAI-API auto-switch, reloads the checkpoint that is already active with different load settings, applyActiveModelStatusToStore does not adopt the change. hydratingExistingModel is false because the checkpoint did not change, and the unseeded-recovery branch no longer fires once the fields hold values. The status poll therefore leaves the loaded baseline and its verdict stale, and a later Apply from this tab can reload with the old value and undo the other client's change.

This affects the whole per-model load settings group, not one field: kvCacheDtype, tensorParallel, specDraftNMax, speculativeType, chatTemplateOverride and mlxKvBits all reconcile through the same function with the same gate shape.

Why it is not a local fix

Three approaches were tried on #8007 and each moved the defect rather than closing it:

  1. Adopt the control, guarded by a store-level "edit pending" check. ModelConfigPage keeps its draft in component-local useState until Apply, so a store-level guard is blind to exactly the staged edits it is meant to protect. Several of these fields also feed loadedConfigSignature and therefore modelConfigInstanceKey, so adopting one remounts the editor and discards every edit staged there.
  2. Hold the control, adopt only the baseline and verdict. Safe, but it does not help: the baseline is not rendered, its only job is to gate the verdict badge, so a divergence hides the badge instead of revealing it. The stale control still enables Apply.
  3. Adopt on every poll, guarded by a control-versus-echo divergence check. model-selector.tsx keys on id::ggufVariant only, so that host never remounts and its stale draft diverges from the new baseline. And syncInferenceStatusToStore collects status in an unfenced Promise.all, so a status delayed behind a catalog request can land after a reload completes and be adopted regardless of any key.

What closing it actually needs

Some combination of:

  • unifying the React keys across the three editor hosts (sidebar, Hub, model-selector.tsx),
  • plumbing draft ownership into the store instead of leaving it in component-local state,
  • fencing status responses so a delayed reply cannot overwrite a newer one.

That is architectural work and does not belong inside a feature PR. Filing it here so the next MLX or llama.cpp load setting does not have to re-litigate it.

Notes

apply-inference-status-to-store.ts expresses the existing fields as (unseeded || hydrating) in a single spread. The MLX group added in #8007 is split into two spreads, and its recovery branch requires four simultaneous null checks with no non-MLX retire path, so it is close to the others but not identical. Worth unifying as part of the same pass.

Activity

  1. danielhanchen commented on Oct 19, 2026

    @danielhanchen
    MemberAuthor

    Fixed! Sorry on the delay. Most of the load settings group already followed a same-model reload from another tab or an API client after earlier changes, but the MLX KV cache width and Int8 Prefill settings still only updated on a model switch, so Run settings kept the old width and a later Reload could undo the other client's change. They now follow the reload like the rest of the group, fixed in #14210.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions