Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Fix connected chat model persistence (#5702)

Wasim Yousef Said8b235c752bfc
diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx
index 0943e26313e..ce02b0da188 100644
--- a/studio/frontend/src/features/chat/chat-page.tsx
+++ b/studio/frontend/src/features/chat/chat-page.tsx
@@ -993,10 +993,7 @@ export function ChatPage(): ReactElement {
const stillOnOpenRouterFree =
selectedProvider?.providerType === "openrouter" &&
selectedExternal?.modelId === "openrouter/free";
- setInferenceParams({
- ...store.params,
- checkpoint: value,
- });
+ store.setCheckpoint(value, null);
const supportsBuiltinWebSearch = providerSupportsBuiltinWebSearch(
selectedProvider?.providerType,
);
@@ -1117,7 +1114,6 @@ export function ChatPage(): ReactElement {
externalProvidersForChat,
modelsFromStore,
selectModel,
- setInferenceParams,
view,
],
);
diff --git a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
index a2cc5475485..a00b53a44c2 100644
--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
@@ -640,17 +640,6 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
if (state.settingsHydrated && hasKeys(changedParams)) {
saveSettingsPatch({ inferenceParams: changedParams });
}
- // chat-page picks an external model by mutating `params.checkpoint`
- // through this setter (not through `setCheckpoint`), so the
- // localStorage mirror needs to be refreshed here too. Otherwise
- // the persisted slot stays empty and a refresh falls back to
- // whatever the backend's `/api/inference/status.active_model`
- // returns -- usually the previously loaded local model.
- if (params.checkpoint !== state.params.checkpoint) {
- saveLastExternalCheckpoint(
- isExternalModelId(params.checkpoint) ? params.checkpoint : null,
- );
- }
return { params };
}),
setCustomPresets: (customPresets) =>