Skip to content

Webui bugfix for single-model mode usage#25738

Open
intel00000 wants to merge 2 commits into
ggml-org:masterfrom
intel00000:fix/webui-context-gauge
Open

Webui bugfix for single-model mode usage#25738
intel00000 wants to merge 2 commits into
ggml-org:masterfrom
intel00000:fix/webui-context-gauge

Conversation

@intel00000

Copy link
Copy Markdown

Overview

Webui bugfix for single-model mode usage

Additional information

In single-model (non-router) mode the server always has its model loaded and the /models/load endpoint does not exist. Current context gauge report the model as unloaded and showed a "Load model" button that will hit /models/load and errored.

See below:

origin   origin_1

Cause: isModelLoaded only checks routerModels, which is empty when not in router mode, so isActiveModelLoaded always false there.

Fix: When not in router mode, treat as model loaded so the gauge hide the load prompt.


Second commit is to persist the context gauge "Token usage details" open state to browser local storage for better UX experience.
fix

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - AI was used to help draft and refine the implementation.

In single-model (non-router) mode the server always has its model loaded and the /models/load endpoint does not exist.

isModelLoaded only checks routerModels, which is empty outside router mode, so isActiveModelLoaded was always false there. When not in router mode, treat as loaded so the gauge hide the load prompt.
@intel00000
intel00000 marked this pull request as ready for review July 15, 2026 20:47
@intel00000
intel00000 requested a review from a team as a code owner July 15, 2026 20:47
Copilot AI review requested due to automatic review settings July 15, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the context gauge behavior in WebUI when connected to a single-model (non-router) server, and improves UX by persisting whether “Token usage details” is expanded across page reloads.

Changes:

  • Treat the active model as “loaded” when not in router mode, preventing the UI from showing a “Load model” action that calls a non-existent endpoint in single-model mode.
  • Add a dedicated localStorage key for the context gauge details open/closed state.
  • Persist the context gauge “Token usage details” open state via the existing persisted() helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tools/ui/src/lib/hooks/use-context-gauge.svelte.ts Adjusts “active model loaded” logic to be correct in non-router (single-model) mode.
tools/ui/src/lib/constants/storage.ts Adds a localStorage key constant for persisting the context gauge details open state.
tools/ui/src/lib/components/app/chat/ChatForm/ChatFormContextGauge/ContextGaugeDetails.svelte Persists the collapsible details open state using localStorage for improved UX.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel00000
intel00000 force-pushed the fix/webui-context-gauge branch from 9d5a82b to d47ce06 Compare July 16, 2026 08:18
@intel00000
intel00000 requested a review from Copilot July 16, 2026 08:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@allozaur
allozaur requested a review from ServeurpersoCom July 20, 2026 14:12
@intel00000
intel00000 force-pushed the fix/webui-context-gauge branch from d47ce06 to 5e5fbf5 Compare July 27, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants