Skip to main content

trainbay

Log training metrics to a local SQLite file and watch them live in your IDE with the Trainbay extension. No account, no server, no browser.

import trainbay

trainbay.init(name="mnist-baseline", config={"lr": 3e-4, "batch_size": 64})  # optional
for step in range(1000):
    loss = train_step()
    trainbay.log({"train/loss": loss}, step=step)
trainbay.finish()  # optional, runs automatically when the script exits

How it works

  • log() only puts values in memory. A background thread writes them in batches (every 50 values or 0.5 s).
  • Data goes to .trainbay/trainbay.db in the project root: the first folder that has .trainbay, .git or pyproject.toml, walking up from the script's folder, then from the working directory. Set TRAINBAY_DIR to use another folder.
  • The .trainbay/ folder ignores itself in git.
  • On a network path (UNC, \\wsl$, mapped network drive), SQLite cannot share the file safely, so the database goes to %LOCALAPPDATA%\Trainbay\<project>-<hash> and a warning is printed.
  • The run is finished when the script exits normally, stopped on Ctrl+C and failed on any other uncaught exception. A run killed hard (Task Manager, taskkill /F, SIGKILL) stays running with a stale heartbeat; the IDE shows it as stopped. Up to flush_interval seconds of the newest values are lost in that case; call trainbay.flush() to write everything now.
  • With torchrun, only the process with RANK=0 writes.
  • Values must be numbers (Python numbers, NumPy scalars, 0-d tensors). NaN is stored as empty.

Requires Python 3.11+. No dependencies besides the standard library.

Development

uv run pytest

Metadata

Release files for trainbay 0.0.2

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

Source distribution (sdist)

Source distribution for trainbay 0.0.2
File Size Uploaded Provenance Actions
trainbay-0.0.2.tar.gz 19.5 kB Without provenance Details for trainbay-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trainbay 0.0.2
File Interpreter ABI Platform Actions
trainbay-0.0.2-py3-none-any.whl Python 3 none any Details for trainbay-0.0.2-py3-none-any.whl

Total release size: 33.6 kB

Release files / trainbay-0.0.2.tar.gz

Download URL trainbay-0.0.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cd1d7ef02c30685b337241af768cf386b1fe8310c27fd3b8c58c6dd807150e6c
BLAKE2b-256 checksum
How to use checksums
8321b608c630f0ffd7f1c2c6eec36f01dcf6adb6441ab16b99f3280725c4c18b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / trainbay-0.0.2-py3-none-any.whl

Download URL trainbay-0.0.2-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bf439d65f5365fbdfb858ad691dbf9cc4b4e297c3dfd0a5c6df8bf0d6d45f75
BLAKE2b-256 checksum
How to use checksums
107e932fbd604fef81643e2c0000df43dee15ce6847c916c86960eaa9c92ff2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for trainbay 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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