Skip to content

PredictiveManish/mlops-drift-detector

Repository files navigation

MLOps Model Drift Monitoring System

CI Python 3.11 FastAPI Streamlit License: MIT

A production-ready MLOps system that detects concept drift in machine learning models through real-time statistical performance comparison. Built with FastAPI, Streamlit, and scikit-learn.

📋 Features

  • Real-time Drift Detection: Statistical comparison using PSI (Population Stability Index) and KS tests
  • Fast Inference: <500ms prediction latency
  • Configurable Alerts: 15% threshold with Discord webhook integration
  • Interactive Dashboard: Streamlit dashboard with Plotly visualizations
  • Async Logging: Non-blocking prediction logging to SQLite
  • Docker Support: Containerized deployment
  • CI/CD: Automated testing via GitHub Actions
  • Zero-cost Deployment: Ready for Render (API) and Hugging Face Spaces (Dashboard)

🏗️ Architecture

┌─────────────┐    ┌──────────────┐    ┌─────────────┐
│ Client      │───▶│ FastAPI      │───▶│ SQLite      │
│ (curl/app)  │    │ Inference    │    │ Database    │
└─────────────┘    └──────────────┘    └─────────────┘
       │                  │                  │
       ▼                  ▼                  ▼
┌──────────────┐    ┌─────────────┐    ┌──────────────┐
│ Drift        │    │ Streamlit   │    │ Discord      │
│ Detector     │───▶│ Dashboard   │───▶│ Webhook      │
└──────────────┘    └─────────────┘    └──────────────┘

🔧 Local Installation

1. Clone the Repository

Open your terminal/command prompt and run:

git clone https://github.com/YOUR_USERNAME/mlops-drift-detector.git
cd mlops-drift-detector

" 💡 Pro Tip: If you don't see "Open in Terminal" when right-clicking a folder, click 2-3 times until it appears. "

2. Create Virtual Environment using venv or conda (as you want)

3. Install dependencies

pip install -r requirements.txt

4. Train and save model

cd app
python model.py
cd ..

5. Run servcies

  • Open two separate terminals
  1. terminal1: FastAPI Server:
uvicorn app.main:app --reload --port 8000
  1. Terminal 2: Streamlit Dashboard
streamlit run dashboard/app.py

6. Access Applications

API: http://localhost:8000 API Docs: http://localhost:8000/docs Dashboard: http://localhost:8501

Made by predictivemanish

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages