mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #24547] fix: llamacpp load/unload indicator now detects loaded models via /slots #98756
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24547
Author: @kimjune01
Created: 5/10/2026
Status: 🔄 Open
Base:
dev← Head:fix-llamacpp-load-indicator-24544-clean📝 Commits (1)
6ec42e7fix: llamacpp load/unload indicator now detects loaded models via /slots📊 Changes
1 file changed (+75 additions, -2 deletions)
View changed files
📝
backend/open_webui/utils/models.py(+75 -2)📄 Description
The current load indicator treats a model as loaded only when
/api/tagsincludesexpires_at, which is standard Ollama behavior. llama.cpp-compatible servers can keep models loaded in/slots, but their/api/tagsresponse does not includeexpires_at, so open-webui shows those models as unloaded.This change adds per-backend detection for
/slotssupport. During model refresh, open-webui fetches/api/tagsand, unless the backend is already known not to support it, probes/slotsconcurrently. A200response caches that backend as supporting/slots; a404caches it as not supporting/slots; transient failures such as timeouts or 5xx responses are logged but not cached.The load indicator now treats a model as loaded when either:
/api/tagsincludesexpires_at/slotsresponse contains that model IDFor llama.cpp
--models-preset, this matches preset names directly when the same identifier appears in both/api/tagsand/slots. Whenprefix_idis configured, both raw and prefixed model IDs are checked.This preserves Ollama behavior while correctly showing llama.cpp slot-loaded models as loaded, without repeatedly probing
/slotson backends that return404.Fixes #24544.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.