Configuration¶
Every setting is an environment variable. They are read from src/.env
when you run the app locally, or from docker/env/.env.app in Docker. Real
environment variables override the file.
src/.env.example documents every setting with comments. This page lists
them all by group, with their defaults. Restart the app after a change.
Changing the embedding model or the vector DB
Each collection is bound to the model that created it. After changing
EMBEDDING_PROVIDER, EMBEDDING_MODEL, EMBEDDING_DIMENSIONS or
VECTOR_DB_BACKEND, run reindex on your
projects. Until then, vector search on them returns 409. Keyword search
keeps working.
App¶
| Setting | Default | |
|---|---|---|
APP_NAME |
pagelore |
Shown by GET / |
APP_VERSION |
0.1.0 |
Shown by GET / |
Authentication¶
See Authentication.
| Setting | Default | |
|---|---|---|
AUTH_ENABLED |
false |
Requests need an API key |
ADMIN_API_KEY |
empty | An admin key from the environment (at least 32 characters), to create the first keys |
Vector DB¶
See Vector databases.
| Setting | Default | |
|---|---|---|
VECTOR_DB_BACKEND |
QDRANT |
QDRANT, CHROMA, PINECONE, WEAVIATE, MILVUS, PGVECTOR, FAISS, LANCEDB, ELASTICSEARCH |
VECTOR_DB_PATH |
vector_db |
Folder under src/assets/database/ for embedded mode |
VECTOR_DB_DISTANCE_METHOD |
cosine |
cosine or dot |
VECTOR_DB_URL |
empty | Server or cloud URL. Empty: embedded mode |
VECTOR_DB_API_KEY |
empty | For cloud services |
PINECONE_CLOUD |
aws |
Pinecone serverless index location |
PINECONE_REGION |
us-east-1 |
Embeddings¶
See Embedding providers.
| Setting | Default | |
|---|---|---|
EMBEDDING_PROVIDER |
SENTENCE_TRANSFORMERS |
One of 18 providers |
EMBEDDING_MODEL |
the provider's default | |
EMBEDDING_DIMENSIONS |
empty | Shorter vectors, for models that support it |
EMBEDDING_API_KEY |
empty | For hosted providers |
EMBEDDING_URL |
the provider's default | Server or endpoint |
EMBEDDING_BATCH_SIZE |
the provider's | Texts per request, capped by the provider's limit |
EMBEDDING_QUERY_PREFIX |
"" |
Text put before queries, for models that expect it |
EMBEDDING_DOCUMENT_PREFIX |
"" |
Text put before documents |
EMBEDDING_NORMALIZE |
true |
L2-normalize vectors. Keep true with dot |
EMBEDDING_DEVICE |
auto | sentence-transformers: cpu, cuda or mps |
EMBEDDING_TRUST_REMOTE_CODE |
false |
sentence-transformers models with custom code |
Shared provider settings¶
Used by embeddings, the reranker and the LLM.
| Setting | Default | |
|---|---|---|
AZURE_OPENAI_API_VERSION |
2024-10-21 |
Azure OpenAI |
GOOGLE_CLOUD_PROJECT |
empty | Use Gemini through Vertex AI |
GOOGLE_CLOUD_LOCATION |
empty | |
HUGGINGFACE_INFERENCE_PROVIDER |
auto | For example hf-inference |
AWS_REGION |
empty | Bedrock |
Reranker¶
See Reranking.
| Setting | Default | |
|---|---|---|
RERANKER_PROVIDER |
empty | Empty: no reranker |
RERANKER_MODEL |
the provider's default | |
RERANKER_API_KEY |
empty | |
RERANKER_URL |
the provider's default | |
RERANKER_BATCH_SIZE |
the provider's | |
RERANKER_DEVICE |
auto | sentence-transformers: cpu, cuda or mps |
RERANKER_TRUST_REMOTE_CODE |
false |
|
RERANKER_MAX_LENGTH |
the model's | sentence-transformers: tokens per query + document |
RERANK_BY_DEFAULT |
false |
Rerank requests that don't set rerank |
LLM¶
See LLM.
| Setting | Default | |
|---|---|---|
LLM_PROVIDER |
empty | Empty: no LLM |
LLM_MODEL |
the provider's default | |
LLM_API_KEY |
empty | |
LLM_URL |
the provider's default | |
LLM_TEMPERATURE |
empty | Empty: the model's default |
LLM_MAX_TOKENS |
4096 |
Most tokens per reply, reasoning included |
LLM_STRUCTURED_OUTPUT |
the provider's best | schema, json or prompt |
LLM_TIMEOUT |
120 |
Seconds per request |
LLM_MAX_RETRIES |
2 |
|
LLM_CONCURRENCY |
4 |
Parallel requests of one job |
LLM_CONTEXT_MAX_DOCUMENT_CHARS |
60000 |
Document text sent with each chunk for llm_context |
Knowledge graph¶
For the gliner graph extractor (the
gliner extra). The other graph settings are per project.
| Setting | Default | |
|---|---|---|
GRAPH_GLINER_MODEL |
urchade/gliner_multi-v2.1 |
A Hugging Face model id or a local folder |
GRAPH_GLINER_THRESHOLD |
0.5 |
The lowest confidence kept |
GRAPH_GLINER_DEVICE |
cpu |
cpu, cuda or mps |
Metadata DB (Postgres)¶
| Setting | Default | |
|---|---|---|
POSTGRES_USERNAME |
admin |
|
POSTGRES_PASSWORD |
admin |
Change it outside local development |
POSTGRES_HOST |
localhost |
postgres in Docker Compose |
POSTGRES_PORT |
5432 |
|
POSTGRES_MAIN_DATABASE |
pagelore |
Ingestion¶
See Ingestion.
| Setting | Default | |
|---|---|---|
FILE_MAX_SIZE_MB |
100 |
Largest file, or archive member |
FILE_MAX_FILES_PER_REQUEST |
50 |
Files per upload request |
ARCHIVE_MAX_FILES |
1000 |
Files read from one archive |
ARCHIVE_MAX_TOTAL_SIZE_MB |
1024 |
Total unpacked size of one archive |
FILE_KEEP_ORIGINALS |
true |
Keep originals under src/assets/files/<project_id>/ so documents can be re-extracted (reload) |
Chunking¶
The server defaults. A project's chunking overrides them, and a request's
options override the project's. See Chunking.
| Setting | Default | |
|---|---|---|
CHUNKING_STRATEGY |
auto |
auto, fixed, token, recursive, sentence, paragraph, page, markdown, code, semantic, table, json |
CHUNK_SIZE |
1000 |
|
CHUNK_OVERLAP |
200 |
|
CHUNK_LENGTH_UNIT |
chars |
chars or tokens (needs the tiktoken extra) |
CHUNK_TOKEN_ENCODING |
cl100k_base |
tiktoken encoding |
CHUNK_CONTEXTUAL_HEADER |
false |
Embed each chunk with a file / page / section header |
CHUNK_LLM_CONTEXT |
false |
Contextual retrieval: an LLM-written context per chunk |
PARENT_CHUNK_SIZE |
empty | Small-to-big parents. Empty: off |
Web pages¶
See Text, web and S3.
| Setting | Default | |
|---|---|---|
URL_FETCH_TIMEOUT_SECONDS |
30 |
|
URL_MAX_PAGES |
500 |
Most pages one crawl fetches |
URL_CRAWL_DELAY_MS |
250 |
Pause between requests of a crawl. robots.txt Crawl-delay is obeyed too |
URL_ALLOW_PRIVATE_NETWORKS |
false |
Allow private, loopback and link-local addresses. Keep false when API users are not trusted (SSRF) |
URL_USER_AGENT |
PageloreBot/0.1 |
S3¶
Needs the s3 extra. Credentials are read only from here, never from
requests.
| Setting | Default | |
|---|---|---|
S3_ACCESS_KEY_ID |
empty | Empty: boto3's default chain (AWS_* variables, ~/.aws, an IAM role) |
S3_SECRET_ACCESS_KEY |
empty | |
S3_SESSION_TOKEN |
empty | |
S3_REGION |
empty | |
S3_ENDPOINT_URL |
empty | S3-compatible storage: MinIO, Cloudflare R2, B2, Wasabi, ... |
S3_ADDRESSING_STYLE |
auto |
auto, path or virtual (MinIO usually needs path) |
S3_BUCKETS |
empty | Comma-separated buckets requests may read. Empty: any the credentials can |
S3_MAX_OBJECTS |
1000 |
Most objects one request imports (a request's max_objects can ask for fewer) |
Background jobs¶
See Background jobs.
| Setting | Default | |
|---|---|---|
JOB_WORKERS |
2 |
Worker threads in the API process. 0: this process only queues jobs |
JOB_POLL_SECONDS |
2 |
How often an idle worker checks the queue |
JOB_STALE_SECONDS |
120 |
A running job with no heartbeat for this long is taken as dead and queued again |
JOB_MAX_ATTEMPTS |
3 |
Runs before an interrupted job is failed instead of queued again |
JOB_RETENTION_DAYS |
14 |
Finished jobs are deleted after this many days |
Retrieval¶
| Setting | Default | |
|---|---|---|
TEXT_SEARCH_LANGUAGE |
english |
Keyword index language of new projects. simple for no stemming |
File types¶
See File types.
| Setting | Default | |
|---|---|---|
OCR_LANGUAGES |
eng |
Tesseract languages joined with +, e.g. eng+ara |
PDF_REMOVE_HEADERS_FOOTERS |
true |
Remove running headers, footers and page numbers |
TRANSCRIPTION_PROVIDER |
LOCAL |
LOCAL (faster-whisper) or OPENAI (any OpenAI-compatible /audio/transcriptions) |
TRANSCRIPTION_MODEL |
base / whisper-1 |
LOCAL: tiny, base, small, medium, large-v3, turbo |
TRANSCRIPTION_URL |
https://api.openai.com/v1 |
OPENAI only |
TRANSCRIPTION_API_KEY |
empty | |
TRANSCRIPTION_DEVICE |
auto | LOCAL: cpu, cuda or auto |
Docling¶
See Docling.
| Setting | Default | |
|---|---|---|
DOCUMENT_EXTRACTOR |
native |
native or docling. A project or an upload can pick its own |
DOCLING_EXTENSIONS |
all it reads | For example pdf,docx,pptx |
DOCLING_FALLBACK |
true |
Use the native loader when Docling fails |
DOCLING_OCR |
true |
|
DOCLING_TABLE_STRUCTURE |
true |
|
DOCLING_TIMEOUT |
none | Seconds per document |
DOCLING_DEVICE |
auto | cpu, cuda, mps, xpu or auto |
DOCLING_ARTIFACTS_PATH |
empty | Pre-downloaded models, for offline servers |
Seeing the active configuration¶
| Endpoint | Shows |
|---|---|
GET /api/v1/data/file-types |
File types and whether each is usable here, strategies, chunking defaults, limits |
GET /api/v1/embeddings/model |
Embedding provider, model and dimension |
GET /api/v1/rerank/model |
The reranker |
GET /api/v1/llm/model |
The LLM |
GET /api/v1/projects/{id}/index |
Whether a project's index matches the configured vector DB and model |