ML experiment tracking. Local, lightweight, framework-agnostic.
Project description
blackboxml
ML experiment tracking. Local, lightweight, framework-agnostic.
blackboxml logs your training runs as structured JSON. No accounts, no servers. It works with PyTorch, Keras, scikit-learn, or any Python training loop.
Install
pip install blackboxml
pip install blackboxml[keras] #(opt) TensorFlow support
Requires Python 3.10+.
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"])])
scikit-learn
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from blackboxml import Run
with Run(name="rf_search", tags=["sklearn"]) as run:
for n in [50, 100, 200]:
scores = cross_val_score(RandomForestClassifier(n_estimators=n), X, y, cv=5)
run.log({"n_estimators": n, "accuracy": scores.mean()})
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.
Visualisation
from blackboxml import visualise_run
visualise_run("blackboxml_logs/resnet_cifar10_20260310_142201/run.json")
visualise_run("blackboxml_logs/resnet_cifar10_20260310_142201/run.json",
save_path="plots/", show=False)
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 |
| 0.5.1 | Apr 2026 | Migrated repo to sxa-lab, updated license classifier, added PyPI metadata |
| 0.5.2 | Apr 2026 | Documentation update, ReadTheDocs, updated package authorship |
Contributing
See Contributing Guidelines to get started. Bug reports, feature requests, and pull requests are welcome.
License
Maintainer
Maintained by SxA Lab
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blackboxml-0.5.2.tar.gz.
File metadata
- Download URL: blackboxml-0.5.2.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f180ccb9e69830008be918a5ef1e6de18e86892ec5194c2eab1fa417f506bc6e
|
|
| MD5 |
341246fa40b673f617c23b8cf79783d9
|
|
| BLAKE2b-256 |
4660c244f7dd00ec680a6056f3ef47ba3032a60995a6e46a28191be45736f62b
|
Provenance
The following attestation bundles were made for blackboxml-0.5.2.tar.gz:
Publisher:
publish.yml on sxa-lab/blackboxml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboxml-0.5.2.tar.gz -
Subject digest:
f180ccb9e69830008be918a5ef1e6de18e86892ec5194c2eab1fa417f506bc6e - Sigstore transparency entry: 1397257679
- Sigstore integration time:
-
Permalink:
sxa-lab/blackboxml@03d080037c81b8254765b240bff370519642a76a -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/sxa-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03d080037c81b8254765b240bff370519642a76a -
Trigger Event:
push
-
Statement type:
File details
Details for the file blackboxml-0.5.2-py3-none-any.whl.
File metadata
- Download URL: blackboxml-0.5.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34d32c0eafb63e9fab81a25d2e18b6f93f11ed679e758ccf5cbf7c9c3b1b526e
|
|
| MD5 |
6890395e9120c2e72b54d0bb41533670
|
|
| BLAKE2b-256 |
cd88e38cafe612fd3a201251c2ab69e40b5b9d6ab8afc8b0d2c6aed75b349ac6
|
Provenance
The following attestation bundles were made for blackboxml-0.5.2-py3-none-any.whl:
Publisher:
publish.yml on sxa-lab/blackboxml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blackboxml-0.5.2-py3-none-any.whl -
Subject digest:
34d32c0eafb63e9fab81a25d2e18b6f93f11ed679e758ccf5cbf7c9c3b1b526e - Sigstore transparency entry: 1397257685
- Sigstore integration time:
-
Permalink:
sxa-lab/blackboxml@03d080037c81b8254765b240bff370519642a76a -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/sxa-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03d080037c81b8254765b240bff370519642a76a -
Trigger Event:
push
-
Statement type: