Quickstart

This guide gets you from zero to a working Inferpathio experiment in under 15 minutes. By the end you'll have a tracked training run, a registered model version, and drift monitoring configured.

Prerequisites

Step 1: Install the SDK

pip install inferpathio

Step 2: Authenticate

ifp configure --api-key ifp_sk_your_key_here

This writes your credentials to ~/.ifp/credentials. Alternatively, set the environment variable IFP_API_KEY.

Step 3: Track your first experiment

import inferpathio as ifp
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split

X, y = make_classification(n_samples=5000)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

with ifp.track("my-first-model") as run:
    clf = RandomForestClassifier(n_estimators=100, max_depth=8)
    clf.fit(X_train, y_train)
    acc = clf.score(X_test, y_test)

    run.log_metric("accuracy", acc)
    run.log_param("n_estimators", 100)
    run.log_param("max_depth", 8)
    run.register(stage="staging")

Step 4: Set up drift monitoring

from inferpathio import monitor

m = monitor("my-first-model")
m.set_baseline(X_train)       # training distribution as reference
m.drift_threshold = 0.10      # PSI threshold
m.on_drift(action="alert", channel="email")
m.watch(X_live)               # pass production batches here

What's next?