Push drift events and audit entries from your MLOps pipeline to Compass StayReady.
Project description
StayReady Python SDK
Push drift events and audit entries from your MLOps pipeline to Compass StayReady — continuous AI governance monitoring for regulated sectors.
Install
pip install stayready
Quick start
import os
from stayready import StayReady
sr = StayReady(
api_key=os.environ["STAYREADY_API_KEY"],
model_id="your-model-uuid", # from your StayReady dashboard
)
# Report drift when your monitoring detects it
sr.drift(
type="data_drift", # data_drift | concept_drift | performance_degradation | regulatory_change
severity="High", # Critical | High | Medium | Low
metric="PSI",
value=0.28,
threshold=0.20,
description="Population Stability Index exceeded threshold on income feature.",
affected_domains=["Data Quality", "Model Monitoring"],
action_required="Retrain on recent data and re-validate before next production cycle.",
)
# Log lifecycle events to the immutable audit trail
sr.audit("model_retrained", "Retrained on Q2 data, Gini improved to 0.61", actor="ml-pipeline")
Critical and High severity events trigger an email alert (and webhook, if configured) and can flag your linked GovernReady audit for re-assessment.
Integration examples
Evidently AI
psi = report.as_dict()["metrics"][0]["result"]["dataset_drift_share"]
if psi > 0.2:
sr.drift(type="data_drift", severity="High", metric="PSI", value=psi,
threshold=0.2, description="Evidently detected dataset drift.")
Airflow (post-training validation)
def report_validation(**ctx):
gini = ctx["ti"].xcom_pull(key="gini")
if gini < 0.55:
sr.drift(type="performance_degradation", severity="Critical", metric="Gini",
value=gini, threshold=0.55, description="Gini below policy floor after retrain.")
Requirements
Python 3.9+. Zero dependencies (standard library only).
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stayready-0.1.0.tar.gz.
File metadata
- Download URL: stayready-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24de126a59224a0f60bf644fab6e69e9e0a17eb586f6152032916291d38de3c3
|
|
| MD5 |
c4b4666f9872d1c47b78507d63f890d3
|
|
| BLAKE2b-256 |
94db550abf0c8c45c55f2206d09dda3f0156a5d2f507d7c585d7ec901e4e358c
|
File details
Details for the file stayready-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stayready-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d32665cb4bdb8d06b13ac199218bda8f9544df8f266f25cc2b6cbd1d18f5f6d
|
|
| MD5 |
c71a3679a4a6d4a327adf7af01b94298
|
|
| BLAKE2b-256 |
4dd9de146eb8f7454be4b1345086727078c132e2691efd514de73e14e0e6d05e
|