Skip to content

Trapper schemas

trapper-schemas is the shared Pydantic-model package that defines the cross-service contracts between Trapper Expert, the AI Manager, and the AI Worker — it's the single place where "what does a job submission look like", "what AI models exist and what can they predict", and "how do detection/tracker/depth configs validate" are defined, so all three services agree without copy-pasting schema code between repositories.

It's not in this docs workspace — this page is a pointer, not a mirror. Treat the package's own source as the source of truth for anything beyond what's summarized here.

How it's consumed

Service Dependency declaration Pin
Trapper Expert pyproject.toml git dependency https://gitlab.com/trapper-project/trapper-schemas.git, rev = "v0.4.2"
Trapper AI Manager pyproject.toml git dependency same, v0.4.2
Trapper AI Worker (trapperai-core) pyproject.toml, resolved via a private GitLab PyPI index >=0.4.2

Bumping the model catalog or job-schema version means cutting a trapper-schemas release and re-pinning it in all three pyproject.toml files — they're expected to move together, not independently.

What it contains (as referenced elsewhere in these docs)

  • Model manifest (src/trapper_schemas/data/model_manifest.yaml) — the catalog of bundled AI models (MegaDetector, DeepFaune, trackers, depth predictors, …), consumed by sync_models_from_schemas on the AI Manager. See Register & sync AI providers.
  • Category mappings (src/trapper_schemas/data/categories/) — per-model species/attribute label sets in Camtrap DP-aligned shape, copied onto AIProvider.categories at sync time. See Data model: AI provider models.
  • Job spec (trapper_schemas.jobs.spec, trapper_schemas.jobs.common) — the job_config shape submitted to the AI Manager, including CommonJobConfig.tracker. See Configure trackers.
  • Depth schemas (src/trapper_schemas/depth/) — calibration and distance-estimation config shapes. See Distance estimation.
  • Predictor/tracker classes (trapper_schemas.predictors) — the typed config classes each AI Worker runtime package validates against.

See also