Repository navigation
Expand file tree
/
Copy pathdocket.example.toml
More file actions
181 lines (168 loc) · 7.52 KB
/
Copy pathdocket.example.toml
File metadata and controls
181 lines (168 loc) · 7.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# docket settings. Pass --config PATH or set DOCKET_CONFIG; the docket CLI and
# docket-api also read ./docket.toml (importing the library does not). Environment variables override this
# file; command-line options and ProcessOptions override both.
# Every line below shows the built-in default; uncomment what you change.
# `docket config show` prints the effective values and where each came from.
[llm]
# 'ollama' (local or cloud Ollama) or 'openai' (any OpenAI-compatible Chat Completions
# API: Mistral, OpenAI, Azure OpenAI, vLLM, LM Studio). Env: DOCKET_LLM_PROVIDER.
# provider = "ollama"
# Ollama server URL. Env: OLLAMA_HOST.
# ollama_host = "http://localhost:11434"
# Base URL of the OpenAI-compatible API. Env: DOCKET_LLM_BASE_URL.
# base_url = "https://api.openai.com/v1"
# API key for the OpenAI-compatible API. Env: DOCKET_LLM_API_KEY.
# api_key = "" # unset
# Model for classification and extraction (required). Env: DOCKET_TEXT_MODEL.
# text_model = ""
# Model that reads page images (the vlm OCR backend); empty makes vlm unavailable.
# Env: DOCKET_VISION_MODEL.
# vision_model = ""
# openai provider: 'json_schema' sends the extraction schema for constrained decoding
# (falling back to 'json_object' where the server refuses it); 'json_object' never
# sends it. Env: DOCKET_LLM_STRUCTURED_OUTPUT.
# structured_output = "json_schema"
# Extra attempts when the model's output fails the schema. Env:
# DOCKET_MAX_EXTRACT_RETRIES.
# max_extract_retries = 2
# Longest text sent in one extraction call; longer documents are chunked. Env:
# DOCKET_EXTRACT_CHUNK_CHARS.
# extract_chunk_chars = 12000
# Timeout for one vision-model page, seconds. Env: DOCKET_VISION_TIMEOUT_S.
# vision_timeout_s = 300.0
# Timeout for one request to a hosted model (Ollama cloud, a remote
# OpenAI-compatible API); local models keep their longer timeouts. Env:
# DOCKET_LLM_HOSTED_TIMEOUT_S.
# hosted_timeout_s = 60.0
# Retries after 429/5xx or a connection error, and after a timeout for hosted
# models. Env: DOCKET_LLM_RETRIES.
# retries = 2
# Let reasoning models think before answering. Env: DOCKET_ENABLE_THINKING.
# enable_thinking = false
# Process-wide limit on simultaneous LLM requests. Env: DOCKET_LLM_CONCURRENCY.
# concurrency = 4
[ocr]
# Primary OCR backend: tesseract, paddle, auto (first installed) or a plugin name. Env:
# DOCKET_OCR_BACKEND.
# backend = "auto"
# Backends tried in order when a page's reading is rejected (env: comma-separated). Env:
# DOCKET_OCR_FALLBACKS.
# fallbacks = ["vlm"]
# ISO 639-1 language codes; each extra language slows Tesseract. Env:
# DOCKET_OCR_LANGUAGES.
# languages = ["en"]
# A page reading is accepted at this confidence (0..1). Env: DOCKET_OCR_MIN_CONFIDENCE.
# min_confidence = 0.6
# Detect and undo page rotation on scans (Tesseract OSD). Env:
# DOCKET_OCR_DETECT_ROTATION.
# detect_rotation = true
# Correct fine scan skew before raster OCR. Env: DOCKET_OCR_DESKEW.
# deskew = true
# Find the document in a photo (receipt or invoice on a table) and flatten it
# before OCR; needs the [photo] extra, otherwise photos are read as they are.
# Env: DOCKET_OCR_CROP_PHOTOS.
# crop_photos = true
# Tesseract re-reads a page enlarged when its typical word is shorter than
# this many pixels (low-resolution scans); 0 disables. Env: DOCKET_OCR_MIN_TEXT_HEIGHT.
# min_text_height = 20.0
# Resolution PDF pages are rendered at for OCR. Env: DOCKET_OCR_DPI.
# dpi = 200
# Tesseract page-segmentation mode (3 automatic; 6 can suit dense tables). Env:
# DOCKET_TESSERACT_PSM.
# tesseract_psm = 3
# Process-wide limit on simultaneously running OCR engines (default: half the CPUs).
# Env: DOCKET_OCR_CONCURRENCY.
# concurrency = 4 # default: half the CPUs
# Ask a text model whether OCR text is garbled. Env: DOCKET_OCR_QUALITY_CHECK.
# quality_check = true
# Confidence the quality check needs to call text garbled. Env:
# DOCKET_OCR_QUALITY_MIN_CONFIDENCE.
# quality_min_confidence = 0.7
[paddle]
# PaddleOCR device: cpu, gpu or gpu:N. Env: DOCKET_PADDLE_DEVICE.
# device = "cpu"
# PaddleOCR model size. Env: DOCKET_PADDLE_MODEL.
# model = "mobile"
# Run PaddleOCR's table-structure pipeline. Env: DOCKET_PADDLE_TABLES.
# tables = false
[docling]
# TableFormer speed/quality mode. Env: DOCKET_DOCLING_TABLE_MODE.
# table_mode = "accurate"
# Match TableFormer cells back to recognized text. Env: DOCKET_DOCLING_CELL_MATCHING.
# cell_matching = true
[layout]
# Keep page layouts (words, lines, tables with coordinates) in results. Env:
# DOCKET_INCLUDE_LAYOUT.
# include = true
# Mark tables and columns ([TABLE n], [COLUMN n]) in the page text the LLM reads. Env:
# DOCKET_LAYOUT_MARKERS.
# markers = true
[classify]
# Confidence TF-IDF needs to answer instead of the LLM. Env:
# DOCKET_TFIDF_CONFIDENCE_FLOOR.
# tfidf_confidence_floor = 0.65
# Below this classification confidence a document goes to review. Env:
# DOCKET_MIN_CONFIDENCE.
# min_confidence = 0.55
[review]
# Persist flagged documents in the review queue. Disabled by default for the
# Python library; enable it explicitly for the review UI. Env:
# DOCKET_REVIEW_QUEUE_ENABLED.
# enabled = false
# A key field (total, date, number, parties) read from OCR words below this
# confidence sends the document to review. Env: DOCKET_MIN_SOURCE_CONFIDENCE.
# min_source_confidence = 0.8
# SQLAlchemy URL for SQLite or PostgreSQL review storage. Env: DOCKET_REVIEW_DATABASE_URL.
# database_url = "sqlite:///data/review.db"
# Review task lease duration before another reviewer can claim it. Env: DOCKET_REVIEW_LOCK_SECONDS.
# lock_seconds = 300
# Where copies of flagged documents are kept. Env: DOCKET_REVIEW_DOCUMENTS.
# documents = "data/review_documents"
[input]
# Largest accepted file. Env: DOCKET_MAX_FILE_BYTES.
# max_file_bytes = 20971520
# Largest decoded image or rendered PDF page in pixels. Env:
# DOCKET_MAX_IMAGE_PIXELS.
# max_image_pixels = 50000000
# Most pages read from one PDF. Env: DOCKET_MAX_PDF_PAGES.
# max_pdf_pages = 100
[batch]
# Documents in flight per batch; beyond the LLM limit they only help while others are in
# OCR. Env: DOCKET_BATCH_WORKERS.
# workers = 4
[api]
# Most files in one HTTP job. Env: DOCKET_MAX_BATCH_FILES.
# max_batch_files = 100
# Largest total upload of one HTTP job. Env: DOCKET_MAX_BATCH_BYTES.
# max_batch_bytes = 209715200
# HTTP jobs processed at once; the rest wait. Env: DOCKET_MAX_CONCURRENT_JOBS.
# max_concurrent_jobs = 2
# Bearer token the HTTP API requires when set. Env: DOCKET_API_KEY.
# key = "" # unset
# Browser origins allowed to call the HTTP API. Env: DOCKET_API_CORS_ORIGINS.
# cors_origins = ["http://localhost:3000", "http://127.0.0.1:3000"]
# One directory per HTTP job: metadata, results, uploads until done. Env:
# DOCKET_JOBS_DIR.
# jobs_dir = "data/jobs"
[einvoice]
# Your own copy of the validation artifacts (default: the one in the package). Env:
# DOCKET_EINVOICE_RESOURCES.
# resources = "" # unset
# Where `docket einvoice fetch` puts the artifacts Docket does not ship
# (Peppol, CII D16B, Factur-X; default: ~/.cache/docket/einvoice). Env:
# DOCKET_EINVOICE_DOWNLOADS.
# downloads = "" # unset
[eval]
# Blended $/1M tokens used for the illustrative cost in eval reports. Env:
# DOCKET_CLOUD_COST_PER_1M_TOKENS.
# cloud_cost_per_1m_tokens = 0.2
[tracing]
# Langfuse tracing (optional). Env: LANGFUSE_PUBLIC_KEY.
# langfuse_public_key = "" # unset
# Langfuse tracing (optional). Env: LANGFUSE_SECRET_KEY.
# langfuse_secret_key = "" # unset
# Langfuse server. Env: LANGFUSE_HOST.
# langfuse_host = "https://cloud.langfuse.com"
# Send prompts and answers, i.e. the document text, to Langfuse. Off, traces
# carry model, latency and sizes only. Env: DOCKET_LANGFUSE_CONTENT.
# langfuse_content = false