boundml-rs (Python)
Small numeric models, packaged with their preprocessing and schema. Train linear, logistic/softmax or small MLP models from CSV, and get one checked package with the feature schema, fitted preprocessing, weights, self-tests and a planned memory budget. Load it and predict from raw values. The computation is native Rust (no PyTorch, no ONNX toolchain), the same code as the BoundML CLI and Rust library, so predictions are bitwise identical across all three.
Early public beta (0.1.0). Dense models on numeric features, CPU only. Project, CLI and Rust library: https://github.com/MahmoudYahiaAhmed/boundml.
Install
pip install boundml-rs
import boundml_rs
The distribution is boundml-rs and the import name is boundml_rs. The project
named boundml on PyPI is unrelated.
| Supported and tested | |
|---|---|
| Python | 3.11, 3.12, 3.13, 3.14 (each tested in CI on every platform below) |
| Platforms | Windows x86_64; Linux x86_64 with glibc 2.34 or newer (for example Ubuntu 22.04+, Debian 12+); macOS on Apple silicon (arm64) |
| Not built | Intel macOS, ARM Linux, musl (Alpine), 32-bit; there is no source distribution yet |
| Dependencies | NumPy 2.x; pandas optional (for DataFrame input) |
Use
Training takes a TOML config and CSV files. The CLI release archives include a real example: UCI breast-cancer data, a 30-feature binary classification problem. Download an archive from the v0.1.0 release, extract it, and run this from the extracted folder:
import boundml_rs
import pandas as pd
# Train from a TOML config, then compare with a constant baseline on held-out data.
result = boundml_rs.train("examples/breast_cancer/linear.toml", "bc/ckpt")
print(result["completed"], result["global_step"]) # True 960
metrics = boundml_rs.evaluate("bc/ckpt", "datasets/breast_cancer/test.csv")
print(metrics["model"]["accuracy"], metrics["baseline"]["accuracy"]) # 0.9596... 0.5806...
# Package it: weights + schema + fitted preprocessing + self-tests, verified after writing.
model = boundml_rs.pack("bc/ckpt", "bc/model.boundml")
# Later, from anywhere: load and predict from raw values.
model = boundml_rs.load("bc/model.boundml")
print(model.verify()["passed"]) # True
df = pd.read_csv("datasets/breast_cancer/test.csv") # extra columns (id, diagnosis) are ignored
p = model.predict(df) # float32, shape (124, 1): P(class "M")
print(model.outputs, p.shape, p[:3, 0]) # ['p_M'] (124, 1) [0.9998099 0.99994636 0.9985293 ]
predict accepts a pandas DataFrame (columns matched by name), one dict or a list of
dicts (keys are feature names), or a NumPy array of shape (rows, n_features) in
model.features order. None or NaN means missing and follows the schema's
missing-value policy. The result is a float32 array of shape (rows, len(model.outputs)).
Errors raise boundml_rs.BoundMLError with a stable code, for example BML-D004
(schema mismatch), BML-D005 (a value that is not a number) or BML-C005 (memory
budget exceeded). Every code is explained in
docs/errors.md.
| Function | Does |
|---|---|
boundml_rs.train(config, checkpoint, resume=False, max_steps=None) |
train; Ctrl-C saves a resumable checkpoint |
boundml_rs.evaluate(path, data_csv) |
metrics for a checkpoint or package, with a constant baseline |
boundml_rs.pack(checkpoint, out, name=None) |
write a package and return it as a Model |
boundml_rs.load(path) |
load and validate a package |
Model.predict(data) / .verify() / .memory_report(sessions) |
predict, self-test, planned memory |
Model.features / .outputs / .manifest |
the package's contract |
A Model holds one of the package's declared sessions once it has predicted. It is
thread-safe, and predictions release the GIL.
Limits
Dense models only (linear, logistic/softmax, MLPs with ReLU/Tanh/Sigmoid) on numeric features; no categorical features, trees, images, text or GPU. Single-threaded kernels: ONNX Runtime is about 2–2.4× faster on large batches. On the two bundled datasets, the tested MLPs did not beat the linear baselines. Measurements and their limits: docs/benchmarks.md.
License: MIT OR Apache-2.0.
Metadata
Release files for boundml-rs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| boundml_rs-0.1.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| boundml_rs-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| boundml_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 2.8 MB
Release files / boundml_rs-0.1.0-cp311-abi3-win_amd64.whl
| Download URL | boundml_rs-0.1.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 889.8 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
85963bccc61dabfeed0dc6804dc8d58a537447d80c4f126bc66c316ff968f6ec
|
|
BLAKE2b-256 checksum How to use checksums |
4eb13dc23d024e87bc922618166e40e252d21f5f05d85ec9e390d08868c057ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / boundml_rs-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl
| Download URL | boundml_rs-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ee3036cda6de712755bca5cc8046997601b8bdc0de45869aaad8cfb95761bfcb
|
|
BLAKE2b-256 checksum How to use checksums |
22969ca89fc66d73c35f74d03f2166c7d974cccca62e658bf0cc5dcd30279c6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / boundml_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | boundml_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 920.3 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f271a294d058086bebe0f334cf077b76454078397ec99a8ef37e86faa057b328
|
|
BLAKE2b-256 checksum How to use checksums |
c03a686eed76a8a6c5dd5a7d667b1bc064426b751571ab19f4d8803a66c5edc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for boundml-rs 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for boundml_rs-0.1.0-cp311-abi3-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.