Registry / ai-ml / alibi-detect

alibi-detect

JSON →
library0.13.0pypypiunverified

A Python library for outlier detection, adversarial detection, concept drift detection, and explainability. Supports TensorFlow, PyTorch, and scikit-learn backends. Current version 0.13.0, with quarterly releases.

pip install alibi-detect
INSTALL
IMPORT
SIG · ALIBI-DETECT
A
alibi-detect
ai-mlpythonv0.13.0
Install
39.5s avg
Import
Disk
1013MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 39.9s
py 3.11
✕ build_error
✓ 36.7s
py 3.12
✕ build_error
✓ 35.7s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 45.6s
1013MB installed
● package 1013MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

outlier_detector
from alibi_detect.od import OutlierAENN
from alibi_detect import OutlierAENN
Detectors are in submodules like alibi_detect.od, alibi_detect.cd, alibi_detect.ad.
drift_detector
from alibi_detect.cd import MMDDrift
from alibi_detect.drift import MMDDrift
Drift detectors are in alibi_detect.cd (concept drift) not a separate drift module.

Basic drift detection with MMDDrift.

from alibi_detect.cd import MMDDrift from alibi_detect.utils.data import create_outlier_batch import numpy as np # create some reference data np.random.seed(0) ref_data = np.random.randn(100, 10) # initialize detector cd = MMDDrift(ref_data, p_val=0.05) # detect drift on new data x_new = np.random.randn(100, 10) preds = cd.predict(x_new) print(preds)
Debug
Known issues
breakingIn v0.13.0, TensorFlow backend requires setting environment variable TF_USE_LEGACY_KERAS=1 to use legacy Keras for saving/loading detectors with legacy=True or loading old pickles.
fix
Set os.environ['TF_USE_LEGACY_KERAS'] = '1' before importing tensorflow or alibi_detect.
affects: 0.13.0
breakingFrom v0.12.0, Pydantic v2 is supported via a v1 shim. Code relying on Pydantic v1 imports may break if v2 is installed.
fix
Ensure pydantic<2 or use the shim; check if your code uses internal Pydantic API.
affects: >=0.12.0
gotchaWhen saving or loading detectors, the environment variable TF_USE_LEGACY_KERAS may need to be set consistently across sessions. Failure causes cryptic tensorflow errors.
fix
Always set TF_USE_LEGACY_KERAS=1 when using TensorFlow backend, even if not saving/loading legacy files.
affects: >=0.13.0
deprecatedPython 3.7 support was dropped in v0.11.4. Python 3.11 support added in v0.11.3, Python 3.12 in v0.13.0.
fix
Upgrade Python to 3.9+.
affects: >=0.11.4
Upgrade
Version history
0.13.0latest on PyPI · released Dec 11, 2025
Audit
Dependencies
tensorflowoptionalRequired for TensorFlow-based detectors and legacy saving/loading (environment variable TF_USE_LEGACY_KERAS=1 needed for v0.13.0).
torchoptionalOptional for PyTorch-based detectors.
scikit-learnrequiredRequired for certain detectors and metrics.
Agent activity
49 hits · last 30 days
node
42
OpenAI (training)
2
Resources
alibi-detect — pip install alibi-detect · libregistry