mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[GH-ISSUE #18272] issue: Knowledge Collection RAG not working -> Model Conext Length Overrun #57215
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?
Originally created by @rahepler2 on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18272
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.6.33
Ollama Version (if applicable)
NA
Operating System
Linux
Browser (if applicable)
Chrome - but not important here.
Confirmation
README.md.Expected Behavior
When I have a RAG chat and I write into the chat, the model should review the chunks of text on the back end. Then should find the top-k most relevant, and use that to send to the LLM to create a grounded response.
Actual Behavior
I have a knowledge collection attached to the model of around 50 documents. All of them are 1 page, and in markdown format. The top-k is 15, the chunk size in 1500, and the overlap is 225.
For this, when I ask any question of the model I receive:
This model's maximum context length is 128000 tokens. However, your messages resulted in 2892076 tokens. Please reduce the length of the messages.
Changing the top-k will adjust the resulted in xxx tokens.. but won't resolve the issue to a reasonable token amount. There are no tools attached to this model, it's using open ai embeddings, and overall is a basic setup. It should not be struggling with this, and didn't prior to updating.
Steps to Reproduce
Logs & Screenshots
Additional Information
No response
@belugaming commented on GitHub (Oct 13, 2025):
same issue
@tjbck commented on GitHub (Oct 13, 2025):
Duplicate.
@eca-rba commented on GitHub (Nov 4, 2025):
systemprompt has 322 token and prompt has 220 token.
I use Top-K 120, Top-K Reranker 30, Relevance 0,58 und BM25 0,5. Context length of model is 131 072 of gpt-oss-120b with vllm. in openwebui max_token=4096, blocksize 512 and block overlap 100. embedding model bge-m3 and rerank model bge-reranker-v2-m3.
Top-K = 120 → Reranker Top-K = 30, Chunk 512 Tokens ≈ 15 360, metadata,... (~15–30 Tokens/Chunk) ≈ +600–900 citation/IDs/instructions/questions/systemprompt ≈ +800–1 500 = ~16–18k -> so should be enough space in context
but in first prompt with search over rag i get:
max_tokens must be at least 1, got -19333. because the context size is more then 131 072