[PR #2140] [MERGED] feat: configurable model name, description and vision capability #7702

Closed
opened 2025-11-11 17:33:46 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/2140
Author: @cheahjs
Created: 5/9/2024
Status: Merged
Merged: 5/23/2024
Merged by: @tjbck

Base: dev-modelsHead: feat/model-config


📝 Commits (10+)

  • e76a444 feat: allow model config via config.json
  • e69f312 fix: remove unused API for setting model config
  • 584385e fix: revert wip code for settings UI
  • 9bc628c fix: file input not working after rejecting images
  • 8effff6 feat: update translation files
  • 0dbddeb feat: add API endpoint for updating configs
  • 02a4412 feat: add UI support for updating model info
  • fa6e21f fix: update models after deleting model info
  • 0f50c12 fix: formatting
  • 0665703 Merge branch 'dev' into feat/model-config

📊 Changes

56 files changed (+1314 additions, -127 deletions)

View changed files

📝 backend/apps/litellm/main.py (+19 -2)
📝 backend/apps/ollama/main.py (+11 -1)
📝 backend/apps/openai/main.py (+12 -2)
📝 backend/apps/web/internal/db.py (+12 -0)
backend/apps/web/internal/migrations/009_add_models.py (+55 -0)
backend/apps/web/models/models.py (+136 -0)
📝 backend/main.py (+31 -2)
📝 src/lib/apis/index.ts (+74 -0)
📝 src/lib/apis/litellm/index.ts (+2 -1)
📝 src/lib/apis/openai/index.ts (+6 -1)
📝 src/lib/components/admin/Settings/Users.svelte (+1 -1)
📝 src/lib/components/chat/Chat.svelte (+81 -63)
📝 src/lib/components/chat/MessageInput.svelte (+92 -9)
📝 src/lib/components/chat/MessageInput/Models.svelte (+5 -3)
📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+1 -1)
📝 src/lib/components/chat/ModelSelector.svelte (+1 -1)
📝 src/lib/components/chat/ModelSelector/Selector.svelte (+39 -6)
📝 src/lib/components/chat/Settings/Interface.svelte (+5 -2)
📝 src/lib/components/chat/Settings/Models.svelte (+251 -20)
📝 src/lib/components/common/Tooltip.svelte (+2 -1)

...and 36 more files

📄 Description

Pull Request Checklist

  • Target branch: Pull requests should target the dev branch.
  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for the changes?
  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?

Description

Adds the ability to set a custom display name, description, and the vision capability of a model via the web UI, which is then persisted into the database.

image image image image image

A new field custom_info is injected into each model list API. An alternative implementation would be to override the model's name field, but would require additional mapping inside of the proxy endpoints.

If a model is marked as not vision capable,

  1. Image uploads are disabled.
  2. Any existing images that are in the current input are removed - but not any images that are already in the chat
  3. If multiple models are selected, and not all of them are vision capable:
    1. A warning icon is added to image input warning about this
    2. An error toast is shown if a user still sends the prompt.

I've tested locally with Ollama and OpenAI endpoints, have not tested LiteLLM endpoints yet.

Changelog

Added

  • Model Customization: Configure custom display names, descriptions, and vision capabilities for models.
  • Image Input Validation: Models marked as not vision-capable will reject or warn about image uploads.

