Skip to main content

🚦 ModelShift

Label-Free Monitoring for Deployed Machine Learning Models

PyPI version Python 3.8+ License: MIT

A lightweight, behavior-centric system to detect silent reliability degradation in deployed machine learning models — without requiring ground-truth labels.


📌 Why ModelShift?

Machine learning models rarely fail loudly after deployment. Instead, they silently degrade as real-world data changes — while true labels are unavailable for continuous evaluation.

ModelShift addresses this blind spot.


🧩 Problem Statement & Objective

Deployed machine learning models often degrade silently over time due to changing data distributions. Design a label-free, post-deployment monitoring system that tracks:

  • Data distribution shifts
  • Prediction behavior instability
  • Model reliability trends

...to provide early warning signals of degradation without modifying the deployed model.

Note: ModelShift explicitly does not retrain models, correct predictions, or compute accuracy on production data. It focuses solely on deterministic monitoring, telemetry, and interpretability.


🚀 The Architecture (SaaS Infrastructure)

ModelShift is built as a distributed, full-stack monitoring ecosystem:

  1. The PyPI SDK (modelshift): A lightweight Python package installed on the data scientist's local machine or cloud pipeline. It computes complex statistical drift (KS-Statistics, Entropy) locally.
  2. The API Bridge: The SDK authenticates via a secure API_KEY and transmits JSON telemetry payloads across the web.
  3. The Web Hub (FastAPI): A secure cloud server equipped with SQLite, bcrypt cryptographic hashing, and automated routing.
  4. The Cyberpunk Dashboard: A real-time HTML/JS monitoring terminal to visualize pipeline health.
  5. Automated Alerting: Background workers that trigger styled SMTP HTML emails the second a CRITICAL_DRIFT event occurs.

💻 Quickstart

1. Install the SDK

ModelShift is published on the Python Package Index. Install it anywhere:

pip install modelshift
2. Connect Your Pipeline
Add these 5 lines of code to the end of your existing ML inference scripts to instantly beam telemetry to your dashboard:

Python
import pandas as pd
import numpy as np
from modelshift.monitor import ModelMonitor, init

# 1. Authenticate with your Cloud Dashboard API Key
init(api_key="ms_YOUR_API_KEY_HERE")

# 2. Initialize the Engine
monitor = ModelMonitor(reference_df)
monitor.set_baseline_predictions(ref_predictions)

# 3. Feed it live production data
monitor.update(live_df)
monitor.update_predictions(live_predictions)

# 4. Compute statistical drift
monitor.compute_feature_drift()
monitor.compute_prediction_drift()

# 5. Beam telemetry to the cloud
monitor.push()
🛠️ Technology Stack
Data Science & SDK Core:

Language: Python 3.8+

Math & Stats: NumPy, Pandas, SciPy

Networking: Requests

Cloud Backend & Security:

Framework: FastAPI / Uvicorn

Database: SQLite (Relational Storage)

Cryptography: bcrypt (Password Hashing)

Notifications: Python smtplib & email.mime (Background Tasks)

Frontend Dashboard:

UI: HTML5, TailwindCSS, Vanilla JS

Templating: Jinja2

Aesthetic: High-contrast, custom dark-mode / terminal UI

📂 Repository Structure
Plaintext
modelshift-lite/
├── dashboard_web/       # FastAPI Backend & Web Application
│   ├── data/            # SQLite DB & telemetry storage
│   ├── static/          # CSS and Vanilla JS for the dashboard
│   ├── templates/       # HTML Jinja2 templates (login, signup, dash)
│   ├── app.py           # Core FastAPI router & logic
│   └── email_alert.py   # Automated SMTP dispatch system
├── modelshift/          # The PyPI SDK Source Code
│   ├── drift/           # Statistical math (KS, Entropy, severity)
│   └── monitor.py       # Main ModelMonitor class and API Bridge
├── setup.py             # PyPI package configuration
└── README.md
⚙️ Running the Local Server (For Developers)
To run the full-stack dashboard and backend API on your local machine:

Clone this repository.

Install the backend requirements: pip install fastapi uvicorn bcrypt sqlalchemy jinja2

Start the server:

Bash
uvicorn dashboard_web.app:app --reload
Navigate to http://127.0.0.1:8000 in your browser.

Create an account, generate an API Key, and start tracking your models!

Metadata

Release files for modelshift 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modelshift 0.2.0
File Size Uploaded Provenance Actions
modelshift-0.2.0.tar.gz 19.5 kB Without provenance Details for modelshift-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for modelshift 0.2.0
File Interpreter ABI Platform Actions
modelshift-0.2.0-py3-none-any.whl Python 3 none any Details for modelshift-0.2.0-py3-none-any.whl

Total release size: 37.8 kB

Release files / modelshift-0.2.0.tar.gz

Download URL modelshift-0.2.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0028e8fe3dc896b64a7da662349740320d9a936dd7a48259f4514b5eeb665b3
BLAKE2b-256 checksum
How to use checksums
542ce78c6c047a8099e3cc97cfbdbf9af937943f677cb86be2356c70dd39872e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / modelshift-0.2.0-py3-none-any.whl

Download URL modelshift-0.2.0-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a635025f6b41505fd7037730a1c9445c9c0ef72f3acb7a7ffdf136616c1d5a4f
BLAKE2b-256 checksum
How to use checksums
c7a94d2c72b937ccce13c029523dd0ef09464aca84d8dd9ad3f69588e338fda7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for modelshift 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page