Install the WhiteBoxAI SDK using pip:
pip install whiteboxai-sdkInstall with specific framework support:
# Scikit-learn support
pip install whiteboxai-sdk[sklearn]
# PyTorch support
pip install whiteboxai-sdk[pytorch]
# TensorFlow support
pip install whiteboxai-sdk[tensorflow]
# All integrations
pip install whiteboxai-sdk[all]from whiteboxai import WhiteBoxAI
client = WhiteBoxAI(api_key="your-api-key")You can also set the API key via environment variable:
export EXPLAINAI_API_KEY=your-api-keyfrom whiteboxai import ModelMonitor
monitor = ModelMonitor(client)model_id = monitor.register_model(
name="my_model",
model_type="classification",
framework="sklearn"
)monitor.log_prediction(
inputs={"feature1": 1.0, "feature2": 2.0},
output={"prediction": 1, "probability": 0.85}
)- Check out the API Reference for detailed documentation
- Learn about Framework Integrations
- Explore Offline Mode for robust operation
- Review Examples for more use cases
Configure the client with various options:
client = WhiteBoxAI(
api_key="your-api-key",
base_url="https://api.whiteboxai.io",
timeout=30,
max_retries=3,
enable_caching=True,
enable_privacy_filters=True,
enable_offline=True
)For help and support:
- Documentation: https://whitebox.agentaflow.com
- Issues: https://github.com/AgentaFlow/whitebox-python-sdk/issues