From f40f7c36e7937c69b3e850acb5c790a67a75f200 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Thu, 9 Apr 2026 09:20:23 +0000 Subject: [PATCH] fix: Access Endpoint button shows only for GGUF and reflects enabled state - Hide button when loaded model is not a GGUF - Fetch endpoint state on model change so the button stays in sync - Green dot indicator when endpoint is running, red when off --- .../frontend/src/features/chat/chat-page.tsx | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx index 12988ea2e2..65080bda3b 100644 --- a/studio/frontend/src/features/chat/chat-page.tsx +++ b/studio/frontend/src/features/chat/chat-page.tsx @@ -634,8 +634,15 @@ print(completion.choices[0].message.content)`, [], ); + // Keep endpoint state in sync whenever the dialog opens or the loaded + // GGUF model changes, so the status indicator in the header button + // reflects reality without the user having to open the dialog first. useEffect(() => { - if (!endpointDialogOpen) return; + if (!inferenceParams.checkpoint || !activeGgufVariant) { + setEndpointEnabled(false); + setEndpointApiKey(""); + return; + } let cancelled = false; authFetch("/api/inference/access-endpoint") .then((res) => (res.ok ? res.json() : null)) @@ -647,7 +654,12 @@ print(completion.choices[0].message.content)`, return () => { cancelled = true; }; - }, [endpointDialogOpen, applyEndpointData]); + }, [ + endpointDialogOpen, + inferenceParams.checkpoint, + activeGgufVariant, + applyEndpointData, + ]); const handleToggleEndpoint = useCallback(async () => { setEndpointLoading(true); @@ -1076,14 +1088,24 @@ print(completion.choices[0].message.content)`, completionTokens={contextUsage.completionTokens} /> ) : null} - {inferenceParams.checkpoint ? ( + {inferenceParams.checkpoint && activeGgufVariant ? ( ) : null}