mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-27 06:46:30 -05:00
[PR #22342] [CLOSED] perf(models): replace inline base64 icons with URL references in /api/models response #130279
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22342
Author: @Classic298
Created: 3/6/2026
Status: ❌ Closed
Base:
dev← Head:perf/icon-url-dedup📝 Commits (1)
df3e92eperf(models): replace inline base64 icons with URL references in /api/models response📊 Changes
3 files changed (+114 additions, -24 deletions)
View changed files
📝
backend/open_webui/routers/functions.py(+57 -1)📝
backend/open_webui/utils/models.py(+56 -22)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+1 -1)📄 Description
The /api/models endpoint previously embedded full base64 icon data inside every action/filter object on every model. With N models sharing M actions, this duplicated each icon blob N times in the JSON payload — easily tens of megabytes in setups with many models and custom actions.
Replace inline base64 data URIs with lightweight URL references to a new GET /api/v1/functions/id/{id}/icon endpoint that serves the icon binary with cache headers. The response shape stays { data: [...] } — fully OpenAI /v1/models compatible.
Changes:
Backend (models.py): Add _resolve_icon/_get_raw_icon helpers that replace data URIs with endpoint URLs and provide an is_svg flag
Backend (functions.py): Add GET /id/{id}/icon endpoint serving icon binary with 24h cache headers
Frontend (ResponseMessage.svelte): Use action.is_svg flag for dark-mode inversion instead of inspecting the data URI string
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.