[PR #22342] [CLOSED] perf(models): replace inline base64 icons with URL references in /api/models response #26622

Closed
opened 2026-04-20 06:36:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22342
Author: @Classic298
Created: 3/6/2026
Status: Closed

Base: devHead: perf/icon-url-dedup


📝 Commits (1)

  • df3e92e perf(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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22342 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 3/6/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `perf/icon-url-dedup` --- ### 📝 Commits (1) - [`df3e92e`](https://github.com/open-webui/open-webui/commit/df3e92e7c1877382cfc6956a0772af4e3004aeee) perf(models): replace inline base64 icons with URL references in /api/models response ### 📊 Changes **3 files changed** (+114 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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 <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:36:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#26622