Guide
Configuration reference
Settings are environment variables in .env, and 27 of them can also be changed in the app's Settings without a restart. These are the ones you are most likely to change; defaults are the Docker values.
In the app
- Settings changes 27 options in four groups: model (context sizes, thinking, retries, timeouts), retrieval (threshold, depths, keyword search), documents (upload limits, OCR, image previews) and indexing speed (OCR workers, CPU threads, batches).
- Each option shows its .env value and can be reset to it, one at a time or with Reset all to .env. Values saved in the app take precedence over .env and survive restarts; they live in the app_config volume.
- Ports, allowed addresses, Qdrant, memory limits, the largest upload request and the embedding model stay in .env and apply after a restart.
- .env.example has only the model choice active. Every other line shows its default, grouped by whether Settings can also change it.

Model
| Variable | Default | Purpose | In the app |
|---|---|---|---|
| LLM_PROVIDER | ollama | ollama or api | Model & connection |
| LLM_MODEL_NAME | qwen2.5:7b in .env.example | Model that writes answers | Model & connection |
| OLLAMA_DOCKER_BASE_URL | http://host.docker.internal:11434 in .env.example | Ollama address as the app container sees it; http://ollama:11434 for Ollama in Docker | Model & connection |
| MODEL_API_BASE_URL | https://openrouter.ai/api/v1 | OpenAI-compatible endpoint | Model & connection |
| MODEL_API_KEY | empty | Runtime secret, never written to disk | Model & connection |
| MODEL_API_DISCLOSURE_ACKNOWLEDGED | 0 | Consent for an external API | Model & connection |
| OLLAMA_CONTEXT_LENGTH | 8192 | Context Ollama allocates per question | Model & connection |
| OLLAMA_THINK | 0 | Let thinking models reason before answering | Model & connection |
| MODEL_CONTEXT_WINDOW | 32768 | Context assumed for API models | Model & connection |
| MODEL_API_MAX_RETRIES | 4 | Retries for HTTP 5xx and 429 | Model & connection |
| LLM_REQUEST_TIMEOUT_SECONDS | 120 | Per-answer timeout | Model & connection |
| OLLAMA_ALLOWED_HOSTS | empty | Extra hosts an Ollama URL may use | .env only |
Search
| Variable | Default | Purpose | In the app |
|---|---|---|---|
| STRICT_RAG_THRESHOLD | 0.75 | Documents only evidence gate | Answers |
| STRICT_RAG_TOP_K | empty | Fixed Documents only depth, 1–50; empty chooses per question | Answers |
| HYBRID_RETRIEVE_TOP_K | 25 | Hybrid candidate pool | Answers |
| KEYWORD_SEARCH | 1 | BM25 fused with vector search | Answers |
| EMBED_MODEL_NAME | intfloat/multilingual-e5-base | Embedding model; changing it means uploading documents again | .env only |
| EMBED_DEVICE | auto | auto, cpu, cuda or mps | .env only |
| RERANK_MODEL | miniReranker_arabic_v1 | Hybrid reranker; none disables it | .env only |
Documents and OCR
| Variable | Default | Purpose | In the app |
|---|---|---|---|
| PARSRAG_MAX_FILES_PER_SESSION | 10 | Files per conversation | Documents & speed |
| PARSRAG_MAX_FILE_BYTES | 104857600 | 100 MiB per file | Documents & speed |
| PARSRAG_MAX_BATCH_BYTES | 524288000 | 500 MiB per upload | Documents & speed |
| OCR_ENABLED | 1 | Turn OCR on or off | Documents & speed |
| OCR_LANGUAGES | fas+eng | Tesseract languages | Documents & speed |
| OCR_DPI | 200 | Rendering resolution for scanned pages | Documents & speed |
| OCR_MAX_PAGES | 30 | Scanned pages read per file | Documents & speed |
| OCR_MAX_IMAGES | 200 | Images read per Word or PowerPoint file | Documents & speed |
| SOURCE_IMAGE_PREVIEWS | 1 | Keep a copy of each image to show next to its source | Documents & speed |
| PARSRAG_MAX_REQUEST_BYTES | 534773760 | Largest upload request; the limits above can't exceed it | .env only |
Indexing speed
| Variable | Default | Purpose | In the app |
|---|---|---|---|
| OCR_WORKERS | empty | Images read at the same time; empty uses every CPU core, at most 8 | Documents & speed |
| PARSRAG_CPU_THREADS | 4 | CPU threads for embeddings, up to the physical cores | Documents & speed |
| EMBED_BATCH_SIZE | 8 | Texts per embedding pass; 32 with the GPU overlay | Documents & speed |
| QDRANT_UPSERT_BATCH_SIZE | 64 | Passages saved per write | Documents & speed |
Service and memory
| Variable | Default | Purpose | In the app |
|---|---|---|---|
| PARSRAG_PORT | 8000 | Port on your machine | .env only |
| PARSRAG_BIND_HOST | 127.0.0.1 | Address the port is bound to | .env only |
| PARSRAG_ALLOWED_HOSTS | empty | Host names accepted besides localhost, 127.0.0.1 and ::1 | .env only |
| PARSRAG_APP_MEMORY_LIMIT | 6g | App container ceiling | .env only |
| QDRANT_MEMORY_LIMIT | 2g | Qdrant ceiling | .env only |
| OLLAMA_MEMORY_LIMIT | 12g | Ollama container ceiling | .env only |