Skip to content

BDP Model Gate

Automated pre-deployment governance for machine-learning models. Fairness, performance, compliance and security checks run as a single gate that returns one status your pipeline can branch on.

PASS deploy · NEEDS_REVIEW stop for sign-off · BLOCKED hard fail

pip install "bdp-model-gate[structured]"

It runs after a model is trained and before it is promoted — not on every pull request. The output is a JSON report a reviewer can read months later: it records which metric ran, which checks were skipped, and why.

Where to go

  • Getting started — install, gate your first model, read the report
  • Concepts — contexts, checks, verdicts, and the degradation contract
  • Tasks — binary, multiclass and ordinal, regression
  • Any model — scikit-learn, PyTorch, XGBoost, remote endpoints
  • Reference — the checks, configuration, CLI, API
  • Examples — five runnable notebooks

What it checks

Category Blocking Checks
Fairness No → review proxy correlation, demographic parity, SHAP subgroup gaps, counterfactual flip
Fairness (regression) No → review loss-ratio parity, group mean gap, error parity, calibration parity
Performance Yes model score, p95 latency, cost per inference
Compliance Yes model-card completeness, DPIA trigger, explainability requirement
Security Yes adversarial robustness, PII leakage, prompt injection

Fairness is deliberately non-blocking. Those findings frequently need human judgement, so they route to a reviewer rather than failing a build — which is the distinction most CI gates collapse.

Regulatory defaults

Out of the box the compliance and PII checks target NDPA/NDPR (Nigeria's data-protection regime): PII patterns match NIN, BVN and Nigerian phone formats, and pricing, underwriting, credit scoring and claims decisioning are treated as DPIA triggers.

These are defaults, not assumptions. Every pattern, required field and high-risk use case is configurable — see Configuration — so the same suite works against GDPR, CCPA or an internal standard.

Not regulatory advice

Default thresholds are reasonable starting points chosen to be useful, not positions on what any regulator requires. Set them with your compliance function.