I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
Expected Behavior:
The system should update the vector database with the uploaded document's embeddings.
The user should receive a notification if the embedding process fails.
Actual Behavior:
The system fails to update the vector database with the uploaded document's embeddings.
The user does not receive a notification about the embedding failure.
The document is still uploaded, but its context will be empty if used in a query.
Description
Bug Summary:
If one set Chunk Size to a reasonable value, say 512 or 1024, in Settings → Documents and tries to add a not too large (+300KB .txt) document using https://api.jina.ai/v1 embedding model jina-embeddings-v3, then the error showed below is triggered.
The vector database is not updated but the document is uploaded and available, leaving the user thinking that everything worked. But, In fact, the context will be empty for this document if used in a # query.
The problem occurs even with OpenAI models like text-embedding-3-large. The solution is to use a very large (and unreasonable) chunk sizes like 32K or 64K.
I think we need a clear notification message indicating that embedding failed and, additionally, remove the uploaded document. Maybe also implement some rate limit for v1/embeddingsembeddings endpoints.
Reproduction Details
Steps to Reproduce:
Set the chunk size to a reasonable value (e.g., 512 or less) in Settings → Documents.
Use the jina-embeddings-v3 embedding model via URL https://api.jina.ai/v1 (api key readily available here, no registration required)
Upload a text document (e.g., a 300KB or more .txt file)
The error will appear only in docker logs open-webui
The document can be used for context/RAG search with # but the context is empty.
Logs and Screenshots
Browser Console Logs:
n/a
Docker Container Logs:
ERROR [open_webui.apps.rag.main] 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/app/backend/open_webui/apps/rag/main.py", line 1117, in store_docs_in_vector_db
items=[
^
File "/app/backend/open_webui/apps/rag/main.py", line 1121, in <listcomp>
"vector": embedding_function(text.replace("\n", " ")),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 303, in <lambda>
return lambda query: generate_multiple(query, func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 301, in generate_multiple
return f(query)
^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 284, in <lambda>
func = lambda query: generate_openai_embeddings(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 446, in generate_openai_embeddings
return embeddings[0] if isinstance(text, str) else embeddings
~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
429 Client Error: Too Many Requests for url: https://api.jina.ai/v1/embeddings
Screenshots/Screen Recordings (if applicable):
Additional Information
n/a
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Originally created by @bgeneto on GitHub (Sep 23, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5637
# Bug Report
## Installation Method
Docker compose
## Environment
- **Open WebUI Version:** v0.3.23
- **Ollama (if applicable):** n/a
- **Operating System:** Debian 12
- **Browser (if applicable):** Firefox 98.0
**Confirmation:**
- [x] I have read and followed all the instructions provided in the README.md.
- [x] I am on the latest version of both Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
## Expected Behavior:
- The system should update the vector database with the uploaded document's embeddings.
- The user should receive a notification if the embedding process fails.
## Actual Behavior:
- The system fails to update the vector database with the uploaded document's embeddings.
- The user does not receive a notification about the embedding failure.
- The document is still uploaded, but its context will be empty if used in a query.
## Description
**Bug Summary:**
If one set `Chunk Size` to a reasonable value, say `512` or `1024`, in Settings → Documents and tries to add a not too large (+300KB .txt) document using `https://api.jina.ai/v1` embedding model `jina-embeddings-v3`, then the error showed below is triggered.
The vector database is not updated but the document is uploaded and available, leaving the user thinking that everything worked. But, In fact, the context will be empty for this document if used in a # query.
The problem occurs even with OpenAI models like `text-embedding-3-large`. The solution is to use a very large (and unreasonable) chunk sizes like 32K or 64K.
I think we need a clear notification message indicating that embedding failed and, additionally, remove the uploaded document. Maybe also implement some rate limit for `v1/embeddingsembeddings` endpoints.
## Reproduction Details
**Steps to Reproduce:**
- Set the chunk size to a reasonable value (e.g., 512 or less) in Settings → Documents.
- Use the `jina-embeddings-v3` embedding model via URL `https://api.jina.ai/v1` (api key readily available [here](https://jina.ai/embeddings/), no registration required)
- Upload a text document (e.g., a 300KB or more .txt file)
- The error will appear only in docker logs open-webui
- The document can be used for context/RAG search with # but the context is empty.
## Logs and Screenshots
**Browser Console Logs:**
n/a
**Docker Container Logs:**
```
ERROR [open_webui.apps.rag.main] 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/app/backend/open_webui/apps/rag/main.py", line 1117, in store_docs_in_vector_db
items=[
^
File "/app/backend/open_webui/apps/rag/main.py", line 1121, in <listcomp>
"vector": embedding_function(text.replace("\n", " ")),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 303, in <lambda>
return lambda query: generate_multiple(query, func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 301, in generate_multiple
return f(query)
^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 284, in <lambda>
func = lambda query: generate_openai_embeddings(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/rag/utils.py", line 446, in generate_openai_embeddings
return embeddings[0] if isinstance(text, str) else embeddings
~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
429 Client Error: Too Many Requests for url: https://api.jina.ai/v1/embeddings
```
**Screenshots/Screen Recordings (if applicable):**

## Additional Information
n/a
## Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
After further investigation, I discovered that the Open WebUI's Chunk Size setting is not directly related to the embedding model's context length. Specifically, Chunk Size refers to the query or text character length, not the word/token length. By significantly increasing the Chunk size to 16000 (a word is 7 chars on avg), I was able to resolve the issue, and the system now handles large text files with ease yielding amazing results with jinaai/jina-embeddings-v3 embedding model with the default sentence-transformers/all-MiniLM-L6-v2 reranking.
<!-- gh-comment-id:2369191122 -->
@bgeneto commented on GitHub (Sep 23, 2024):
After further investigation, I discovered that the Open WebUI's Chunk Size setting is not directly related to the embedding model's context length. Specifically, Chunk Size refers to the query or text character length, not the word/token length. By significantly increasing the Chunk size to 16000 (a word is 7 chars on avg), I was able to resolve the issue, and the system now handles large text files with ease yielding amazing results with jinaai/jina-embeddings-v3 embedding model with the default sentence-transformers/all-MiniLM-L6-v2 reranking.
<!-- gh-comment-id:2369534088 -->
@thiswillbeyourgithub commented on GitHub (Sep 23, 2024):
@bgeneto not strictly in topic but you might be interested in my discussion at https://github.com/open-webui/open-webui/discussions/5333
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.
Originally created by @bgeneto on GitHub (Sep 23, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5637
Bug Report
Installation Method
Docker compose
Environment
Open WebUI Version: v0.3.23
Ollama (if applicable): n/a
Operating System: Debian 12
Browser (if applicable): Firefox 98.0
Confirmation:
Expected Behavior:
Actual Behavior:
Description
Bug Summary:
If one set
Chunk Sizeto a reasonable value, say512or1024, in Settings → Documents and tries to add a not too large (+300KB .txt) document usinghttps://api.jina.ai/v1embedding modeljina-embeddings-v3, then the error showed below is triggered.The vector database is not updated but the document is uploaded and available, leaving the user thinking that everything worked. But, In fact, the context will be empty for this document if used in a # query.
The problem occurs even with OpenAI models like
text-embedding-3-large. The solution is to use a very large (and unreasonable) chunk sizes like 32K or 64K.I think we need a clear notification message indicating that embedding failed and, additionally, remove the uploaded document. Maybe also implement some rate limit for
v1/embeddingsembeddingsendpoints.Reproduction Details
Steps to Reproduce:
jina-embeddings-v3embedding model via URLhttps://api.jina.ai/v1(api key readily available here, no registration required)Logs and Screenshots
Browser Console Logs:
n/a
Docker Container Logs:
Screenshots/Screen Recordings (if applicable):
Additional Information
n/a
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
@tjbck commented on GitHub (Sep 23, 2024):
#5638
@bgeneto commented on GitHub (Sep 23, 2024):
After further investigation, I discovered that the Open WebUI's Chunk Size setting is not directly related to the embedding model's context length. Specifically, Chunk Size refers to the query or text character length, not the word/token length. By significantly increasing the Chunk size to 16000 (a word is 7 chars on avg), I was able to resolve the issue, and the system now handles large text files with ease yielding amazing results with jinaai/jina-embeddings-v3 embedding model with the default sentence-transformers/all-MiniLM-L6-v2 reranking.
@thiswillbeyourgithub commented on GitHub (Sep 23, 2024):
@bgeneto not strictly in topic but you might be interested in my discussion at https://github.com/open-webui/open-webui/discussions/5333