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

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.2"
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.0a2

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.0a2
File Size Uploaded Provenance Actions
binaml-0.1.0a2.tar.gz 33.6 kB With provenance Details for binaml-0.1.0a2.tar.gz

Built distributions (wheels)

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

Download URL binaml-0.1.0a2.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
96cea6498a6ac47214198f5d2a661d807b9cd745af4fcc65413bbae782ac659e
BLAKE2b-256 checksum
How to use checksums
8ecf3dfda28a70630f61180e42bd7bfd1422951a3304f41bd58e764062c8f9b1
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.0a2-cp313-cp313-win_amd64.whl

Download URL binaml-0.1.0a2-cp313-cp313-win_amd64.whl
Size 208.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
456c4ee27bb31de9d919f2518c5bcd1b97adcb9be76666a55348d50bd2916053
BLAKE2b-256 checksum
How to use checksums
cb988a5a9c63f47467059115f347d6044e9648d9c29479b8027fdc723e95c839
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.0a2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL binaml-0.1.0a2-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
c3d9afaf6f914bd9980d1c46a0bf4dac5803f5676fb5ec1f5abd5686624cd3cd
BLAKE2b-256 checksum
How to use checksums
ab3c586acdd27ae07729d25c8347246d8585b3f4d208556e5ffe95af8eab04c3
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.0a2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL binaml-0.1.0a2-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
7ce9af53237ee53d601e8997c5f73e749024cd62666a07b2265ca52eb304b162
BLAKE2b-256 checksum
How to use checksums
a662c988e153be8ee5dbfb74a1e67757c9b8163af5acf8ca9d23093f5409f371
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.0a2

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