Skip to content

Installation

mlbundle requires Python 3.14 or newer. Its only core dependency is Pydantic v2; every model library is an optional extra that is imported lazily, only when a bundle needs it.

These pages document mlbundle 0.2.1.

Terminal window
python -m pip install "mlbundle[sklearn,schema]==0.2.1"

Replace sklearn with the extra for your model library; the extras are listed below.

To work from source, or before 0.2.1 is available from your package index, install a checkout of the repository:

Terminal window
git clone https://github.com/UlloaSP/mlbundle.git
cd mlbundle
python -m pip install ".[sklearn,schema]"

Inside a uv project, add the checkout as a path dependency instead (adjust the path to where you cloned it):

Terminal window
uv add ../mlbundle --extra sklearn --extra schema
Extra Installs Needed for
sklearn scikit-learn>=1.6, skops>=0.16.0 Exporting and loading scikit-learn models and pipeline prefixes.
xgboost xgboost>=3.4.1, scikit-learn>=1.2 XGBClassifier and XGBRegressor.
catboost catboost>=1.2.10 CatBoost classifiers and regressors. CatBoost brings matplotlib and plotly.
onnx onnx>=1.23.0, onnxruntime>=1.30.0 Existing ONNX files.
schema mlschema>=0.3.0,<0.4 on Python 3.14 only Every export. Also installs pandas.
all All of the above Development and mixed workloads.

Pick by what each machine does:

  • Training machine: the model extra plus schema, for example mlbundle[xgboost,schema]. Export always infers a schema, even without training data.
  • Serving or verifying machine: only the matching model extra, for example mlbundle[xgboost]. Loading validates the schema without pandas or mlschema.
  • Metadata only: no extra. inspect and mlbundle inspect never import a model library.

Composite pipelines need both parts: [sklearn,xgboost] or [sklearn,catboost].

from importlib.metadata import version
import mlbundle
print(version("mlbundle")) # 0.2.1
print(mlbundle.FORMAT_NAME, mlbundle.FORMAT_VERSION) # mlbundle 1

The console script is installed with the package:

Terminal window
mlbundle --help
Symptom Cause Resolution
MissingOptionalDependencyError naming schema Export runs without pandas or mlschema. Install mlbundle[schema] on Python 3.14.
MissingOptionalDependencyError naming a library Load or verify needs the model’s extra. Install the extra named in the message.
mlbundle: missing optional dependency; install mlbundle[xgboost]. Same, from the CLI. Install that extra; inspect works without it.
EnvironmentMismatchError on load A skops load failed and the bundle was written with a different scikit-learn version. Match the training scikit-learn version.
No matching distribution found Python is older than 3.14. Check python --version.