mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #24173] [CLOSED] feat: auto-assign provider logos to models by id #66391
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/24173
Author: @ikamensh
Created: 4/27/2026
Status: ❌ Closed
Base:
dev← Head:feat/auto-provider-logos📝 Commits (1)
ad850f8feat: auto-assign provider logos to models by id📊 Changes
19 files changed (+334 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/models.py(+13 -0)➕
backend/open_webui/static/providers/LICENSE(+21 -0)➕
backend/open_webui/static/providers/README.md(+30 -0)➕
backend/open_webui/static/providers/claude-color.svg(+1 -0)➕
backend/open_webui/static/providers/cohere-color.svg(+1 -0)➕
backend/open_webui/static/providers/deepseek-color.svg(+1 -0)➕
backend/open_webui/static/providers/gemini-color.svg(+1 -0)➕
backend/open_webui/static/providers/groq.svg(+1 -0)➕
backend/open_webui/static/providers/meta-color.svg(+1 -0)➕
backend/open_webui/static/providers/mistral-color.svg(+1 -0)➕
backend/open_webui/static/providers/moonshot.svg(+1 -0)➕
backend/open_webui/static/providers/ollama.svg(+1 -0)➕
backend/open_webui/static/providers/openai.svg(+1 -0)➕
backend/open_webui/static/providers/perplexity-color.svg(+1 -0)➕
backend/open_webui/static/providers/qwen-color.svg(+1 -0)➕
backend/open_webui/static/providers/xai.svg(+1 -0)➕
backend/open_webui/static/providers/zhipu-color.svg(+1 -0)➕
backend/open_webui/test/util/test_provider_logos.py(+139 -0)➕
backend/open_webui/utils/provider_logos.py(+117 -0)📄 Description
Pull Request Checklist
dev.backend/open_webui/static/providers/from@lobehub/icons-static-svg(MIT, attribution preserved).ruff checkandruff formaton the new files.meta.profile_image_url) keeps full control. The new lookup is a tail fallback, before the existing favicon fallback.feat/auto-provider-logos, rebased ondev.feat:Changelog Entry
Description
Today, models supplied by an upstream connection (OpenAI, OpenRouter, Ollama, ...) show the grey
OIplaceholder unless an admin manually creates a model overlay row with aprofile_image_url. With this change, addinggpt-5,anthropic/claude-opus-4,gemini-2.5-pro,deepseek-v3, etc. to a connection's allowed model list shows the right provider logo immediately. Zero config.The override path is unchanged: an admin-supplied
meta.profile_image_urlalways wins. The regex match runs only when no DB image is set, and before the existing favicon fallback — so unrecognised ids behave exactly like today.Added
GET /api/v1/models/model/profile/image. When the database has noprofile_image_urlfor a model, the route now matches the model id against a small regex table and redirects to a vendored brand SVG.backend/open_webui/static/providers/(sourced from lobehub/lobe-icons, MIT —LICENSEand attributionREADME.mdincluded). Covers OpenAI, Anthropic/Claude, Google/Gemini/Gemma, DeepSeek, Qwen, Zhipu/GLM, Mistral, xAI/Grok, Meta/Llama, Cohere, Perplexity, Moonshot/Kimi, Groq, Ollama (14 files, ~32 KB total).backend/open_webui/utils/provider_logos.py— the matcher module. Documented matching philosophy and how to extend the rule set.backend/open_webui/test/util/test_provider_logos.py— 42-case pytest suite.Changed
backend/open_webui/routers/models.py::get_model_profile_image— adds the new fallback step between the DB-image lookup and the favicon fallback. No behaviour change for models that already have aprofile_image_url.Removed / Deprecated / Fixed / Security / Breaking Changes
None.
Judgment calls
A few things worth calling out for review:
CDN vs bundled SVGs. I bundled. Lobe-icons is MIT-licensed, the SVGs are tiny (~32 KB total), and self-hosting avoids a runtime third-party dependency, works offline, and prevents leaking model identifiers in browser-side requests for default avatars. If you'd rather pull at request time from
cdn.jsdelivr.net, happy to switch.Provider precedence in
host/modelids. For ids likegroq/llama3-70bthe matcher returns the Llama (model brand) logo, not Groq (inference host). Reasoning: it's still a Llama model, just hosted by Groq. The inference-host rules are placed below the model-brand rules so they only fire when no model brand is in the id (e.g. the bare idgroq). Pinned by tests.No new env var / setting. A toggle felt unnecessary — admins who want a specific image for a model already have the existing
meta.profile_image_urloverride, which always wins. Happy to add one if you'd rather make the auto-fallback opt-in.Provider coverage scope. Conservative on purpose — covered the brands users are most likely to enable today. Adding a provider is one regex rule + one SVG + one test row; the matcher's docstring spells out the steps.
Additional Information
_safe_static_redirect_pathpattern in the same file.open_webui/utils/provider_logos.py(top-level utils module, likeheaders.py/misc.py); it does not import from any router or model.Screenshots or Videos
I don't have a deployed instance with an array of brand-named models to capture a clean before/after on. The behaviour is verifiable from the test matrix:
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.