NoplagDocs

Configuration

Every engine environment variable, annotated — database, storage, check budgets, fingerprint tuning, and retrieval knobs.

Configuration is environment variables only. Every variable has a working default; a bare docker compose up needs none of them. Compose reads a .env file next to docker-compose.yml (copy .env.example).

Postgres

VariableDefaultPurpose
DATABASE_URLpostgresql+psycopg://noplag:noplag@localhost:5432/noplagSQLAlchemy URL with the postgresql+psycopg driver hint
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DBnoplagCredentials for the docker-compose Postgres service
ENGINE_PORT8000Host port the API listens on (compose)

Object storage

VariableDefaultPurpose
CORPUS_STORAGE_DIRsystem temp dirLocal filesystem path for raw uploaded document bytes. The extracted text lives in Postgres; the original bytes are kept so documents can be re-extracted when the extractors improve. The temp-dir fallback is fine for evaluation, not for durable storage

Sample corpus

VariableDefaultPurpose
NOPLAG_LOAD_SAMPLE_CORPUS1The container entrypoint loads the bundled Wikipedia sample corpus on first start so the demo has something to match against. Set to 0 when you bring your own corpus

Checks

VariableDefaultPurpose
NOPLAG_CHECK_BUDGET_S60Per-check retrieval time budget in seconds. A very large document that exceeds it returns partial (but uniform) coverage instead of hanging
NOPLAG_TENANT_IDfixed UUIDSingle-tenant id every request runs as. Only override when layering your own multi-tenancy on top of the engine

Fingerprint algorithm tuning

VariableDefaultPurpose
NOPLAG_FP_K5k-gram size (characters) for winnowing
NOPLAG_FP_W8winnow window size in k-grams
NOPLAG_CHUNK_SENTENCES4chunk size in sentences
NOPLAG_CHUNK_OVERLAP1sentence overlap between adjacent chunks

The defaults are the tuned winners from the PAN-PC-11 sweep. Changing NOPLAG_FP_K or NOPLAG_FP_W requires re-fingerprinting the corpus — fingerprints only match when the corpus side and the query side agree. Smaller chunks improve granularity but increase per-document storage.

L1 retrieval tuning (large corpora)

These only matter once the corpus is large enough that you've built the fingerprint_df table (scripts/compute_fingerprint_df.py) — see Operating at scale.

VariableDefaultPurpose
NOPLAG_L1_DF_BUDGET15000document-frequency budget per chunk probe
NOPLAG_L1_POOL_CAP20000candidate pool cap per query
NOPLAG_L1_NONDISCRIM_DF50000threshold above which a fingerprint is considered non-discriminative
NOPLAG_STOP_LIST_N1000size of the DF-derived stop-fingerprint list

All are read at query time; changing them needs a restart but no re-index.

Alignment

VariableDefaultPurpose
NOPLAG_ALIGN_PARALLEL1Set to 0 to force single-process L0 alignment (tests, single-core boxes). Defaults to a process pool sized to the machine

On this page

Configuration — Noplag Docs