Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt

Use this file to discover all available pages before exploring further.

The Model Governance API provides controls for responsible AI deployment: approval workflows before production promotion, automated drift detection, and fairness parity checks across customer segments.

GET /api/v1/model-governance

Retrieve governance status for a model including approval history and drift check results.

Query Parameters

ParameterTypeRequiredDescription
modelIdstringYesAlgorithm model ID

Response

{
  "modelId": "clx...",
  "approvals": [
    {
      "id": "clx...",
      "modelId": "clx...",
      "version": 3,
      "requestedBy": "data-scientist@example.com",
      "status": "approved",
      "reviewedBy": "admin@example.com",
      "reason": "AUC improved from 0.82 to 0.87",
      "createdAt": "2026-03-18T10:00:00.000Z"
    }
  ],
  "driftChecks": [
    {
      "id": "clx...",
      "modelId": "clx...",
      "version": 3,
      "driftDetected": false,
      "psiScore": 0.04,
      "aucDelta": -0.01,
      "checkedAt": "2026-03-18T12:00:00.000Z"
    }
  ]
}

POST /api/v1/model-governance

Perform governance actions. Editor or Admin (review requires Admin).

Actions

request_approval — Request approval to promote a model version

{
  "action": "request_approval",
  "modelId": "clx...",
  "version": 3,
  "metrics": { "auc": 0.87, "precision": 0.82, "recall": 0.79 }
}
Response (201):
{ "approvalId": "clx...", "status": "pending" }

review — Approve or reject a model promotion (Admin only)

{
  "action": "review",
  "approvalId": "clx...",
  "decision": "approved",
  "reason": "AUC meets threshold, no drift detected"
}
Response:
{ "approvalId": "clx...", "status": "approved" }

drift_check — Run a drift detection check

Compares baseline vs. current score distributions using three methods:
  • PSI (Population Stability Index): measures shift between score distributions (< 0.1 OK, 0.1–0.25 monitor, > 0.25 retrain)
  • KS (Kolmogorov-Smirnov): max CDF difference between distributions
  • AUC decay: drop in AUC from baseline
Each check is persisted to the ModelDriftCheck table.
{
  "action": "drift_check",
  "modelId": "clx...",
  "version": 3,
  "baselineScores": [0.1, 0.3, 0.5, 0.7, 0.9],
  "currentScores": [0.15, 0.35, 0.45, 0.65, 0.85],
  "baselineAuc": 0.85,
  "currentAuc": 0.82,
  "thresholds": { "psi": 0.25, "ks": 0.1, "aucDecay": 0.05 }
}
Response (200):
{
  "psi": { "score": 0.03, "drifted": false },
  "ks": { "score": 0.05, "drifted": false },
  "aucDecay": { "score": 0.03, "drifted": false },
  "anyDrift": false
}
FieldTypeDescription
psi.scorenumberPopulation Stability Index (0 = identical distributions)
psi.driftedbooleantrue if PSI exceeds threshold (default 0.25)
ks.scorenumberKolmogorov-Smirnov statistic (0–1)
ks.driftedbooleantrue if KS exceeds threshold (default 0.1)
aucDecay.scorenumbermax(0, baselineAuc - currentAuc)
aucDecay.driftedbooleantrue if AUC dropped more than threshold (default 0.05)
anyDriftbooleantrue if any of the three checks flagged drift

parity_check — Check fairness across customer segments

Compares mean scores across segments and flags those deviating more than maxDeviation from the overall mean.
{
  "action": "parity_check",
  "segmentScores": {
    "young_adults": [0.8, 0.7, 0.9, 0.85],
    "seniors": [0.3, 0.2, 0.4, 0.25],
    "middle_aged": [0.5, 0.6, 0.55, 0.5]
  },
  "maxDeviation": 0.15
}
Response (200):
{
  "results": [
    { "segment": "young_adults", "sampleSize": 4, "meanScore": 0.813, "stdDev": 0.075 },
    { "segment": "seniors", "sampleSize": 4, "meanScore": 0.288, "stdDev": 0.073 },
    { "segment": "middle_aged", "sampleSize": 4, "meanScore": 0.538, "stdDev": 0.041 }
  ],
  "disparityDetected": true,
  "flaggedSegments": ["young_adults", "seniors"]
}
FieldTypeDescription
resultsarrayPer-segment statistics (sampleSize, meanScore, stdDev)
disparityDetectedbooleantrue if any segment deviates > maxDeviation from overall mean
flaggedSegmentsstring[]Segments exceeding the deviation threshold