Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inferred schema and model structure in one compressed `.mlbundle` file.

It owns export, metadata-only inspection and validated loading. It is the
training-side companion to MLSuite, whose runtime accepts `.mlbundle` uploads.
MLSuite does not train models. The package version is 0.3.0; format 1 is not frozen.
MLSuite does not train models. The package version is 0.3.1; format 1 is not frozen.
Implementation claims require code and test proof.

## What must remain true
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href="https://mlbundle.eshkra.dev"><img src="https://img.shields.io/badge/website-303039?style=flat&amp;logo=astro&amp;logoColor=ff6a1a" alt="Website" /></a>
<a href="https://docs.mlbundle.eshkra.dev"><img src="https://img.shields.io/badge/docs-303039?style=flat&amp;logo=readthedocs&amp;logoColor=ff6a1a" alt="Documentation" /></a>
<a href="https://playground.mlbundle.eshkra.dev"><img src="https://img.shields.io/badge/playground-303039?style=flat&amp;logo=stackblitz&amp;logoColor=ff6a1a" alt="Playground" /></a>
<a href="https://pypi.org/project/mlbundle/"><img src="https://img.shields.io/badge/version-0.3.0-b73d00?style=flat&amp;logo=pypi&amp;logoColor=white&amp;labelColor=303039" alt="Version 0.3.0" /></a>
<a href="https://pypi.org/project/mlbundle/"><img src="https://img.shields.io/badge/version-0.3.1-b73d00?style=flat&amp;logo=pypi&amp;logoColor=white&amp;labelColor=303039" alt="Version 0.3.1" /></a>
<a href="https://github.com/UlloaSP/mlbundle"><img src="https://img.shields.io/badge/source-303039?style=flat&amp;logo=github&amp;logoColor=white" alt="Source on GitHub" /></a>
<a href="https://github.com/UlloaSP/mlbundle/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/UlloaSP/mlbundle/ci.yml?branch=main&amp;style=flat&amp;label=CI&amp;labelColor=303039" alt="CI status" /></a>
<a href="https://github.com/UlloaSP/mlbundle/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-b73d00?style=flat&amp;labelColor=303039" alt="MIT license" /></a>
Expand Down Expand Up @@ -45,11 +45,11 @@ pins the exact wheels a Linux or Windows runtime needs to serve it.

## Installation

MLbundle **0.3.0** requires Python **3.14** for export with the schema extra.
MLbundle **0.3.1** requires Python **3.14** for export with the schema extra.
The installation command for this release is:

```bash
python -m pip install "mlbundle[sklearn,schema,lock]==0.3.0"
python -m pip install "mlbundle[sklearn,schema,lock]==0.3.1"
```

To use a local checkout, run `python -m pip install -e ".[sklearn,schema,lock]"`
Expand Down Expand Up @@ -136,8 +136,8 @@ or training history.

## Runtime environment

Export locks the installed versions of pydantic, the model libraries and their
dependencies as `pylock.toml` for CPython with the GIL on Linux `x86_64` and
Export locks the installed versions of pydantic, the model libraries (and pandas
for scikit-learn pipelines that select columns by name) and their dependencies as `pylock.toml` for CPython with the GIL on Linux `x86_64` and
`aarch64` and on Windows `amd64`. mlbundle itself is pinned by the manifest's
`writer_version`.
A runtime installs that lock plus `mlbundle==writer_version` in an isolated
Expand All @@ -164,7 +164,8 @@ structure, and all-sklearn Pipeline structure is null. The
## Some notes

Package versions and wire-format versions are independent. Format 1 is not frozen;
incompatible schema shapes and bundles without `pylock.toml` require re-export. The security design has not had an
incompatible schema shapes, bundles without `pylock.toml` and 0.3.0 bundles of
pipelines selecting columns by name whose lock lacks `pandas` require re-export. The security design has not had an
independent review; do not accept bundles from untrusted parties.

The reader bounds ZIP/JSON data, verifies integrity and uses closed native loaders.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security policy

