[PR #21736] [MERGED] fix: model fallback routing for all model types and default model selection #113563

Closed
opened 2026-05-18 13:59:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21736
Author: @Classic298
Created: 2/22/2026
Status: Merged
Merged: 2/22/2026
Merged by: @tjbck

Base: devHead: fix-fallbacks


📝 Commits (1)

  • 2f66693 fix: model fallback routing for all model types and default model selection

📊 Changes

2 files changed (+8 additions, -5 deletions)

View changed files

📝 backend/open_webui/main.py (+4 -2)
📝 src/lib/components/chat/Chat.svelte (+4 -3)

📄 Description

fix: model fallback routing for all model types and default model selection

Fixes a bug where you'd get model not found errors despite using the enable custom model fallback, because if the default model to fallback to was configured to be, for example, a pipe - then this pipe would not be found when falling back because it would only check in the connection's available models.

Backend: When ENABLE_CUSTOM_MODEL_FALLBACK is active and a custom model's base model is unavailable, the fallback now swaps the model and form data to the configured default model directly. This ensures routing uses the fallback model's type (pipe, Ollama, or OpenAI) instead of the original model's type, which previously caused "Model not found" errors when the fallback was a different backend type.

Frontend: Fixed default model selection in new chat initialization where the admin-configured default models were always overwritten by the first available model. The first-available fallback now only triggers when the configured defaults don't resolve to valid available models.

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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/21736 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 2/22/2026 **Status:** ✅ Merged **Merged:** 2/22/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix-fallbacks` --- ### 📝 Commits (1) - [`2f66693`](https://github.com/open-webui/open-webui/commit/2f66693474fd3f0256f4ebc181db2c565ce2f859) fix: model fallback routing for all model types and default model selection ### 📊 Changes **2 files changed** (+8 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+4 -2) 📝 `src/lib/components/chat/Chat.svelte` (+4 -3) </details> ### 📄 Description fix: model fallback routing for all model types and default model selection <ins>**Fixes a bug where you'd get model not found errors despite using the enable custom model fallback, because if the default model to fallback to was configured to be, for example, a pipe - then this pipe would not be found when falling back because it would only check in the connection's available models.**</ins> Backend: When ENABLE_CUSTOM_MODEL_FALLBACK is active and a custom model's base model is unavailable, the fallback now swaps the model and form data to the configured default model directly. This ensures routing uses the fallback model's type (pipe, Ollama, or OpenAI) instead of the original model's type, which previously caused "Model not found" errors when the fallback was a different backend type. Frontend: Fixed default model selection in new chat initialization where the admin-configured default models were always overwritten by the first available model. The first-available fallback now only triggers when the configured defaults don't resolve to valid available models. ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> 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. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-05-18 13:59:00 -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#113563