What this thread does
Do first: run ollama run qwen3.5:4b, then set num_ctx explicitly before deciding how many retrieved passages fit (model). (context setting).
Short answer
As of November 2026, use Ollama 0.40.17 and Open WebUI 0.13.4 as release baselines. Use the same local embeddinggemma model for document and query vectors (Ollama embeddings). A source marker is a reference to inspect, not proof that the cited passage supports the claim.
Choose / don't choose
- Open WebUI: choose a ready-made document UI; follow the quick start and connection guide. Use host.docker.internal to reach the host machine from inside Docker.
- Application-owned citation validator: choose when unsupported claims must be rejected before publication. Don't accept a model-generated filename or a retrieved-document list as evidence of which passage supports an answer.
- Insufficient evidence: return it when retrieval has no supporting fact, parsing lost the fact, or the proposed citation fails source-span or semantic support checks. Don't fill that gap from model memory.
Not for: choosing a vector store; see local-rag-stack-ollama-sqlite-vec-lancedb-or-chroma-private-docs.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
num_ctx | 4096 is a documented explicit example; require instructions + history + question + passages + response allowance to fit it, or select a larger supported budget | Current Ollama generation | Modelfile, context |
num_predict | Use a finite response allowance within that budget; default -1 does not impose a finite output cap | Current Ollama generation | Modelfile |
/api/embed model | embeddinggemma on both document and query calls to http://localhost:11434/api/embed; store the model identity with the index | Current Ollama embedding API | Embedding guide |
RAG_EMBEDDING_ENGINE / RAG_EMBEDDING_MODEL | For the Open WebUI route select ollama, set RAG_EMBEDDING_MODEL to the chosen embedding model | Current Open WebUI | Configuration, embedding model |
truncate | false to reject overlength embedding input instead of silently dropping its tail; default true | Current /api/embed | API |
| Text Splitter / Chunk Size / Chunk Overlap | token / 1000 / 100 are the documented small-context starting values; count actual prompt tokens | Current Open WebUI RAG | Retrieval guide |
| Top K / Always Use Full Text | 3 to 5 / Off for the documented small-context route; three 1000-token passages already consume roughly 3000 tokens | Legacy retrieval | Retrieval guide |
count | Native query_knowledge_files owns this result limit (default 5); admin Top K does not constrain it | Native retrieval | Knowledge |
| Citations | On for numbered source markers and UI source pills; Off removes the numbers the model would need to cite | Current Open WebUI | Citation controls |
Order of operations
1. Extract text and inspect representative scans/tables. Attach a stable document identity, revision and real page/section/offset before chunking; preserve them on each chunk, then embed and store the chunk plus that metadata. tfriedel's source-navigation explanation describes ingestion provenance, inherited page metadata, retrieved source tags and display resolution in that order. 2. Embed each question with the same model/configuration as the corpus. Changing the embedder requires a separate re-embedded index, not just different query vectors. Retrieve before generating; inspect an absent-fact case and a passage near a document's end. 3. Application policy: assign request-local citation labels after final retrieval/reranking/truncation and retain their mapping to the exact source chunks actually sent. Include labels beside passages. Reject labels absent from that map, missing/changed source revisions, and excerpts absent from their cited passage. Keep the original stable identifiers for source resolution. 4. Require each factual claim to follow from its cited passage; a substring match alone is insufficient. Reject an unrelated real quote attached to a plausible answer. If evidence cannot support the requested fact, return insufficient evidence rather than an uncited completion. These are application acceptance rules, not built-in Ollama entailment checks. The distinct correctness and citation-quality dimensions in Gao et al.'s study motivate separate support checks here; this is an application-design inference. 5. In Open WebUI, attach knowledge with # or the model's Knowledge configuration. Keep the selected local embedding service reachable from the app. For isolation, prepare dependencies and follow the offline guide, with external egress controls and external tools disabled separately.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
400: 'NoneType' object has no attribute 'encode' | Missing/misconfigured embedding model | Resave the intended embedding configuration while its local files/service are available, then re-embed a small document | Retrieval troubleshooting |
| Invented numbered citation (symptom) | Citations Off removes source-number markers | Keep Citations On, or cite only returned filenames/URLs; application validation must still reject unsupported claims | Citation controls |
Missing
- The linked source does not confirm: qwen3.5:4b as a generation candidate on the release/embedding pages.
- No universal context size, retrieval threshold or evidence-support score follows from these sources. The Modelfile reference and context guide describe different default context values; explicit sizing avoids relying on either default.
- Page-aware navigation depends on parser metadata and the selected UI path; the contributor report is not an accuracy benchmark.
Checked
2026-11-12; both releases, model page, Ollama context/Modelfile/embedding references, Open WebUI setup/connection/knowledge/retrieval/citation/offline pages and the dated source-navigation discussion read. Gao et al. citation-evaluation abstract also read. No model or document pipeline executed.
Started from a post by @Open WebUI, packaged by the editor. Original post