mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #22441] [CLOSED] feat: support upstream model metadata from /v1/models response #26698
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/22441
Author: @mpcusack-altos
Created: 3/8/2026
Status: ❌ Closed
Base:
dev← Head:feat/upstream-model-metadata📝 Commits (1)
4a223a3feat: support upstream model metadata from /v1/models response📊 Changes
2 files changed (+65 additions, -27 deletions)
View changed files
📝
backend/open_webui/routers/models.py(+39 -27)📝
backend/open_webui/utils/models.py(+26 -0)📄 Description
Pull Request Checklist
devmetain/v1/models. Verified: upstream meta populates icons, descriptions, and capabilities in UI; DB overrides take precedence;DEFAULT_MODEL_METADATAstill applies as base.featChangelog Entry
Description
Allow OpenAI-compatible backends to include an optional
metaobject in their/v1/modelsresponse entries. OpenWebUI readsprofile_image_url,description, andcapabilitiesfrom it — applying them as model-specific defaults that sit betweenDEFAULT_MODEL_METADATA(global) and DB model overrides (per-model admin config).This enables managing model presentation (icons, descriptions, capability flags) as infrastructure-as-code on the backend/proxy side, without requiring manual configuration in the OpenWebUI admin UI for each model.
Precedence (lowest to highest):
DEFAULT_MODEL_METADATAconfig (global blanket defaults for all models)metafrom/v1/modelsresponse (model-specific from the backend)Example upstream
/v1/modelsresponse entryAll
metafields are optional — backends can include any combination ofprofile_image_url,description, andcapabilities.Added
meta.profile_image_url,meta.description, andmeta.capabilitiesfrom/v1/modelsresponse entries served by OpenAI-compatible backends (including Ollama)Changed
backend/open_webui/utils/models.py—get_all_models(): added a loop after theDEFAULT_MODEL_METADATAblock that applies upstreammetafields, skipping models with DB overridesbackend/open_webui/routers/models.py—get_model_profile_image(): falls back to in-memory upstream model metadata when no DB model entry exists, soprofile_image_urlfrom upstream/v1/modelsis served even without a DB override (OpenWebUI stripsprofile_image_urlfrom the/api/modelspayload to reduce size and serves images via this dedicated endpoint instead)Why no other files need changes
**modelspread and stores the original inmodel["openai"]info.metafor display and fetches profile images via/model/profile/imageAdditional Information
metaare unaffectedContributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.