DriftGuard is a production-grade observability platform that detects data drift, concept drift, and model degradation in real-time, automatically triggering CI/CD retraining loops (like Apache Airflow) to heal your AI pipelines with zero human intervention.
🌟 Features
- Real-Time Telemetry: Asynchronous, non-blocking telemetry logging that adds zero latency to your inference APIs.
- Enterprise Dashboard: A stunning, Vercel-inspired observability dashboard to monitor your entire fleet of models in real-time.
- Self-Healing Webhooks: Automatically fire POST payloads to your orchestrator (Airflow, Kubeflow, SageMaker) when SLA thresholds are breached.
- Multi-Tenant Security: Securely isolate telemetry data by project using hashed API keys.
🚀 Quickstart: Bring Your Own Server
You can run the entire DriftGuard platform on your own infrastructure for free using Docker.
1. Start the Platform
Clone this repository and spin up the backend and frontend simultaneously using our highly optimized, pre-built Docker Hub images:
git clone https://github.com/Yugenjr/DriftGuard-AI-Sdk.git
cd DriftGuard-AI-Sdk/infra
docker-compose -f docker-compose.prod.yml up -d
Your dashboard is now live at http://localhost:3000! Go create your first API key.
2. Install the SDK
Install the lightweight Python SDK into your inference environment:
pip install driftguard-ai-sdk
3. Wrap your Model
Import the SDK and initialize it in your FastAPI/Flask app:
from fastapi import FastAPI
from driftguard import DriftGuard
# 1. Initialize DriftGuard
dg = DriftGuard(
model_id="fraud-detector-v1",
api_key="dg-your-secret-key",
drift_threshold=0.15,
expected_features=["amount", "location_score", "velocity"]
)
app = FastAPI()
@app.post("/predict")
def predict(features: list[float]):
prediction = model.predict([features])
# 2. Log telemetry asynchronously (Non-blocking)
dg.log_prediction(
features=features,
prediction=prediction
)
return {"fraud_probability": prediction}
🏗 Architecture
+---------------------------------------+
| Client Application |
+-------------------+-------------------+
|
(Predict Telemetry)
v
+-------------------+-------------------+
| DriftGuard SDK |
| - Wrapper pattern intercept |
| - River ADWIN concept drift checks |
+-------------------+-------------------+
|
(HTTP Telemetry)
v
+-------------------+-------------------+
| DriftGuard FastAPI Core API | <---+ NextJS Dashboard (:3000)
| - /register, /predict, /drift | <---+ Grafana (:3001)
| - Prom metrics /metrics (:8000) |
+-------------------+-------------------+
|
(SLA Drift Breach Trigger)
v
+-------------------+-------------------+
| Prefect Orchestration Server |
| - drift_detection_flow (:4200) |
+-------------------+-------------------+
|
(Runs steps)
v
+-------------------+-------------------+
| ZenML Step Training Pipelines |
| - Step 1: Great Expectations Validate|
| - Step 2: Feast Feature Store Check |
| - Step 3: Train & Track (MLflow/W&B) |
| - Step 4: Validate (>1% boost check) |
| - Step 5: Canary Progressive Deploy |
| - Step 6: Immutable JSON Ledger & PDF|
+-------------------+-------------------+
|
(Progressive Split Promotes)
v
+-------------------+-------------------+
| BentoML & Ray Serve Fleet |
| - canary_router: 10%->100% |
| - SLA Monitoring & Rollbacks |
+---------------------------------------+
DriftGuard is composed of three main components:
- The Python SDK (
driftguard/): A lightweight client that intercepts inferences and streams telemetry. - The FastAPI Engine (
main.py): A high-concurrency event processor backed by PostgreSQL for state management. - The Obsidian Dashboard (
dashboard/): A Next.js (React) front-end providing a breathtaking developer experience.
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details on how to set up your local development environment.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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 driftguard_ai_sdk-1.0.4.tar.gz.
File metadata
- Download URL: driftguard_ai_sdk-1.0.4.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d12688295d41e59c7d440b1e279b2fb3b1d0708e1b3f78ffdb9c48e080941a
|
|
| MD5 |
150937a9e82d420f5acf87ea286264ac
|
|
| BLAKE2b-256 |
843655648770f093b94e7620ae8ae01257b71bfcf27b4bc60302680a93c65f97
|
File details
Details for the file driftguard_ai_sdk-1.0.4-py3-none-any.whl.
File metadata
- Download URL: driftguard_ai_sdk-1.0.4-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d70b081728ae3716dce8a3df3d1e9a81c3e3bbe4e931bb3b31d308aa6f07b09d
|
|
| MD5 |
26d5b22c94f179da38ec75927eab440e
|
|
| BLAKE2b-256 |
5590bce0018aa0e3e320bf605d7eb8dea38a3a3bbc2ac381e0106e44f189e62c
|