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.

Studio: surface Apply for a chat-template-only edit so the override reloads (#6514)

Michael Han4098b4977eea
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
index 2ef4c1573eb..5d597d971b0 100644
--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx
+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
@@ -546,6 +546,12 @@ export function ChatSettingsPanel({
const loadedTensorParallel = useChatRuntimeStore(
(s) => s.loadedTensorParallel,
);
+ const chatTemplateOverride = useChatRuntimeStore(
+ (s) => s.chatTemplateOverride,
+ );
+ const loadedChatTemplateOverride = useChatRuntimeStore(
+ (s) => s.loadedChatTemplateOverride,
+ );
const customContextLength = useChatRuntimeStore((s) => s.customContextLength);
const setCustomContextLength = useChatRuntimeStore(
(s) => s.setCustomContextLength,
@@ -584,8 +590,11 @@ export function ChatSettingsPanel({
const specDirty = speculativeType !== loadedSpeculativeType;
const specDraftDirty = specDraftNMax !== loadedSpecDraftNMax;
const tpDirty = tensorParallel !== (loadedTensorParallel ?? false);
+ // A saved chat-template override is a reload-time setting too, so surface
+ // Apply for a template-only edit (otherwise it could never be applied).
+ const templateDirty = chatTemplateOverride !== loadedChatTemplateOverride;
const modelSettingsDirty =
- kvDirty || ctxDirty || specDirty || specDraftDirty || tpDirty;
+ kvDirty || ctxDirty || specDirty || specDraftDirty || tpDirty || templateDirty;
const [presetNameInput, setPresetNameInput] = useState(activePreset);
const [systemPromptEditorOpen, setSystemPromptEditorOpen] = useState(false);
const [systemPromptDraft, setSystemPromptDraft] = useState("");