Skip to main content

ML model monitoring for developers — one decorator, live drift detection, AI diagnosis, alerts in 60 seconds

Project description

modelpulse-sdk

ML model monitoring for developers. One decorator. Live drift detection, AI diagnosis, and instant alerts — in 60 seconds.

PyPI version Python License: MIT


What is ModelPulse?

ModelPulse monitors your ML models in production. It detects when your model's input data starts looking different from what it was trained on (data drift), generates AI-powered plain-English explanations of what changed, and fires Slack/email alerts — automatically.

No MLOps team required. No schema design. No enterprise sales call.


Installation

pip install modelpulse-sdk

Quickstart

import modelpulse

# Initialize once at startup
modelpulse.init(
    api_key="mp_live_xxxx",       # from dashboard → model → API Keys
    model_id="your-model-uuid",   # from dashboard
)

# Wrap your predict function with one decorator
@modelpulse.monitor
def predict(features: dict):
    return my_model.predict([features])[0]

# That's it — ModelPulse logs every prediction automatically
result = predict({"age": 34, "income": 72000, "tenure_months": 12})

ModelPulse will:

  • Log every prediction (inputs, outputs, confidence, latency)
  • Compute drift hourly against your baseline distribution
  • Generate an AI diagnosis when drift is detected
  • Fire Slack/email alerts with the diagnosis included

How it works

1. Batching

Predictions are queued in memory and flushed every 10 seconds or when 50 accumulate — whichever comes first. This means zero blocking on your model's critical path.

2. Non-blocking

The SDK uses a background thread. Your predict() function adds less than 1ms overhead.

3. Resilient

Network failures are silently dropped. The SDK never raises an exception that could crash your application.


Advanced usage

Return confidence scores

@modelpulse.monitor
def predict(features: dict):
    probs = model.predict_proba([features])[0]
    # Return (prediction, confidence) tuple
    return probs.argmax(), float(probs.max())

Custom API URL (self-hosted)

modelpulse.init(
    api_key="mp_live_xxxx",
    model_id="your-model-uuid",
    api_url="https://your-own-api.com/api/v1",
)

Works with any framework

# scikit-learn
@modelpulse.monitor
def predict(features):
    return sklearn_model.predict([list(features.values())])[0]

# XGBoost
@modelpulse.monitor
def predict(features):
    dmatrix = xgb.DMatrix([list(features.values())])
    return float(xgb_model.predict(dmatrix)[0])

# PyTorch
@modelpulse.monitor
def predict(features):
    tensor = torch.tensor(list(features.values()))
    return torch_model(tensor).item()

Drift Detection

ModelPulse uses two statistical tests under the hood:

Test What it measures
PSI (Population Stability Index) Magnitude of distribution shift
KS Test (Kolmogorov-Smirnov) Whether two distributions are different
PSI Score Health Status
< 0.10 🟢 Healthy — no significant drift
0.10 – 0.20 🟡 Warning — moderate drift
> 0.20 🔴 Critical — significant drift

You never need to configure these thresholds manually — ModelPulse computes them automatically from your first 100 predictions.


Dashboard

After integrating the SDK, view your model's health at:

👉 https://frontend-ruddy-sigma-92.vercel.app

The dashboard shows:

  • Feature drift scores with visual progress bars
  • AI-generated plain-English diagnosis (powered by Claude)
  • Prediction volume and latency trends
  • Alert history

Configuration options

modelpulse.init(
    api_key="mp_live_xxxx",      # required — your API key
    model_id="uuid",             # required — your model ID
    api_url="https://...",       # optional — default: ModelPulse cloud
    timeout=5,                   # optional — HTTP timeout in seconds
    batch_size=50,               # optional — flush after N predictions
    async_mode=True,             # optional — fire-and-forget mode
)

Links


License

MIT License — see LICENSE for details.


Built by Saxon Preetham · Visakhapatnam, India · 2026

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelpulse_sdk-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelpulse_sdk-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file modelpulse_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: modelpulse_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for modelpulse_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2f5b855fbb8db51d962bda5c353ce2970d69a45f79d5c91d41adba7774fbc00b
MD5 61f5f672f6414ab94fb5bb0dac28f8f9
BLAKE2b-256 064e2a7ff08064611450150178a039dd6c2bffe6cd7299b9822717790929782d

See more details on using hashes here.

File details

Details for the file modelpulse_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: modelpulse_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for modelpulse_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97c38e150acef62ed7abba04cc24a82cda85f53e5c8afd9b574c03bcd3047783
MD5 a7c64d3d0b7152b7513bcebd2d8d4ae2
BLAKE2b-256 f0074e6b38e86eabbe8c726923e9814e8dda784ae9742a17a9435cc291c6a36c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page