Skip to main content

Lightweight, framework-agnostic ML experiment tracker.

Project description

PyPI version Python Version Tests Downloads

blackboxml

ML experiment tracking without the infrastructure. Log metrics from any training loop to local JSON, inspect runs from the CLI.

Works with PyTorch, Keras, scikit-learn, or plain Python.

Install

pip install blackboxml
pip install blackboxml[keras]  # optional TensorFlow support

Usage

@track decorator

from blackboxml import track, MetricStore

@track(name="resnet_cifar10", tags=["pytorch", "cifar10"])
def train():
    metrics = MetricStore()
    for epoch in range(10):
        metrics.reset()
        for batch in dataloader:
            loss, acc = train_step(batch)
            metrics.update({"loss": loss, "acc": acc}, n=len(batch))
        yield metrics.compute()

train()

Run context manager

from blackboxml import Run

with Run(name="resnet_cifar10", tags=["pytorch"]) as run:
    for epoch in range(10):
        run.log({"loss": train_one_epoch(), "epoch": epoch})

Keras callback

from blackboxml.callback import BlackBoxCallback

model.fit(x_train, y_train, epochs=10,
          callbacks=[BlackBoxCallback(name="lstm_nlp", tags=["keras"])])

CLI

$ bbml runs
NAME              DATE                 DURATION  STEPS  TAGS
----------------------------------------------------------------
resnet_cifar10    2026-03-10 14:22:01    13m 46s     10  pytorch, cifar10
lstm_nlp          2026-03-10 11:05:33     4m 12s      5  keras

$ bbml show resnet_cifar10
$ bbml clean

What gets logged

Each run saves to blackboxml_logs/<name>_<timestamp>/run.json:

{
  "name": "resnet_cifar10",
  "tags": ["pytorch", "cifar10"],
  "environment": {
    "git_commit": "a3f91bc",
    "git_dirty": false,
    "python": "3.11.2",
    "torch": "2.3.0",
    "hostname": "lab-gpu-01"
  },
  "start": "2026-03-10T14:22:01",
  "end": "2026-03-10T14:35:47",
  "duration_seconds": 826,
  "steps": [
    {"loss": 0.842, "acc": 0.65},
    {"loss": 0.671, "acc": 0.78}
  ]
}

Git commit, Python version, framework versions, and hostname are captured automatically.

Releases

Version Date What changed
0.1.0 Apr 2025 Initial release — Keras auto-logging, visualise_metrics
0.2.0 Jul 2025 Type hints, logging module, error handling
0.5.0 Mar 2026 Framework-agnostic rewrite — @track, Run, MetricStore, bbml CLI

Contributing

See Contributing Guidelines to get started. Bug reports, feature requests, and pull requests are welcome.

License

Apache License 2.0

Author

Stuart Asiimwe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blackboxml-0.5.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blackboxml-0.5.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file blackboxml-0.5.0.tar.gz.

File metadata

  • Download URL: blackboxml-0.5.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blackboxml-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8d0aa3f3f8057c98e7124ab6ff9569c3720efa0ac915603233aed7afc9540183
MD5 f5e28c320d8eb6843a543c5434c4cd2b
BLAKE2b-256 be9161a8d0b3641ba7f0b0e98ad9d588f247e378a966673eddf7e379520cd4d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for blackboxml-0.5.0.tar.gz:

Publisher: publish.yml on stuartasiimwe7/blackboxml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file blackboxml-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: blackboxml-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blackboxml-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97adf5b60c3f20dd8d5588201ec96cdfe815bf642306b3246a65dfc951cb4459
MD5 54df9b70e89d2d11a05ccc9440b3c7cc
BLAKE2b-256 052625f361d5a2462c1df6aa914a1f5d2a5324b5e2e2bce5a3719917e6b19d8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for blackboxml-0.5.0-py3-none-any.whl:

Publisher: publish.yml on stuartasiimwe7/blackboxml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page