Registry / ai-ml / skops
library0.14.0pypypi✓ verified 30d ago

Skops is a set of tools designed for machine learning in production, focusing on model persistence, sharing, and documentation. It provides secure object dumping/loading, integrates with Hugging Face Hub for sharing, and helps generate Model Cards. The library is currently at version 0.13.0 and maintains a regular release cadence, typically monthly or bi-monthly, addressing bug fixes, enhancements, and security improvements.

pip install skops
INSTALL
IMPORT
SIG · SKOPS
S
skops
ai-mlpythonv0.14.0
Install
10.2s avg
Import
7450ms
Disk
287MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.14.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
py 3.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 10.2s · import 7.450s · 279MB
287MB installed
● package 287MB
Code
Verified usage

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

dump
✓ from skops.io import dump
load
✓ from skops.io import load
Card
✓ from skops.card import Card
push
✓ from skops.hub import push

This quickstart demonstrates how to train a basic scikit-learn model, save it using `skops.io.dump`, and then load it back using `skops.io.load`. This is the most common use case for skops, providing a secure and robust way to persist machine learning models.

from sklearn.linear_model import LogisticRegression from skops.io import dump, load # Train a simple model model = LogisticRegression(random_state=42) model.fit([[0, 0], [0, 1], [1, 0], [1, 1]], [0, 0, 1, 1]) # Save the model securely dump(model, 'model.skops') # Load the model loaded_model = load('model.skops') # Make a prediction with the loaded model prediction = loaded_model.predict([[0, 0]]) print(f"Original model class: {type(model).__name__}") print(f"Loaded model class: {type(loaded_model).__name__}") print(f"Prediction: {prediction[0]}")
skops --version
Debug
Known issues
breakingLoading untrusted models or Model Cards from external sources can lead to arbitrary code execution due to pickle's security vulnerabilities. Skops offers security mechanisms like the `trusted` argument for `skops.io.load` and `allow_insecure_loading` for `skops.card.Card`.
fix
Always set `trusted=False` (which is the default) for `skops.io.load` when loading from untrusted sources. For `skops.card.Card`, explicitly set `allow_insecure_loading=False` (available from v0.13.0) or ensure the source is trusted. Carefully review the source of any model or card before loading.
affects: All versions
gotchaModel persistence is highly sensitive to library versions. Models saved with one version of `skops`, `scikit-learn`, `numpy`, or other dependencies might not load or behave identically with significantly different versions.
fix
Document the exact versions of `skops` and all major dependencies (`scikit-learn`, `numpy`, `pandas`, etc.) used to save a model. Ideally, recreate the environment using tools like `pip-tools` or `conda` to ensure consistent dependency versions when loading.
affects: All versions
gotchaThe `skops convert` CLI command, designed to convert model files (e.g., `joblib` to `skops`), is a 'best-effort' attempt and does not guarantee an exact, bit-for-bit identical conversion.
fix
After using `skops convert`, always thoroughly test and verify the converted model's behavior and predictions to ensure it functions as expected. Consider the original file the definitive source unless verified.
affects: All versions (explicitly warned from v0.11.0)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'skops'
The `skops` library has not been installed in your current Python environment.
fix
Install the library using pip: `pip install skops`
ValueError: Cannot load a skops file from an untrusted source without setting `trusted=True`.
By default, `skops` prevents loading models from unknown or potentially untrusted sources to mitigate security risks from arbitrary code execution during deserialization.
fix
If you verify and trust the origin of the file, explicitly set `trusted=True` when calling `skops.io.load` or `skops.hub_utils.load_from_hub` (e.g., `model = skops.io.load('model.skops', trusted=True)`).
ImportError: cannot import name 'Card' from 'skops'
The `Card` class is located within the `skops.card` submodule, not directly available under the top-level `skops` package.
fix
Import `Card` from its correct submodule path: `from skops.card import Card`
AttributeError: module 'skops' has no attribute 'dump'
The `dump` function (and `load` function) for model persistence are located in the `skops.io` submodule, not directly at the top level of the `skops` package.
fix
Access the persistence functions through the `skops.io` submodule: `skops.io.dump(...)` and `skops.io.load(...)`
Upgrade
Version history
0.14.0latest on PyPI · released Apr 20, 2026
Audit
Dependencies
scikit-learnrequiredCore machine learning library for model persistence and integration.
joblibrequiredBackend for efficient model serialization.
huggingface_hubrequiredRequired for integrating with the Hugging Face Hub (model sharing).
numpyrequiredFundamental package for numerical computing, common for ML models.
pandasrequiredData manipulation library, often used with ML models.
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
skops — pip install skops · libregistry