Skip to main content

Configuration: the basics

Deployment configuration is environment variables in .env, created from env.template (cp env.template .env, or by scripts/setup.sh). env.template is the authoritative, commented list; this page covers the variables most deployments touch. Everything else is on Advanced configuration.

Environment variables describe the deployment: ports, GPUs, model names, mounts, limits. Anything that belongs to one dataset is not an environment variable: classes, keymaps, prompt packs, region profiles, VLM endpoint choice and strategy defaults are stored per project and edited through the API. See Where configuration lives.

Two readers of .env

docker compose interpolates .env into docker-compose.yml (ports, GPU ids, image tags). The Python app reads the OP_* variables from its process environment. make also reads .env (-include .env). .env values are not shell-expanded, so one variable can't reference another.

OP_* variables are read at process start

Curation routers build their prefix when src.main is imported, and workers read their settings once at startup. Changing any OP_* variable needs a container recreate, not a restart. ./openprocessor start (or make up and make curation-up in a checkout) recreates every service whose configuration changed. For one service, run docker compose -p <project> up -d --force-recreate <service>.

Where configuration lives​

LayerHoldsEdited with
.env (this page and Advanced)Ports, GPU ids, model names, source mounts, limits, the paths projects are created underA text editor, then recreate the container
Project recordA project's OpenSearch index names, class registry, export root, upload root, bake-off roots and job directories. Fixed when the project is createdPOST /curation/projects
Project config store (a configs index per project)Prompt packs, region profiles, the active VLM endpoint, the keymap, strategy defaults, with revisions and rollback/curation/projects/{project}/prompt_packs, /region_profiles, /vlm/endpoints, /keymap, /settings
Global config store (op_global_configs)The VLM endpoint registry, shared by every project/curation/vlm/endpoints

A project's paths are resolved once, at creation, from the variables in Projects and stored in its record. Changing those variables later does not move an existing project. There are no environment variables for individual index names, the class registry file, the export root or the upload root: every project owns {OP_PROJECT_INDEX_PREFIX}{slug}__{role} indexes and its own directories. Details are on Projects and Settings and config store.

GPU profile and performance​

The installer and scripts/setup.sh write these keys from the selected GPU profile (minimal, standard or full; see GPU sizing). The profile is applied when it is chosen: it sets the Triton model instance counts and batch size in the model configs, and decides whether GPU decode is on (OP_INGEST_GPU_DECODE, the one profile-driven key the app acts on). The API runs 32 uvicorn workers and every service that sets shm_size uses 8g, whatever the profile.

VariableDefaultMeaning
GPU_PROFILEstandardminimal (6-8 GB), standard (12-24 GB), full (40 GB+). Read by ./openprocessor gpu plan and the model setup, not by compose
GPU_ID0GPU the setup scripts measure for the profile
OP_INGEST_GPU_DECODE1 for full, 0 for minimal and standardDecode large photos on the GPU; costs about 8.5 GB more VRAM on the Triton card per gpu_image_prep instance (full: two)
OPENSEARCH_HEAP2g in env.templateOpenSearch JVM heap. The installer sets it to half of host RAM, between 2 and 30 GB, and never overwrites a value you set. Raise it for more projects: about 1 GB per 20 shards

Choose the profile at install time: pass --profile NAME to the installer, or run scripts/setup.sh --profile=NAME --force in a checkout (--force rewrites .env, keeping your OPENSEARCH_HEAP). Then check the result with ./openprocessor gpu plan. In a checkout, ./openprocessor profile <name> switches an existing install: it rewrites the Triton configs and sets GPU_PROFILE and OP_INGEST_GPU_DECODE in .env.

GPU ids​

Read by docker-compose.yml directly. Each GPU-using service has its own variable; see GPU sizing.

VariableDefaultService
TRITON_GPU_ID0 (a comma list such as 0,2 also runs the PE image encoder on the other cards)triton-server
API_GPU_ID0api (torch fallbacks, CUDA-side preprocessing)
EVALUATOR_GPU_ID0curation-evaluator
SEGMENTER_GPU_ID0segmenter
VLM_GPU_ID0vlm
OP_TRAIN_GPU_ORDER0curation-trainer (drives both its device_ids and its host-to-local id mapping)

Ports and bind address​

