This release is a pre-release and may not be stable for production use.
Binaml focuses on continual learning models over streams of binary features subject to data drift. Binary features provide a task-agnostic representation and enable models optimized for memory, latency, and energy efficiency.
Core concepts
Binaml starts with input bits and learns boolean functions by composing pairs of Boolean features. Each composition is one of the 16 Boolean functions of arity two, represented as a four-bit truth table. Repeated composition yields richer, inspectable boolean functions.
BRegressor is the current Binaml model: an online ensemble of batch-learned
boolean functions, each with a scalar weight, updated by residual-sign SGD.
See the Binaml paper for the model specification.
The supported Python API is binaml.BRegressor. The supported Rust API is
binaml_core::BRegressor. binaml._core is a private implementation detail.
Quick start: Python
Install the alpha package with uv:
uv add "binaml==0.1.0a3"
To run from a checkout, install Python 3.13+, a Rust toolchain, and the project dependencies:
uv sync
import numpy as np
from binaml import BRegressor
model = BRegressor(n_features=2)
for features, target in [
(np.array([0, 1], dtype=np.uint8), 1.0),
(np.array([1, 0], dtype=np.uint8), 0.0),
]:
prediction = model.predict(features)
model.update(target)
Each predict(features) call must be followed by update(target).
Quick start: Rust
Add binaml-core to your Cargo.toml:
[dependencies]
binaml-core = "0.1.0-alpha.3"
use binaml_core::{BRegressor, BRegressorError};
fn main() -> Result<(), BRegressorError> {
let mut model = BRegressor::with_hyperparameters(
2, 5e-3, 1e-4, 16, 5, 8, 3, 64,
)?;
for (features, target) in [([false, true], 1.0), ([true, false], 0.0)] {
let prediction = model.predict(&features)?;
model.update(target)?;
println!("{prediction}");
}
Ok(())
}
Benchmarks
The included synthetic streaming environments and prequential evaluation
protocol compare BRegressor and BClassifier with linear and MLP baselines.
See the
synthetic drifting streams paper
for the benchmark specification. Metrics are written by default; pass
--plots to also write PNG artifacts. Linear and MLP baselines require the
benchmarks extra (JAX):
uv run --extra benchmarks python -m binaml.benchmarks.synthetic_streaming_regression.cli \
--scenario python/binaml/benchmarks/synthetic_streaming_regression/scenarios/default.json
uv run --extra benchmarks python -m binaml.benchmarks.synthetic_streaming_classification.cli \
--scenario python/binaml/benchmarks/synthetic_streaming_classification/scenarios/default.json \
--plots
Citation
If you use Binaml, cite the software metadata in CITATION.cff. Cite our papers separately when their model or benchmark specification informs your work.
License
Source code is licensed under Apache-2.0.
Metadata
Release files for binaml 0.1.0a3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binaml-0.1.0a3.tar.gz | 41.1 kB | With provenance | Details for binaml-0.1.0a3.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binaml-0.1.0a3-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details for binaml-0.1.0a3-cp313-cp313-win_amd64.whl |
| binaml-0.1.0a3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details for binaml-0.1.0a3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| binaml-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.13 | CPython 3.13 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 | Details for binaml-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
Total release size: 1.2 MB
Release files / binaml-0.1.0a3.tar.gz
| Download URL | binaml-0.1.0a3.tar.gz |
|---|---|
| Size | 41.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7d82e3ed95d053b83b098d971311cf39d5e8be82f3b6efe1746de209040cc2b
|
|
BLAKE2b-256 checksum How to use checksums |
67fc6494c28753e15ce9cf5a085d1e54824237660be7d98530c01ec1c3f1b42b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 16, 2026.
Transparency logRelease files / binaml-0.1.0a3-cp313-cp313-win_amd64.whl
| Download URL | binaml-0.1.0a3-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 222.3 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
bd6f884b39620e931b432f2ac634983c431cede412a145ba946bc94d3dad6fd4
|
|
BLAKE2b-256 checksum How to use checksums |
a3b05f21d96063e968771e43c4a5f17ea0c2b0e75b4d3bc791df3a4c7b0d408e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 16, 2026.
Transparency logRelease files / binaml-0.1.0a3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | binaml-0.1.0a3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 367.6 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
69b905c732e68b4108aecfc55163bdf2788cdd69959387792744bc63390f343c
|
|
BLAKE2b-256 checksum How to use checksums |
153af6a3b03eb31264304a23b4b0409ac3f713a38b2e4f43ac8f7c9a65f6ffa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 16, 2026.
Transparency logRelease files / binaml-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | binaml-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 601.8 kB |
| Tags | CPython 3.13 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
adc504b510abe00520408879346d1887b89c94a43cd1edfa628057fa16bd7724
|
|
BLAKE2b-256 checksum How to use checksums |
6895a93ed2ca174e44fa6a1e980ca355ebcd867c9475381367d1130e49ed846f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 16, 2026.
Transparency logSecurity for binaml 0.1.0a3
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 4 files in this release have been uploaded with provenance metadata.
Attestation for binaml-0.1.0a3.tar.gz
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 Aug 16, 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.