open-webui/backend/open_webui/utils
June Kim 6ec42e7e9d fix: llamacpp load/unload indicator now detects loaded models via /slots
Fixes #24544

Previously, the loaded indicator only worked for Ollama models (which have
'expires_at' from /api/ps). llama.cpp models served through the Ollama
endpoint don't have 'expires_at' and weren't detected as loaded.

Changes:
- Query /slots endpoint for models without expires_at
- Match slot model IDs to determine loaded status
- Cache server capabilities to avoid 404 spam on standard Ollama servers
- Use asyncio.gather for concurrent /slots requests
- Handle null/empty expires_at values correctly
- Fix URL construction with trailing slash handling

The fix queries /slots concurrently and caches which backends support it,
preventing network spam while adding llama.cpp loaded detection.
2026-05-10 11:34:50 -07:00
..
access_control refac 2026-05-11 02:12:38 +09:00
images refac 2026-04-15 10:17:40 -07:00
mcp refac 2026-04-24 17:04:47 +09:00
telemetry refac 2026-04-24 15:00:47 +09:00
actions.py refac: async db 2026-04-12 14:22:11 -05:00
anthropic.py chore: format 2026-04-14 17:27:31 -05:00
asgi_middleware.py Enhance CommitSessionMiddleware to allow health probes to bypass session management, ensuring faster and more reliable responses. (#24384) 2026-05-09 04:46:00 +09:00
audit.py refac 2026-04-12 16:25:01 -05:00
auth.py chore: format 2026-04-12 18:12:59 -05:00
automations.py refac 2026-05-09 04:17:58 +09:00
calendar.py feat: calendar 2026-04-19 19:15:05 +09:00
channels.py refac 2026-03-17 17:58:01 -05:00
chat.py refac 2026-05-09 04:36:43 +09:00
code_interpreter.py refac 2026-05-09 21:05:49 +09:00
embeddings.py refac: async db 2026-04-12 14:22:11 -05:00
files.py fix: prevent redirect-based SSRF and enforce collecton write access (#24524) 2026-05-11 01:09:15 +09:00
filter.py refac 2026-04-24 18:20:10 +09:00
groups.py refac: async db 2026-04-12 14:22:11 -05:00
headers.py chore: format 2026-05-09 15:25:27 +09:00
logger.py refac 2026-04-10 10:15:55 -07:00
middleware.py chore: format 2026-05-11 02:51:59 +09:00
misc.py refac 2026-05-09 15:46:33 +09:00
models.py fix: llamacpp load/unload indicator now detects loaded models via /slots 2026-05-10 11:34:50 -07:00
oauth.py refac 2026-05-09 21:05:49 +09:00
payload.py refac 2026-05-09 04:17:58 +09:00
pdf_generator.py refac 2026-03-17 17:58:01 -05:00
plugin.py chore: format 2026-05-09 15:25:27 +09:00
rate_limit.py refac 2026-03-17 17:58:01 -05:00
redis.py refac 2026-04-24 15:21:52 +09:00
response.py refac 2026-04-24 16:31:02 +09:00
sanitize.py refac 2026-03-17 17:58:01 -05:00
security_headers.py refac 2026-04-20 09:10:48 +09:00
session_pool.py refac 2026-04-14 01:17:39 -05:00
task.py refac 2026-05-09 04:17:58 +09:00
tools.py refac 2026-05-09 21:05:49 +09:00
validate.py refac 2026-05-11 02:25:11 +09:00
webhook.py refac 2026-04-20 08:34:15 +09:00