VariableDefaultService
API_PORT4603API (all endpoints)
TRITON_HTTP_PORT / TRITON_GRPC_PORT / TRITON_METRICS_PORT4600 / 4601 / 4602Triton
OPENSEARCH_PORT4607OpenSearch REST
OPENSEARCH_DASHBOARDS_PORT4608OpenSearch Dashboards (monitoring profile)
PROMETHEUS_PORT / GRAFANA_PORT / LOKI_PORT4604 / 4605 / 4606Monitoring profile
DCGM_PORT4610DCGM GPU metrics
MLFLOW_PORT4609MLflow (training profile)
SEGMENTER_PORT4611Segmenter (segmenter profile)
VLM_PORT4612In-compose VLM (vlm profile)
OP_BIND_ADDRESS127.0.0.1Address every published port binds to. The API has no authentication, so set 0.0.0.0 (or a non-loopback address) only behind a reverse proxy that does; see Security
OP_UI_BIND_ADDRESSvalue of OP_BIND_ADDRESSPublish address for only Grafana, Prometheus, OpenSearch Dashboards and MLflow, so LAN browsers can follow the resource links without exposing OpenSearch, Triton, the VLM or segmenter APIs. Grafana's default login is admin/admin (set GF_SECURITY_ADMIN_PASSWORD first); MLflow and Prometheus have no auth

Stack isolation​

VariableDefaultMeaning
COMPOSE_PROJECT_NAMEopenprocessorCompose project name: container names, network and volumes. Not the same thing as a curation project
OP_IMAGE_REPO / OP_IMAGE_TAGpublished repo / the checkout's VERSIONImage names for every built service; give a second clone its own tag

See Running a second, isolated stack.

Logging​

VariableMeaning
DEBUG1 for verbose logging

Core model selection​

VariableMeaning
YOLO_MODELDefault detector for /detect and /analyze, e.g. yolo26_small_trt (any request can still pass model_name)

The other Triton model names (FACE_DETECT_MODEL, ARCFACE_MODEL, CLIP_*_MODEL, OCR_*_MODEL, PE_*_MODEL) are on Advanced configuration.

The minimum for curation​

Everything curation-related is optional, and unset variables fall back to the defaults in CurationConfig.from_env(). These are the ones a first curation deployment actually sets:

VariableWhy
OP_INGEST_PRIMARY_DETECTOR_MODELRequired for ingest (it 503s without one): the Triton end2end model that proposes items, e.g. yolov11_small_trt_end2end
OP_INGEST_PRIMARY_CLASS_IDSRetired and ignored with a warning. Narrow ingest per project with the ingest policy instead
OP_INGEST_PRIMARY_ASSIGNS_CLASSfalse (default): detections are unlabeled proposals. true only if the detector was trained on your class registry
OP_SOURCE_ROOT_HOSTHost directory mounted read-only at /data/source in three services: api, curation-detection-worker and curation-auto-label-worker. A source checkout defaults to ./data/source; the installer writes ./data. Recreate all three after changing it
OP_VLM_URL, OP_VLM_MODEL, OP_VLM_API_KEYAn OpenAI-compatible /v1/chat/completions endpoint. This defines the built-in env VLM endpoint, which a project uses only after it activates it; OP_VLM_MODEL is required whenever OP_VLM_URL is set. More endpoints are registered through the API; see VLM selection
OP_SEGMENTER_URLe.g. http://segmenter:8000; empty makes the cascade's segmenter leg a clean no-op
HF_TOKENNeeded by the segmenter (gated SAM 3 weights) and for gated VLM weights
OP_SEMANTIC_SEARCH_ENABLED, OP_SCORES_ENABLED, OP_SELECT_DIVERSE_ENABLED, OP_VIZ_PROJECTION_ENABLEDFeature flags, off by default (set to 1)
OP_MLFLOW_PUBLIC_URLBrowser-reachable MLflow URL, so served run links work

Classes are not set here. Each project has its own class registry, created empty; add classes with POST /curation/projects/{project}/classes (see the Quick start) or import a labeled dataset.

Region detection profiles, prompt packs and the active VLM are stored per project and managed through the API, not through .env. The OP_REGION_PROFILE_PATH and OP_PROMPT_PACK_PATH variables only supply the deployment default a project uses until it activates its own; see Advanced configuration. Clustering and training knobs are there too.