One verifiable file for a trained model.
mlbundle puts the model in its native format, a manifest of model and training-environment metadata, a locally inferred input schema and the model's structure into one .mlbundle file. Before it hands you the model, the reader recomputes every model-derived claim and rejects disagreement.
from sklearn.tree import DecisionTreeClassifier
from mlbundle import export
rows = [[0.0, 1.0], [1.0, 0.0], [0.1, 0.9], [0.9, 0.1]]model = DecisionTreeClassifier(random_state=7).fit(rows, ["cold", "warm"] * 2)export(model, "trained.mlbundle", feature_names=["temperature", "humidity"])from mlbundle import load
bundle = load("trained.mlbundle") # verified before it is returnedprint(bundle.predict_proba([[0.0, 1.0]])) # [[1.0, 0.0]]print(bundle.predict_record({"0": "0.0", "1": "true"})[0].predicted_label) # coldNo pickle, joblib or cloudpickle is involved at any step. scikit-learn models are stored with skops against a closed allowlist, XGBoost as native UBJSON, CatBoost as native CBM, and ONNX files byte for byte. Loading rebuilds the model through mlbundle’s own adapter, extracts its claims and structure with the same code the writer used, and rejects the bundle when they disagree.
Find your path
Section titled “Find your path”
Bundle a first model
Export a classifier, inspect it, load it and predict.
Control what goes in
Feature names, labels, targets, metadata and
overwrite.
Keep data local
What the schema carries, and why samples need sample_rows=N.
Read a bundle
inspect for metadata, load for a verified model.
Predict from a form
Records keyed by the schema, frozen per-output results.
Check your model
scikit-learn, XGBoost, CatBoost, ONNX and composite pipelines.
Why a bundle
Section titled “Why a bundle”Uploading a pickled model and a DataFrame leaves three gaps that mlbundle closes:
| Gap | What mlbundle does |
|---|---|
| Loading a pickle can execute code. | Closed adapters use skops, native UBJSON/CBM or the original ONNX file. There is no pickle fallback. |
| The training versions are lost. | The manifest records Python, OS, architecture and installed package versions next to model and feature metadata. |
| Training data leaves the machine. | Schema inference runs locally. Rows are included only when you ask for them explicitly. |
mlbundle is the training-side companion to MLSuite, whose runtime accepts only .mlbundle
uploads. It is open source under the MIT license and part of eshkra. Read
the source on GitHub.
