mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[PR #24128] [CLOSED] fix: strip whitespace from embedding model name before API calls #43144
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24128
Author: @SymbolStar
Created: 4/25/2026
Status: ❌ Closed
Base:
main← Head:fix/embedding-model-name-trim📝 Commits (1)
768f049fix: strip whitespace from embedding model name before API calls (#24090)📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
backend/open_webui/retrieval/utils.py(+5 -0)📄 Description
Summary
Fixes #24090 — When the embedding model name is configured with trailing/leading whitespace in the Admin Panel (e.g.
qwen3-embedding-4b), the padded string is sent verbatim to the embedding endpoint, causing silent 404 errors. File uploads appear successful in the UI but no vectors are stored.Root Cause
The model name from the admin settings is used as-is in the API request body without trimming. Extra whitespace causes the embedding provider to return 404 (
Model 'qwen3-embedding-4b ' not found).Fix
Add
model = model.strip()at the entry point of all five embedding functions inretrieval/utils.py:generate_openai_batch_embeddingsagenerate_openai_batch_embeddingsgenerate_ollama_batch_embeddingsagenerate_ollama_batch_embeddingsgenerate_embeddings(top-level async dispatcher)This is defense-in-depth — the model name is trimmed regardless of which embedding engine or code path is used.
Testing
qwen3-embedding-4b(trailing space) → trimmed toqwen3-embedding-4b→ embedding succeeds ✅qwen3-embedding-4b(no whitespace) → unchanged ✅🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #24128] fix: strip whitespace from embedding model name before API callsto [PR #24128] [CLOSED] fix: strip whitespace from embedding model name before API calls