Skip to content

Latest commit

Β 

History

History
83 lines (63 loc) Β· 3.26 KB

File metadata and controls

83 lines (63 loc) Β· 3.26 KB

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