{"id":1710,"library":"skops","title":"Skops","description":"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.","status":"active","version":"0.13.0","language":"python","source_language":"en","source_url":"https://github.com/skops-dev/skops","tags":["machine-learning","model-management","persistence","huggingface","serialization","model-card"],"install":[{"cmd":"pip install skops","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core machine learning library for model persistence and integration.","package":"scikit-learn"},{"reason":"Backend for efficient model serialization.","package":"joblib"},{"reason":"Required for integrating with the Hugging Face Hub (model sharing).","package":"huggingface_hub"},{"reason":"Fundamental package for numerical computing, common for ML models.","package":"numpy"},{"reason":"Data manipulation library, often used with ML models.","package":"pandas"}],"imports":[{"symbol":"dump","correct":"from skops.io import dump"},{"symbol":"load","correct":"from skops.io import load"},{"symbol":"Card","correct":"from skops.card import Card"},{"symbol":"push","correct":"from skops.hub import push"}],"quickstart":{"code":"from sklearn.linear_model import LogisticRegression\nfrom skops.io import dump, load\n\n# Train a simple model\nmodel = LogisticRegression(random_state=42)\nmodel.fit([[0, 0], [0, 1], [1, 0], [1, 1]], [0, 0, 1, 1])\n\n# Save the model securely\ndump(model, 'model.skops')\n\n# Load the model\nloaded_model = load('model.skops')\n\n# Make a prediction with the loaded model\nprediction = loaded_model.predict([[0, 0]])\nprint(f\"Original model class: {type(model).__name__}\")\nprint(f\"Loaded model class: {type(loaded_model).__name__}\")\nprint(f\"Prediction: {prediction[0]}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"Loading 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`.","severity":"breaking","affected_versions":"All 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.","message":"Model 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions (explicitly warned from v0.11.0)"}],"env_vars":null,"search_vec":"'0.13.0':44 'address':57 'bi':55 'bi-month':54 'bug':58 'cadenc':50 'card':37,75 'current':41 'design':8 'document':20 'dumping/loading':25 'enhanc':60 'face':29 'fix':59 'focus':14 'generat':35 'help':34 'hub':30 'hug':28 'huggingfac':71 'improv':63 'integr':26 'learn':11,66 'librari':39 'machin':10,65 'machine-learn':64 'maintain':46 'manag':69 'model':16,36,68,74 'model-card':73 'model-manag':67 'month':52,56 'object':24 'persist':17,70 'product':13 'provid':22 'regular':48 'releas':49 'secur':23,62 'serial':72 'set':5 'share':18,32 'skop':1,2 'tool':7 'typic':51 'version':43","created_at":"2026-04-09T03:59:48.530269+00:00","updated_at":"2026-04-16T21:48:15.027646+00:00","problems":[{"fix":"Install the library using pip: `pip install skops`","cause":"The `skops` library has not been installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'skops'"},{"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)`).","cause":"By default, `skops` prevents loading models from unknown or potentially untrusted sources to mitigate security risks from arbitrary code execution during deserialization.","error":"ValueError: Cannot load a skops file from an untrusted source without setting `trusted=True`."},{"fix":"Import `Card` from its correct submodule path: `from skops.card import Card`","cause":"The `Card` class is located within the `skops.card` submodule, not directly available under the top-level `skops` package.","error":"ImportError: cannot import name 'Card' from 'skops'"},{"fix":"Access the persistence functions through the `skops.io` submodule: `skops.io.dump(...)` and `skops.io.load(...)`","cause":"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.","error":"AttributeError: module 'skops' has no attribute 'dump'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.14.0","cli_name":"skops","cli_version":"sh: 1: skops: not found","type":"library","homepage":"https://skops.readthedocs.io","github":"http://github.com/skops-dev/skops","docs":"https://skops.readthedocs.io/en/stable/","changelog":"https://skops.readthedocs.io/en/stable/changes.html","pypi":"https://pypi.org/project/skops/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","serialization","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}