Early warning when production ML models degrade
Project description
ModelSentry
Early warning when your production ML models start degrading.
ModelSentry computes statistical profiles of your model's inputs and outputs locally — nothing leaves your machine. When feature distributions drift from baseline, you get an alert before your stakeholders notice.
PSI 0.83 ↑ income CRITICAL
PSI 2.43 ↑ age CRITICAL
PSI 0.01 tenure stable
PSI 0.00 country stable
Install
pip install modelsentry
Requires Python 3.11+. No Docker. No cloud account. No infrastructure.
Quickstart
import modelsentry as ms
ms.init(model_id="churn-v3", profile_window=500)
@ms.monitor()
def predict(features_df):
return model.predict(features_df)
Then start the local dashboard:
modelsentry serve --model churn-v3 --alert-email you@company.com
Open http://localhost:8080 to see live drift scores, feature distributions vs. baseline, and alert history. The dashboard updates every 60 seconds and shows an explicit "all systems nominal" state when no drift is detected — so you always know the system is alive.
How it works
- Profile — the
@ms.monitor()decorator intercepts your predict function and builds statistical profiles of input features and output distributions. - Detect — profiles are compared against a baseline using PSI (Population Stability Index) and KS tests. Severity: stable / warning / critical.
- Alert — when drift crosses threshold, ModelSentry sends an email directly from your machine via SMTP. No cloud backend required.
Raw feature values and raw predictions are never written to disk or transmitted.
Only anonymized statistical summaries are stored in ~/.modelsentry/.
Configuration
Email alerts via CLI
modelsentry serve \
--model churn-v3 \
--alert-email you@company.com \
--smtp-host smtp.gmail.com \
--smtp-port 587 \
--smtp-user you@gmail.com \
--smtp-password "your-app-password"
Profile handler (advanced)
ms.init(
model_id="churn-v3",
profile_window=500,
profile_handler=lambda profile: print(f"New profile: {profile}"),
)
Dashboard
The local dashboard at localhost:8080 shows:
- Model health overview (green / yellow / red)
- Prediction volume — total monitored since install
- Per-feature distribution charts vs. baseline
- PSI and KS drift scores, color-coded by severity
- Last updated timestamp (auto-refreshes every 60 seconds)
- Alert history with timestamps
- Explicit "all systems nominal" state when no drift is detected
Links
- Website: getmodelsentry.com
- GitHub: github.com/treyhamilton/modelsentry
License
MIT
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 modelsentry-0.1.0.tar.gz.
File metadata
- Download URL: modelsentry-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.0 CPython/3.11.9 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec100a7ddd7f2339211f0a57be128f8a02b324d225e8827425dd142af7d342a4
|
|
| MD5 |
eff941b814c6e265b019322654755c40
|
|
| BLAKE2b-256 |
bcbd3131423d2df61da2dc1924ece7e3c09a90209324185cc7d8a6e77b13ff31
|
File details
Details for the file modelsentry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: modelsentry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.0 CPython/3.11.9 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8470d06dcfa55bd8727dd63a720ba527230dec35f54b54f091222d9c00168f55
|
|
| MD5 |
d48bc9d181109dfd17e648aadb6f4b23
|
|
| BLAKE2b-256 |
1440296b014235fa23413aabd6d0d82a81a8682463d4cadb2d22b41262fa8968
|