[PR #18219] [CLOSED] feat: add model parameter to use the model name returned from provider #40341

Closed
opened 2026-04-25 12:50:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18219
Author: @understood-the-assignment
Created: 10/10/2025
Status: Closed

Base: devHead: show-provider-model


📝 Commits (1)

  • 1716943 feat: add model parameter to use the model name returned from provider

📊 Changes

8 files changed (+137 additions, -4 deletions)

View changed files

📝 backend/open_webui/main.py (+17 -0)
📝 backend/open_webui/utils/middleware.py (+38 -0)
📝 backend/open_webui/utils/payload.py (+1 -0)
📝 src/lib/apis/index.ts (+3 -1)
📝 src/lib/components/chat/Chat.svelte (+27 -1)
📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+10 -2)
📝 src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte (+39 -0)
📝 src/lib/i18n/locales/en-US/translation.json (+2 -0)

📄 Description

Pull Request Checklist

  • 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: 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 to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • Allow models to surface the provider-returned model id in chat responses when using router models such as Azure "model-router".
  • Add a per-model advanced setting to opt into showing the upstream model name and update the UI to render it when available.

Added

  • Model-level use_provider_model_name flag, stored in chat metadata and persisted in messages when the API response exposes a model field.
  • Advanced params toggle for enabling the provider model name display per model.
  • Response message display logic that prefers the provider model name when the toggle is active.

Changed

  • Chat completion flow now records the provider's model id during streaming and non-streaming responses.
  • Advanced params data model and UI to include the new toggle.

Deprecated

  • n/a

Removed

  • n/a

Fixed

  • n/a

Security

  • n/a

Breaking Changes

  • BREAKING CHANGE: None.

Additional Information

  • Closes https://github.com/open-webui/open-webui/discussions/16728
  • Manual verification performed in local dev environment: toggled the new setting on a model-router model and confirmed the resolved provider model name (e.g., gpt-5-nano-2025-08-07) appears in the chat header.
  • Backend formatting run with npm run format:backend.

Screenshots or Videos

Screenshot 2025-10-10 at 15-40-06 Admin Panel • Open WebUI Screenshot 2025-10-10 at 16-07-14 Greetings and Help 💬 • Open WebUI

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/18219 **Author:** [@understood-the-assignment](https://github.com/understood-the-assignment) **Created:** 10/10/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `show-provider-model` --- ### 📝 Commits (1) - [`1716943`](https://github.com/open-webui/open-webui/commit/1716943bf789a1644a6c7a6818c06365be853aab) feat: add model parameter to use the model name returned from provider ### 📊 Changes **8 files changed** (+137 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+17 -0) 📝 `backend/open_webui/utils/middleware.py` (+38 -0) 📝 `backend/open_webui/utils/payload.py` (+1 -0) 📝 `src/lib/apis/index.ts` (+3 -1) 📝 `src/lib/components/chat/Chat.svelte` (+27 -1) 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+10 -2) 📝 `src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte` (+39 -0) 📝 `src/lib/i18n/locales/en-US/translation.json` (+2 -0) </details> ### 📄 Description # Pull Request Checklist - [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. - [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests to validate the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - Allow models to surface the provider-returned model id in chat responses when using router models such as [Azure "model-router"](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/model-router). - Add a per-model advanced setting to opt into showing the upstream model name and update the UI to render it when available. ### Added - Model-level `use_provider_model_name` flag, stored in chat metadata and persisted in messages when the API response exposes a `model` field. - Advanced params toggle for enabling the provider model name display per model. - Response message display logic that prefers the provider model name when the toggle is active. ### Changed - Chat completion flow now records the provider's model id during streaming and non-streaming responses. - Advanced params data model and UI to include the new toggle. ### Deprecated - n/a ### Removed - n/a ### Fixed - n/a ### Security - n/a ### Breaking Changes - **BREAKING CHANGE**: None. --- ### Additional Information - Closes https://github.com/open-webui/open-webui/discussions/16728 - Manual verification performed in local dev environment: toggled the new setting on a `model-router` model and confirmed the resolved provider model name (e.g., `gpt-5-nano-2025-08-07`) appears in the chat header. - Backend formatting run with `npm run format:backend`. ### Screenshots or Videos <img width="362" height="95" alt="Screenshot 2025-10-10 at 15-40-06 Admin Panel • Open WebUI" src="https://github.com/user-attachments/assets/960e9c10-1bc4-4dc9-a881-b0c8ec77a422" /> <img width="795" height="275" alt="Screenshot 2025-10-10 at 16-07-14 Greetings and Help 💬 • Open WebUI" src="https://github.com/user-attachments/assets/c1ae9185-6f97-4d8f-beca-814437f2f71a" /> ### Contributor License Agreement 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. --- <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-25 12:50:52 -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#40341