🔄 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/2140 **Author:** [@cheahjs](https://github.com/cheahjs) **Created:** 5/9/2024 **Status:** ✅ Merged **Merged:** 5/23/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev-models` ← **Head:** `feat/model-config` --- ### 📝 Commits (10+) - [`e76a444`](https://github.com/open-webui/open-webui/commit/e76a444ed9a4f50182f3e580311957ad00a6ff0d) feat: allow model config via config.json - [`e69f312`](https://github.com/open-webui/open-webui/commit/e69f31267af02ae4e83298481f599ab35dc57703) fix: remove unused API for setting model config - [`584385e`](https://github.com/open-webui/open-webui/commit/584385e4bf51b328c10a783c09330bc6926dc273) fix: revert wip code for settings UI - [`9bc628c`](https://github.com/open-webui/open-webui/commit/9bc628ca751d016e7cbf5ceffd57ce3cb0e14125) fix: file input not working after rejecting images - [`8effff6`](https://github.com/open-webui/open-webui/commit/8effff65248af4396bfcaae2709b48b3f5691fc5) feat: update translation files - [`0dbddeb`](https://github.com/open-webui/open-webui/commit/0dbddebcb0f3454fe2e958cd4ed953fa8626d4c3) feat: add API endpoint for updating configs - [`02a4412`](https://github.com/open-webui/open-webui/commit/02a4412dfc077a82ce59e82a3444d6087f4aa790) feat: add UI support for updating model info - [`fa6e21f`](https://github.com/open-webui/open-webui/commit/fa6e21f5e0f9843ea8fbf9022dbf9c8060a7f0bb) fix: update models after deleting model info - [`0f50c12`](https://github.com/open-webui/open-webui/commit/0f50c12c59685b2d92524da0858dc8ba433969c7) fix: formatting - [`0665703`](https://github.com/open-webui/open-webui/commit/06657034018213d785b45066f4996ec634510168) Merge branch 'dev' into feat/model-config ### 📊 Changes **56 files changed** (+1314 additions, -127 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/litellm/main.py` (+19 -2) 📝 `backend/apps/ollama/main.py` (+11 -1) 📝 `backend/apps/openai/main.py` (+12 -2) 📝 `backend/apps/web/internal/db.py` (+12 -0) ➕ `backend/apps/web/internal/migrations/009_add_models.py` (+55 -0) ➕ `backend/apps/web/models/models.py` (+136 -0) 📝 `backend/main.py` (+31 -2) 📝 `src/lib/apis/index.ts` (+74 -0) 📝 `src/lib/apis/litellm/index.ts` (+2 -1) 📝 `src/lib/apis/openai/index.ts` (+6 -1) 📝 `src/lib/components/admin/Settings/Users.svelte` (+1 -1) 📝 `src/lib/components/chat/Chat.svelte` (+81 -63) 📝 `src/lib/components/chat/MessageInput.svelte` (+92 -9) 📝 `src/lib/components/chat/MessageInput/Models.svelte` (+5 -3) 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+1 -1) 📝 `src/lib/components/chat/ModelSelector.svelte` (+1 -1) 📝 `src/lib/components/chat/ModelSelector/Selector.svelte` (+39 -6) 📝 `src/lib/components/chat/Settings/Interface.svelte` (+5 -2) 📝 `src/lib/components/chat/Settings/Models.svelte` (+251 -20) 📝 `src/lib/components/common/Tooltip.svelte` (+2 -1) _...and 36 more files_ </details> ### 📄 Description ## Pull Request Checklist - [x] **Target branch:** Pull requests should target the `dev` branch. - [x] **Description:** Briefly describe the changes in this pull request. - [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for the changes? - [ ] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues? --- ## Description Adds the ability to set a custom display name, description, and the vision capability of a model via the web UI, which is then persisted into the database. <img width="756" alt="image" src="https://github.com/open-webui/open-webui/assets/818368/f5904177-e7bb-4fdb-90b7-f1a1d2fc4e2a"> <img width="496" alt="image" src="https://github.com/open-webui/open-webui/assets/818368/0a5802df-7449-4649-87c0-b81117f0a7eb"> <img width="361" alt="image" src="https://github.com/open-webui/open-webui/assets/818368/d82c8d76-f77b-41bb-89b3-dad60b59ffdc"> <img width="335" alt="image" src="https://github.com/open-webui/open-webui/assets/818368/7f35b275-8ff2-4572-aaf2-4afd088fa8a4"> <img width="1265" alt="image" src="https://github.com/open-webui/open-webui/assets/818368/841648fe-25f6-4b7d-b205-429fc511e23e"> A new field `custom_info` is injected into each model list API. An alternative implementation would be to override the model's `name` field, but would require additional mapping inside of the proxy endpoints. If a model is marked as not vision capable, 1. Image uploads are disabled. 2. Any existing images that are in the current input are removed - but not any images that are already in the chat 3. If multiple models are selected, and not all of them are vision capable: 1. A warning icon is added to image input warning about this 2. An error toast is shown if a user still sends the prompt. I've tested locally with Ollama and OpenAI endpoints, have not tested LiteLLM endpoints yet. ## Changelog ### Added * **Model Customization:** Configure custom display names, descriptions, and vision capabilities for models. * **Image Input Validation:** Models marked as not vision-capable will reject or warn about image uploads. --- <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 2025-11-11 17:33:46 -06: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#7702