Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Binaml

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 builds richer features 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 forms layered, inspectable Boolean feature graphs.

A linear model combines the resulting features and adapts online to drift. BRegressor is the current Binaml model, combining online SGD with residual-learned composed Boolean features.

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.0a1"

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.observe(features, target)

Each predict(features) call must be followed by observe(features, target).

Quick start: Rust

Add binaml-core to your Cargo.toml:

[dependencies]
binaml-core = "0.1.0-alpha.1"
use binaml_core::{BRegressor, BRegressorError};

fn main() -> Result<(), BRegressorError> {
    let mut model = BRegressor::with_hyperparameters(
        2, 0.03, 1e-4, 32, 3, 8, 32, 32, 2,
    )?;

    for (features, target) in [([false, true], 1.0), ([true, false], 0.0)] {
        let prediction = model.predict(&features)?;
        model.observe(&features, target)?;
        println!("{prediction}");
    }

    Ok(())
}

Benchmarks

The included synthetic streaming-regression environment and prequential evaluation protocol compare BRegressor with SGDLinearRegressor, a Python SGD baseline with L2 weight decay. See the synthetic drifting regression paper for the benchmark specification. Plotting support is optional:

uv run --extra benchmarks python -m binaml.benchmarks.synthetic_streaming_regression.cli \
  --scenario python/binaml/benchmarks/synthetic_streaming_regression/scenarios/default.json

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.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binaml 0.1.0a1
File Size Uploaded Provenance Actions
binaml-0.1.0a1.tar.gz 33.5 kB With provenance Details for binaml-0.1.0a1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for binaml 0.1.0a1
File Interpreter ABI Platform Actions
binaml-0.1.0a1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for binaml-0.1.0a1-cp313-cp313-win_amd64.whl
binaml-0.1.0a1-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.0a1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
binaml-0.1.0a1-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.0a1-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.0a1.tar.gz

Download URL binaml-0.1.0a1.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
276a895742ab970c5d887353396627b0abd8f0d53c09df676b29a15bfcd7a8f8
BLAKE2b-256 checksum
How to use checksums
c15c39fc05f3a368e9c80dccc381ed73ad308ef2954a0432373d4be1c314b8d6
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 12, 2026.

Transparency log

Release files / binaml-0.1.0a1-cp313-cp313-win_amd64.whl

Download URL binaml-0.1.0a1-cp313-cp313-win_amd64.whl
Size 208.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
351422faeabc4faa15067df952b36984270687e5195d2aefe9c9f9e790dba740
BLAKE2b-256 checksum
How to use checksums
62d7a5be04746f4edf67b5f3de1f3c9b11c996a3bb511964ede999bf6ee2eef4
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 12, 2026.

Transparency log

Release files / binaml-0.1.0a1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL binaml-0.1.0a1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 353.6 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e56e4b90d0198ae453427377f6c0e79a05e19fefb90611da46ec407e92c5bcf9
BLAKE2b-256 checksum
How to use checksums
d5148690b20720fdff9e977fd8ef7c5b37604a2fe8f9d7a6adce4f92cda7a77c
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 12, 2026.

Transparency log

Release files / binaml-0.1.0a1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL binaml-0.1.0a1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 593.3 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
b765994f955d259b42c9847b64bd995f7b353cd5bee19ad2d8c24bf4d1cb4c42
BLAKE2b-256 checksum
How to use checksums
c1ec573dc51b4f43c234a7110b20506ec61a144e9077cf1a3194719837383760
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 12, 2026.

Transparency log

Security for binaml 0.1.0a1

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.

Select from 4 files

Attestation for binaml-0.1.0a1.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 12, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page