[PR #21406] [CLOSED] fix: offline model retrieval, re-raise to disable instead of returning useless fallback #113381

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

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21406
Author: @ahxxm
Created: 2/14/2026
Status: Closed

Base: devHead: patch-1


📝 Commits (1)

  • 3c78a4a offline model retrieval: re-raise instead of returning useless fallback

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 backend/open_webui/retrieval/utils.py (+2 -0)

📄 Description

In offline mode (OFFLINE_MODE=True), get_model_path not-so-silently returns the raw model name string as a fallback. This fallback exists such that SentenceTransformer can try to download a model, but when OFFLINE_MODE=True download is blocked, SentenceTransformer emits WARNI: No sentence-transformers model found ... Creating a new one with mean pooling, making retrieval feature appear useful, but not really so.

The fix is re-raise the exception in offline mode. Caller chain already handles this:

  • get_ef() catches, returns None
  • get_rf() catches, re-raises to main.py:1072-1074
  • App starts cleanly with ef=None. Retrieval is disabled until a model is pre-cached or RAG_EMBEDDING_ENGINE setup.

closes #21405

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/21406 **Author:** [@ahxxm](https://github.com/ahxxm) **Created:** 2/14/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`3c78a4a`](https://github.com/open-webui/open-webui/commit/3c78a4add1a56d47c294dd0b2d1633c4ce87b854) offline model retrieval: re-raise instead of returning useless fallback ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/utils.py` (+2 -0) </details> ### 📄 Description <!-- ⚠️ CRITICAL CHECKS FOR CONTRIBUTORS (READ, DON'T DELETE) ⚠️ 1. Target the `dev` branch. PRs targeting `main` will be automatically closed. 2. Do NOT delete the CLA section at the bottom. It is required for the bot to accept your PR. --> In offline mode (`OFFLINE_MODE=True`), `get_model_path` not-so-silently returns the raw model name string as a fallback. This fallback exists such that `SentenceTransformer` can try to download a model, but when `OFFLINE_MODE=True` download is blocked, SentenceTransformer emits `WARNI: No sentence-transformers model found ... Creating a new one with mean pooling`, making retrieval feature appear useful, but not really so. The fix is re-raise the exception in offline mode. Caller chain already handles this: - `get_ef()` catches, returns `None` - `get_rf()` catches, re-raises to `main.py:1072-1074` - App starts cleanly with `ef=None`. Retrieval is disabled until a model is pre-cached or `RAG_EMBEDDING_ENGINE` setup. closes #21405 ### 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:45:07 -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#113381