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). If a script logs faster than the thread can write (hundreds of thousands of values per second), log() waits once 10,000 calls are queued, and warns once: nothing is dropped and memory stays bounded.
  • 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.3

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.3
File Size Uploaded Provenance Actions
trainbay-0.0.3.tar.gz 21.0 kB Without provenance Details for trainbay-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 36.1 kB

Release files / trainbay-0.0.3.tar.gz

Download URL trainbay-0.0.3.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4cbab21153431ccecf2432be1645cd885625f5e94cd3763cff8338344d3f9223
BLAKE2b-256 checksum
How to use checksums
f8cb53199db0d7fcd7a19c101ab2c291368d1b5eede83311ae5ff573b21ff3b6
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.3-py3-none-any.whl

Download URL trainbay-0.0.3-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e372e8d7add0f2b439b75f4333a8a113f91801f40829a5f1736b644e45c7ba29
BLAKE2b-256 checksum
How to use checksums
0549b4f5aa4e20a9352597b43f3c7fd8228ea42311d80d25169832d60b3c1814
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.3

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