Skip to content

Kernel-ML/driftwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DriftWatch

Lightweight self-hosted model monitoring for drift detection, latency tracking, and alerting.

Features

  • Drift Detection: PSI, Kolmogorov-Smirnov, and chi-squared tests on features and predictions
  • Latency Tracking: p50/p95/p99 percentile computation with SLA violation detection and trend analysis
  • Staleness Monitoring: Cumulative drift tracking with retrain recommendations
  • Alert Management: Pluggable channels (Slack, Prometheus, generic webhook) with cooldown and escalation
  • Storage: Save/load monitoring snapshots as Parquet or JSON

Quick Start

import pandas as pd
from driftwatch.core import DriftMonitor
from driftwatch.latency import LatencyTracker
from driftwatch.alerts import AlertManager, AlertEvent, SlackAlert

# Drift detection
monitor = DriftMonitor(
    reference_data=reference_df,
    features=["feature_a", "feature_b"],
    methods=["psi", "ks_test"],
)
result = monitor.check(production_df)
print(result.overall_status)

# Latency tracking
tracker = LatencyTracker(sla={"p50": 50, "p95": 200, "p99": 500}, window_size="1h")
tracker.record(latency_ms=45.0)
status = tracker.check()

# Alerting
manager = AlertManager(
    channels=[SlackAlert(webhook_url="https://hooks.slack.com/...")],
    cooldown_minutes=30,
)
manager.send(AlertEvent(level="warning", message="Drift detected", metric="psi", value=0.15))

Installation

pip install driftwatch
# With Prometheus support:
pip install driftwatch[prometheus]

License

Apache 2.0

About

Lightweight self-hosted model monitoring for drift detection, latency tracking, and alerting.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages