When an embedding model name has trailing/leading whitespace (e.g., qwen3-embedding-4b ), Open WebUI sends the padded string verbatim to the embedding API, resulting in a silent 404 error. The UI shows the file as "processed" but no vectors are stored.
Bug
# backend/open_webui/retrieval/utils.py line 686json_data={'input':texts,'model':model}# No strip!
If model = "qwen3-embedding-4b ", the API call becomes:
POST /v1/embeddings
{"input": [...], "model": "qwen3-embedding-4b "}
The API returns 404: Model 'qwen3-embedding-4b ' not found, but this error is silently caught and the file appears processed in the UI.
Fix
Strip whitespace from the model name in both generate_openai_batch_embeddings and agenerate_openai_batch_embeddings:
This ensures that "qwen3-embedding-4b " is correctly treated as "qwen3-embedding-4b".
Testing
Set embedding model to "qwen3-embedding-4b " (with trailing space) in Admin Panel
Upload a file to knowledge base
Before: File appears processed but no vectors stored (404 in logs)
After: File is properly embedded
🔄 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/24228
**Author:** [@PHclaw](https://github.com/PHclaw)
**Created:** 4/29/2026
**Status:** 🔄 Open
**Base:** `main` ← **Head:** `fix/embedding-model-strip-whitespace`
---
### 📝 Commits (1)
- [`23eb403`](https://github.com/open-webui/open-webui/commit/23eb403e58b01d8627ca4108a85639805f0b6350) fix(retrieval): strip embedding model name to avoid silent 404 failures (closes #24090)
### 📊 Changes
**1 file changed** (+2 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/retrieval/utils.py` (+2 -2)
</details>
### 📄 Description
## Summary
Fixes #24090
When an embedding model name has trailing/leading whitespace (e.g., `qwen3-embedding-4b `), Open WebUI sends the padded string verbatim to the embedding API, resulting in a silent 404 error. The UI shows the file as "processed" but no vectors are stored.
## Bug
```python
# backend/open_webui/retrieval/utils.py line 686
json_data = {'input': texts, 'model': model} # No strip!
```
If `model = "qwen3-embedding-4b "`, the API call becomes:
```
POST /v1/embeddings
{"input": [...], "model": "qwen3-embedding-4b "}
```
The API returns 404: `Model 'qwen3-embedding-4b ' not found`, but this error is silently caught and the file appears processed in the UI.
## Fix
Strip whitespace from the model name in both `generate_openai_batch_embeddings` and `agenerate_openai_batch_embeddings`:
```python
# Before
json_data = {'input': texts, 'model': model}
# After
json_data = {'input': texts, 'model': model.strip() if model else model}
```
This ensures that `"qwen3-embedding-4b "` is correctly treated as `"qwen3-embedding-4b"`.
## Testing
1. Set embedding model to `"qwen3-embedding-4b "` (with trailing space) in Admin Panel
2. Upload a file to knowledge base
3. Before: File appears processed but no vectors stored (404 in logs)
4. After: File is properly embedded
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24228
Author: @PHclaw
Created: 4/29/2026
Status: 🔄 Open
Base:
main← Head:fix/embedding-model-strip-whitespace📝 Commits (1)
23eb403fix(retrieval): strip embedding model name to avoid silent 404 failures (closes #24090)📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
backend/open_webui/retrieval/utils.py(+2 -2)📄 Description
Summary
Fixes #24090
When an embedding model name has trailing/leading whitespace (e.g.,
qwen3-embedding-4b), Open WebUI sends the padded string verbatim to the embedding API, resulting in a silent 404 error. The UI shows the file as "processed" but no vectors are stored.Bug
If
model = "qwen3-embedding-4b ", the API call becomes:The API returns 404:
Model 'qwen3-embedding-4b ' not found, but this error is silently caught and the file appears processed in the UI.Fix
Strip whitespace from the model name in both
generate_openai_batch_embeddingsandagenerate_openai_batch_embeddings:This ensures that
"qwen3-embedding-4b "is correctly treated as"qwen3-embedding-4b".Testing
"qwen3-embedding-4b "(with trailing space) in Admin Panel🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.