[PR #14764] [CLOSED] feat: Pin models to the sidebar #10377

Closed
opened 2025-11-11 19:03:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/14764
Author: @Classic298
Created: 6/7/2025
Status: Closed

Base: devHead: pin-model-to-sidebar


📝 Commits (3)

  • b9f8337 Feat/pin models to sidebar (#5)
  • 03d496f fix: create model
  • ca78c60 feat: better design, collapsible sidebar pinned models and extra button in workspace and admin settings

📊 Changes

9 files changed (+360 additions, -9 deletions)

View changed files

backend/open_webui/migrations/versions/beb99ce2cdd8_add_pinned_to_sidebar_to_model.py (+33 -0)
📝 backend/open_webui/models/models.py (+19 -9)
📝 backend/open_webui/routers/models.py (+47 -0)
📝 src/lib/apis/models/index.ts (+31 -0)
📝 src/lib/components/admin/Settings/Models/ModelMenu.svelte (+53 -0)
📝 src/lib/components/chat/Chat.svelte (+29 -0)
📝 src/lib/components/layout/Sidebar.svelte (+77 -0)
📝 src/lib/components/workspace/Models/ModelEditor.svelte (+24 -0)
📝 src/lib/components/workspace/Models/ModelMenu.svelte (+47 -0)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made 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: (Please check if any docs need updating, e.g., for new settings)
  • Dependencies: (No new dependencies were added for this feature)
  • Testing: (Manual testing was performed throughout development)
  • Code review: (Self-review and iterative refinement performed)
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • feat: Introduces a new feature or enhancement to the codebase

feat: Implement Pin Model to Sidebar Feature

  • Addresses:

  • Core intention of this PR:

    • Custom Models / Custom GPTs are currently located in the same universal model selector as all other models! This makes sense, logically, but some users would want to see custom models/custom GPTs in the sidebar, to mimick the design of ChatGPT, where custom GPTs are also shown in the sidebar menu and not in the top model selector
      • This allows to differentiate models from custom GPTs (manually, by pinning a custom model)
    • Greater flexibility: You can pin normal models or custom models, both is possible. If you want to pin your favorite models for quick access you can now do so
    • Instead of having to click on the model selector, then scroll and search for the model and select the model, you can just click on your desired model on the sidebar and instantly have it selected as a model to chat with ensuring super fast model selection and a more streamlined workflow with your favorite and most used models!

This pull request introduces a new feature allowing you to pin models to the sidebar for quick access. You can pin/unpin models from both the Admin Model Settings and the Workspace Model Editor.

Pinned models appear in a dedicated section in the sidebar, respecting your permissions and model visibility (active/hidden status).

Clicking a pinned model selects it for a new chat, updating the URL and the main model selector UI.

Hiding a model or disabling a model will still hide it from the pinned sidebar area to preserve expected behaviour.

Changelog Entry

Description

Introduces a "Pin model to sidebar" feature, allowing you to quickly access your favorite models directly from the sidebar. This enhances your experience by providing customizable shortcuts to frequently used models.

Added

  • Pin Model Functionality:
    • New boolean field pinned_to_sidebar in the Model database schema and corresponding Pydantic models.
    • Checkbox in Admin Model Settings (via ModelEditor.svelte) to pin/unpin base models.
    • Checkbox in Workspace Model Editor (ModelEditor.svelte) to pin/unpin custom models.
  • Sidebar Display:
    • New "Pinned Models" section in Sidebar.svelte.
    • Displays pinned models with their icon and name (truncated if long).
    • Clicking a pinned model updates the URL (/?model=MODEL_ID) and selects it for a new chat.
  • API Endpoint:
    • New backend API endpoint GET /api/v1/models/pinned to fetch models that are pinned, active, not hidden, and accessible by you.
  • Chat Interface Reactivity:
    • Chat.svelte now listens to URL changes for the model query parameter, updating the selected model in the UI and for new chat sessions when a pinned model is clicked.
  • Admin Override:
    • Admin users can, as expected, view all pinned models in the sidebar that are active and not hidden, regardless of specific model ownership or access control settings.

Additional Information

  • This feature aims to improve your workflow by providing quick access to frequently used models.
  • Iterative debugging and testing were performed to address issues related to data saving, API filtering, and frontend reactivity.

Screenshots or Videos

!!! VIDEO NO LONGER 100% UP-TO-DATE !!!
Latest commit changed design of sidebar pinned model area and made it collapsible.

https://github.com/user-attachments/assets/1f3d1da0-1f69-4051-8837-725825e6324c

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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/14764 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 6/7/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `pin-model-to-sidebar` --- ### 📝 Commits (3) - [`b9f8337`](https://github.com/open-webui/open-webui/commit/b9f8337fb4cd0d78747411875cc87e50b6caa575) Feat/pin models to sidebar (#5) - [`03d496f`](https://github.com/open-webui/open-webui/commit/03d496fc6d2e856e1c006969d468957782a3b020) fix: create model - [`ca78c60`](https://github.com/open-webui/open-webui/commit/ca78c6025b955398f74a262a9a7b6fe9a8c1083e) feat: better design, collapsible sidebar pinned models and extra button in workspace and admin settings ### 📊 Changes **9 files changed** (+360 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `backend/open_webui/migrations/versions/beb99ce2cdd8_add_pinned_to_sidebar_to_model.py` (+33 -0) 📝 `backend/open_webui/models/models.py` (+19 -9) 📝 `backend/open_webui/routers/models.py` (+47 -0) 📝 `src/lib/apis/models/index.ts` (+31 -0) 📝 `src/lib/components/admin/Settings/Models/ModelMenu.svelte` (+53 -0) 📝 `src/lib/components/chat/Chat.svelte` (+29 -0) 📝 `src/lib/components/layout/Sidebar.svelte` (+77 -0) 📝 `src/lib/components/workspace/Models/ModelEditor.svelte` (+24 -0) 📝 `src/lib/components/workspace/Models/ModelMenu.svelte` (+47 -0) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [X] **Target branch:** Please verify that the pull request targets the `dev` branch. - [X] **Description:** Provide a concise description of the changes made in this pull request. - [X] **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:** (Please check if any docs need updating, e.g., for new settings) - [ ] **Dependencies:** (No new dependencies were added for this feature) - [X] **Testing:** (Manual testing was performed throughout development) - [X] **Code review:** (Self-review and iterative refinement performed) - [X] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **feat**: Introduces a new feature or enhancement to the codebase --- # feat: Implement Pin Model to Sidebar Feature - Addresses: - https://github.com/open-webui/open-webui/discussions/13628 - https://github.com/open-webui/open-webui/discussions/11347 - Core intention of this PR: - Custom Models / Custom GPTs are currently located in the same universal model selector as all other models! This makes sense, logically, but some users would want to see custom models/custom GPTs in the sidebar, to mimick the design of ChatGPT, where custom GPTs are also shown in the sidebar menu and not in the top model selector - This allows to differentiate models from custom GPTs (manually, by pinning a custom model) - Greater flexibility: You can pin normal models or custom models, both is possible. If you want to pin your favorite models for quick access you can now do so - Instead of having to click on the model selector, then scroll and search for the model and select the model, you can just click on your desired model on the sidebar and instantly have it selected as a model to chat with ensuring super fast model selection and a more streamlined workflow with your favorite and most used models! This pull request introduces a new feature allowing you to pin models to the sidebar for quick access. You can pin/unpin models from both the Admin Model Settings and the Workspace Model Editor. Pinned models appear in a dedicated section in the sidebar, respecting your permissions and model visibility (active/hidden status). Clicking a pinned model selects it for a new chat, updating the URL and the main model selector UI. Hiding a model or disabling a model will still hide it from the pinned sidebar area to preserve expected behaviour. # Changelog Entry ### Description Introduces a "Pin model to sidebar" feature, allowing you to quickly access your favorite models directly from the sidebar. This enhances your experience by providing customizable shortcuts to frequently used models. ### Added - **Pin Model Functionality:** - New boolean field `pinned_to_sidebar` in the `Model` database schema and corresponding Pydantic models. - Checkbox in Admin Model Settings (via `ModelEditor.svelte`) to pin/unpin base models. - Checkbox in Workspace Model Editor (`ModelEditor.svelte`) to pin/unpin custom models. - **Sidebar Display:** - New "Pinned Models" section in `Sidebar.svelte`. - Displays pinned models with their icon and name (truncated if long). - Clicking a pinned model updates the URL (`/?model=MODEL_ID`) **and selects it for a new chat.** - **API Endpoint:** - New backend API endpoint `GET /api/v1/models/pinned` to fetch models that are pinned, active, not hidden, and accessible by you. - **Chat Interface Reactivity:** - `Chat.svelte` now listens to URL changes for the `model` query parameter, updating the selected model in the UI and for new chat sessions when a pinned model is clicked. - **Admin Override:** - Admin users can, as expected, view all pinned models in the sidebar that are active and not hidden, regardless of specific model ownership or access control settings. --- ### Additional Information - This feature aims to improve your workflow by providing quick access to frequently used models. - Iterative debugging and testing were performed to address issues related to data saving, API filtering, and frontend reactivity. ### Screenshots or Videos !!! VIDEO NO LONGER 100% UP-TO-DATE !!! Latest commit changed design of sidebar pinned model area and made it collapsible. https://github.com/user-attachments/assets/1f3d1da0-1f69-4051-8837-725825e6324c ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <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 19:03:20 -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#10377