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.
python -m pip install "mlbundle[sklearn,schema]==0.2.1"Replace sklearn with the extra for your model library; the extras are listed
below.
From a local checkout
Section titled “From a local checkout”To work from source, or before 0.2.1 is available from your package index, install a checkout of the repository:
git clone https://github.com/UlloaSP/mlbundle.gitcd mlbundlepython -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):
uv add ../mlbundle --extra sklearn --extra schemaChoose the extras
Section titled “Choose the extras”| 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 examplemlbundle[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.
inspectandmlbundle inspectnever import a model library.
Composite pipelines need both parts: [sklearn,xgboost] or [sklearn,catboost].
Verify the installation
Section titled “Verify the installation”from importlib.metadata import version
import mlbundle
print(version("mlbundle")) # 0.2.1print(mlbundle.FORMAT_NAME, mlbundle.FORMAT_VERSION) # mlbundle 1The console script is installed with the package:
mlbundle --helpTroubleshooting
Section titled “Troubleshooting”| 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. |