MLbundle 0.3.0 has not had an independent security review; do not accept bundles
MLbundle 0.3.1 has not had an independent security review; do not accept bundles
from untrusted parties. Format version 1 is not frozen. It implements strict
manifest validation, secure container reading/writing, metadata-only `inspect`,
export/load, sklearn, XGBoost, CatBoost and ONNX adapters, local schema inference,
Expand Down
12 changes: 8 additions & 4 deletions docs/format-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ The same code validates the lock in the writer, `inspect` and `load`:
lock contains pydantic and the model's library distributions on every target:
`scikit-learn` and `skops`; `xgboost` or `xgboost-cpu` (not both) and
`scikit-learn`; `catboost`; or `onnx` and `onnxruntime`. Composite pipelines
combine their sklearn and leaf requirements.
combine their sklearn and leaf requirements. A scikit-learn model whose
hyperparameters (or a composite's transformer hyperparameters) contain a
`ColumnTransformer` selecting any column by name also needs `pandas`, because
its records are predicted from a DataFrame. Inspection reads this from the
hyperparameter claim; `load` recomputes that claim from the model.
- Bounds: the member cap is 1 MiB (`max_lock_bytes`). Invalid UTF-8, TOML
errors, excessive nesting and non-canonical bytes raise
`InvalidEnvironmentLockError` without echoing values.
Expand All @@ -100,9 +104,9 @@ trained with them.
`export` locks the running interpreter with mlbundle's `lock` extra, which
provides uv:

1. Pin pydantic and the model's library distributions at their installed
versions. Exactly one distribution per requirement group must be installed;
`xgboost-cpu` satisfies XGBoost. Editable, directory, VCS and local-version
1. Pin pydantic, the model's library distributions and, where binding requires
it, pandas at their installed versions. Exactly one distribution per
requirement group must be installed; `xgboost-cpu` satisfies XGBoost. Editable, directory, VCS and local-version
installs cannot be pinned; wheels installed from a file or URL keep their version.
2. Constrain every other installed distribution to its installed version.
3. For each target, resolve wheels only with
Expand Down
3 changes: 2 additions & 1 deletion docs/format-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ fallback is computed. Decisions may disagree with probabilities and are never
checked against them. There is no new public array-level class-decision method.
The existing predictor validates the numeric row and its output as usual.
Sklearn/composite predictors supply a one-row pandas DataFrame only when their
fitted name-based column selectors require one; missing pandas raises
fitted name-based column selectors require one, so their lock pins pandas
([binding](format-environment.md#validation)); missing pandas raises
`MissingOptionalDependencyError` naming the existing schema extra. Other models
receive a nested numeric row, preserving native categorical behavior.
This optional native-owned `record_input` hook does not change array/DataFrame
Expand Down
4 changes: 2 additions & 2 deletions docs/publishing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Publishing to PyPI

Version `0.3.0` is prepared by this checkout. Merging a version change into
Version `0.3.1` is prepared by this checkout. Merging a version change into
`main` automatically starts the PyPI workflow; no one needs to start a release
run manually. Format version 1 is not frozen, so incompatible manifest/schema
shapes require re-export; 0.3.0 requires every bundle to carry `pylock.toml`, as
Expand All @@ -19,7 +19,7 @@ independent review; do not accept bundles from untrusted parties.
tests on Ubuntu and Windows, and all frontend checks, tests and builds.
4. If every check passes, Actions uploads the exact CI-built wheel and source
archive to [mlbundle on PyPI](https://pypi.org/project/mlbundle/).
Install with `python -m pip install "mlbundle[sklearn,schema,lock]==0.3.0"` on
Install with `python -m pip install "mlbundle[sklearn,schema,lock]==0.3.1"` on
Python 3.14, replacing the example version as needed.

The GitHub `pypi_env` environment contains the project-scoped
Expand Down
10 changes: 5 additions & 5 deletions docs/src/content/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
title: Installation
description: Install mlbundle 0.3.0 with the extras for your model library, from PyPI or a local checkout, and check the Python and dependency ranges.
description: Install mlbundle 0.3.1 with the extras for your model library, from PyPI or a local checkout, and check the Python and dependency ranges.
---

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.3.0.
These pages document mlbundle 0.3.1.

```bash
python -m pip install "mlbundle[sklearn,schema,lock]==0.3.0"
python -m pip install "mlbundle[sklearn,schema,lock]==0.3.1"
```

Replace `sklearn` with the extra for your model library; the extras are listed
[below](#choose-the-extras).

## From a local checkout

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

```bash
Expand Down Expand Up @@ -69,7 +69,7 @@ from importlib.metadata import version

import mlbundle

print(version("mlbundle")) # 0.3.0
print(version("mlbundle")) # 0.3.1
print(mlbundle.FORMAT_NAME, mlbundle.FORMAT_VERSION) # mlbundle 1
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Metadata and integrity validated; model claims NOT verified.
Format: mlbundle 1
Bundle id: aa6f6b39-574a-499b-a0ff-de4cdd334050
Created: 2026-10-19T11:17:51.949658+00:00
Writer: "0.3.0"
Writer: "0.3.1"
Model: sklearn "DecisionTreeClassifier" (classifier)
Counts: features=2, outputs=1, classes=[2]
Features (declared): ["temperature", "humidity"]
Expand All @@ -35,7 +35,7 @@ Members:
structure.json: 526 bytes sha256=66204da26781a4e2a800a1f3ed246ab1a43e8c97ced73d06a2640f897eeda03c
pylock.toml: 8595 bytes sha256=b6eabc0870b4c313819d225f3be69fb320dcf0b338cb4d06b3cf24423d3af924
Training: {"python": "3.14.7", "implementation": "CPython", "free_threaded": false, "os": "Windows", "os_version": "11", "architecture": "AMD64"}
Environment lock: CPython 3.14.7 with the GIL, linux-x86_64, linux-aarch64, win-amd64 (Linux glibc 2.28+), 16 packages plus mlbundle "0.3.0"
Environment lock: CPython 3.14.7 with the GIL, linux-x86_64, linux-aarch64, win-amd64 (Linux glibc 2.28+), 16 packages plus mlbundle "0.3.1"
Environment id: b8a31c89e5ed683e2f214cc486b83dc49e5292175c57606b11b515d494e81b57
Locked packages: {"annotated-types": "0.8.0", "cloudpickle": "3.1.2", "joblib": "1.6.0", "narwhals": "2.27.1", ...}
ONNX environment: null
Expand Down
3 changes: 2 additions & 1 deletion docs/src/content/docs/guides/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ print(view.manifest.user_metadata["name"]) # weather
## The runtime lock

Every bundle contains `pylock.toml`, a PEP 751 lock of what serving the model needs: pydantic, the
model libraries and their dependencies, for CPython with the GIL on Linux `x86_64` and `aarch64`
model libraries, pandas for scikit-learn pipelines whose `ColumnTransformer` selects columns by name,
and their dependencies, for CPython with the GIL on Linux `x86_64` and `aarch64`
(glibc 2.28 or newer) and on Windows `amd64`. The manifest's `writer_version` pins mlbundle itself.

Export pins those distributions at their installed versions, constrains every other installed
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/inspect-and-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ from mlbundle import inspect

view = inspect("trained.mlbundle")
manifest = view.manifest
print(manifest.format_version, manifest.writer_version) # 1 0.3.0
print(manifest.format_version, manifest.writer_version) # 1 0.3.1
print(manifest.model.n_features, manifest.model.n_outputs) # 2 1
print([member.value for member in view.members])
# ['manifest.json', 'model.skops', 'schema.json', 'structure.json', 'pylock.toml']
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/records.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ print(regression.predict_record({"temperature": 0.5, "humidity": 0.5}))
## Pipelines that select columns by name

scikit-learn pipelines whose fitted column selectors use names receive a one-row pandas DataFrame
from `predict_record`; this needs pandas, which the `schema` extra installs. Other models receive a
from `predict_record`; this needs pandas, which their lock pins and the `schema` extra installs. Other models receive a
numeric row, preserving their native categorical handling.

The normative record rules are in [Runtime record input](/format/schema/#runtime-record-input).
Loading
Loading