Quickstart
This guide walks you from zero to your first Inferpathio governance event in under 5 minutes. Prerequisites: Python 3.8+, an Inferpathio account, and an existing model you want to govern.
1. Install the SDK
terminal
pip install inferpathio
2. Get your API key
Navigate to Settings → API Keys in the Inferpathio dashboard. Create a new key with write scope. Store it as an environment variable:
terminal
export INFERPATH_KEY="ifp_live_xxxx..."
3. Initialize the SDK
init.py
import os
import inferpathio as ifp
ifp.init(api_key=os.getenv('INFERPATH_KEY'))
# SDK is now initialized for this process
4. Attach governance to your first model
Wrap your existing model logging code with a governance_run context manager:
train.py
with ifp.governance_run(
model_id='my-first-model'
) as run:
# Your existing model logging code
run.log_model(model, flavor='sklearn')
run.set_policy('default')
run.tag('env', 'staging')
run.tag('team', 'risk-analytics')
5. Log prediction batches for drift monitoring
predict.py
tracker = ifp.ModelTracker(
model_id='my-first-model',
policy='default'
)
# Call after each prediction batch
tracker.log_prediction_batch(
features=X_batch,
labels=y_actual,
threshold=0.1 # PSI threshold for drift alert
)
Next steps
- Read the Policy Config guide to define custom retrain thresholds and approval chains
- Connect your training pipeline via Integrations
- Explore the full SDK Reference for advanced usage
- Set up Audit API exports for compliance reporting