Configuration
Every setting of the configuration file and the environment variables
Papyrus reads one YAML file and a few environment variables. Every key is optional and shows its default below; change only what your deployment needs. ocr is not set by default, see OCR.
workers:
processes: auto
max_queue: 64
warmup: true
limits:
max_file_size: 100MB
deadline: 300
http:
enabled: true
allow_private: false
allowed_hosts: []
timeout: 30
max_redirects: 5
locale: en-US
browser:
sandbox: false
cors:
allow_origins: []
connectors: {}- Unknown keys stop the server at startup.
- Durations are in seconds. Sizes take units such as
100MBor2MiB. ${VAR}in any value is replaced with the environment variableVAR. If it is not set, the server does not start.
Workers
| Key | Default | Meaning |
|---|---|---|
processes | auto | Worker processes per pool. auto is one per CPU the container sees; set it to your CPU limit, see sizing |
max_queue | 64 | Requests one container handles at once. Beyond it requests fail with 503 queue_full and /ready reports not_ready |
warmup | true | Start every worker and the browser at startup, so the first requests do not wait. Startup fails if a component cannot start |
Limits
| Key | Default | Meaning |
|---|---|---|
max_file_size | 100MB | Largest document, uploaded or downloaded. Larger ones fail with 413 |
deadline | 300 | Seconds a whole request may take before 504 deadline_exceeded |
tmp_dir | system temp + /papyrus | Folder for files while a request runs; every request removes its own files |
Fetching URLs
These settings apply to URL sources and to everything a screenshot page loads.
| Key | Default | Meaning |
|---|---|---|
enabled | true | false rejects every http(s) source with 403 source_forbidden |
allow_private | false | Allow URLs that resolve to private or internal addresses. Keep it off in production |
allowed_hosts | [] | When set, only these hostnames can be fetched, e.g. [docs.axelered.com] |
timeout | 30 | Seconds per download |
max_redirects | 5 | Redirects followed per download |
locale | en-US | Language asked of remote sites, as a BCP 47 tag such as it-IT or de. Downloads send it as Accept-Language, screenshots use it as the browser language, so sites that translate serve that version. It does not translate content. null lets each site decide |
Browser
| Key | Default | Meaning |
|---|---|---|
sandbox | false | Run Chromium in its sandbox. Needs a runtime that allows unprivileged user namespaces; see security |
OCR
A vision model on a remote server reads page images. With this section, Markdown requests in the default readMode: auto send it scans, images and presentations, and readMode: ocr sends it every page. Without it OCR is off: auto reads every document as text, ocr fails with 422 ocr_not_configured, and no document leaves the server. A deployment has one backend, and requests cannot choose another. OCR compares the two.
With a Qwen VL model on any OpenAI-compatible server, such as vLLM, Ollama or OpenRouter:
ocr:
type: qwen
model: Qwen/Qwen3-VL-8B-Instruct
url: http://vllm:8000/v1
api_key: ${OCR_API_KEY}With Mistral OCR:
ocr:
type: mistral
api_key: ${MISTRAL_API_KEY}| Key | Default | Meaning |
|---|---|---|
type | required | qwen or mistral. Selects the API and the prompt, so use qwen with Qwen VL models |
model | mistral-ocr-latest | Model name on the server. Required for qwen |
url | Mistral API | Base URL of the API, private addresses included. Required for qwen, optional for mistral |
api_key | none | Key of the backend. Required for mistral |
concurrency | 8 | Pages read at once by one container; every replica adds its own |
max_pages | 100 | Longest document read with OCR. Longer ones are read as text in auto and fail with 413 too_many_pages in ocr. Raise limits.deadline with it |
extra_body | {} | qwen only. Extra fields sent with every call, for example chat_template_kwargs: {enable_thinking: false} to turn off reasoning on vLLM |
The backend is not contacted at startup, so its outages do not affect /ready. See security for where documents go.
CORS
Browsers block web pages on other origins from calling Papyrus unless their origin is listed here. Server-side callers are not affected.
| Key | Default | Meaning |
|---|---|---|
allow_origins | [] | Origins allowed to call the API from a browser, as scheme://host[:port] without a trailing slash, e.g. [https://app.axelered.com]. ["*"] allows any origin |
Allowed origins can send GET and POST requests with the Authorization, Content-Type and X-Request-ID headers, and read the X-Request-ID, Server-Timing and Content-Disposition response headers. Cookies are never accepted. Every request still needs an API key, which a browser client holds in its own code.
Storage connectors
A connector names a storage location that requests address as <protocol>://<name>/<path>. The image includes the s3 protocol, for AWS S3 and S3-compatible storage such as MinIO or Cloudflare R2:
connectors:
prod:
protocol: s3
options:
endpoint_url: https://s3.eu-central-1.amazonaws.com
key: ${PROD_S3_KEY}
secret: ${PROD_S3_SECRET}Requests then read and write s3://prod/<key>. options are passed as is to the s3fs filesystem, so any s3fs option works, such as client_kwargs: {region_name: eu-central-1}. Keep credentials in environment variables and reference them with ${VAR}; the startup log lists connector names, never their options.
An unknown protocol stops the server at startup with the reason.
Environment variables
| Variable | Meaning |
|---|---|
PAPYRUS_API_KEY | Accepted API keys, comma separated. Required unless auth is disabled |
PAPYRUS_CONFIG | Path of the configuration file, default /etc/papyrus/config.yml |
PAPYRUS_LOG_LEVEL | debug, info (default), warning or error |
PAPYRUS_LOG_FORMAT | text (default) or json |
PAPYRUS_AUTH_DISABLED | true turns off authentication. Local development only |
PAPYRUS_TIMING | true adds a Server-Timing header with stage durations. Profiling only: it reveals internal timings |