euler-train
Local-first experiment tracking for PyTorch — structured metrics, outputs and provenance, without a tracking server.
Experiment trackers are useful until the network is unavailable, a cluster job cannot reach the service, or the service itself changes. euler-train keeps the durable record where the work happened: ordinary JSON, JSONL, NumPy and image files in the run directory.
One Run records the training configuration, source revision, environment,
metrics, model outputs, checkpoints and lifecycle state. The directory remains
readable with standard tools, and can optionally be streamed to Euler View as a
best-effort secondary destination.
flowchart LR
T["training loop"] --> R(["euler_train.Run"])
R --> P["provenance<br/>meta · config · git · environment"]
R --> M["metrics<br/>train.jsonl · val.jsonl"]
R --> O["outputs<br/>arrays · images · manifests"]
R --> C["checkpoints"]
R -. "optional" .-> V["Euler View"]
Install
pip install "euler-train[images]"
Requires Python 3.9+. PyTorch is deliberately not a core dependency: the
package is intended to live inside an existing training environment. The
[images] extra supports the PNG outputs used below; for metrics and checkpoint
bookkeeping alone, pip install euler-train is enough.
Install only the integrations you use:
pip install "euler-train[images,gpu]" # PNG output + NVIDIA metrics
pip install "euler-train[architecture]" # weightless ONNX export
pip install "euler-train[datasets]" # ds-crawler metadata fallback
pip install "euler-train[yaml]" # YAML config files
pip install "euler-train[naming]" # structured metric naming
Quick start
import euler_train
epochs = 50
global_step = 0
with euler_train.init(
dir="experiments/dehazing",
run_name="unet-baseline",
config={"lr": 1e-4, "architecture": "unet", "epochs": epochs},
) as run:
for epoch in range(epochs):
for batch in train_loader:
loss = train_step(model, batch)
global_step += 1
run.log(
{"loss": loss.item(), "lr": optimizer.param_groups[0]["lr"]},
step=global_step,
epoch=epoch,
)
metrics, prediction, target = evaluate(model, val_loader)
run.log(metrics, step=global_step, epoch=epoch, mode="val")
run.save_outputs(
epoch=epoch,
step=global_step,
rgb={"pred": prediction, "gt": target},
)
run.save_checkpoint(
model,
epoch=epoch,
step=global_step,
optimizer=optimizer,
)
The context manager marks clean exits as completed, records uncaught
exceptions as crashed, and records SIGINT/SIGTERM as interrupted before
re-raising or forwarding the event.
What you get
| Local-first | Files are always written before optional stream events; logging does not depend on a service or account. |
| Reproducibility snapshot | Every fresh run captures config, Git revision and dirty diff, Python/packages, CUDA/GPU details and SLURM allocation. |
| Append-only metrics | Training and validation records are JSONL, with step, epoch, wall time and optional GPU utilization added automatically. |
| Structured outputs | Predictions, targets, inputs and auxiliary arrays are saved as PNG/NPY/NPZ with a manifest for every snapshot. |
| Dataset-aware IDs | Batches from euler-loading retain stable sample IDs and dataset provenance. |
| Checkpoint bookkeeping | Save checkpoints directly or register files written by another framework; paths, best-checkpoint state and how it was selected land in meta.json. |
| Comparable validation | With euler-metric-naming's training naming 2.0, every logged key is defined (direction, unit) and checked; validation sets record in-training validation as evaluations a viewer can judge against the final evaluation. See API and the cross-repo plan. |
| Resume and evaluation | Reopen a run by ID or path, preserve its history, and attach named evaluation records and per-mode lifecycle state. |
| Optional live view | Best-effort event consumers can mirror a run to Euler View without weakening the on-disk source of truth. |
On disk
Each call creates a timestamped run under <project>/runs/:
experiments/dehazing/
└── runs/
└── 2026-08-04_14-32-10_a3f2/
├── meta.json
├── config.json
├── code_ref.json
├── run_environment.json
├── train.jsonl
├── val.jsonl
├── checkpoints/
│ └── epoch_4.pt
└── outputs/
└── epoch_4_step_2500/
├── manifest.json
└── rgb/
├── pred/
└── gt/
run.run_id is the generated identifier and run.dir is the concrete run
directory. See Run file format for the complete layout
and schemas.
Named outputs from a batch
save_outputs_from_batch() turns the full_id or id values in a collated
batch into stable filenames. When the dataset exposes describe_id_schema(),
the helper can also add that schema to the output manifest:
run.save_outputs_from_batch(
batch=batch,
dataset=val_dataset,
epoch=epoch,
step=global_step,
metadata={"dataset": "vkitti2", "split": "val"},
rgb={"pred": prediction, "gt": batch["rgb"]},
depth={"pred": depth_prediction},
)
Optional streaming
Local files remain authoritative when streaming is enabled:
import os
run = euler_train.init(
dir="experiments/dehazing",
config=config,
stream={
"base_url": os.environ["EULER_VIEW_BASE_URL"],
"api_token": os.environ["EULER_VIEW_API_TOKEN"],
"stream_attach_token": os.environ["EULER_VIEW_STREAM_ATTACH_TOKEN"],
},
)
Network failures are warned about and buffered within configured limits; they do not stop the training loop. See Euler View streaming for session modes, SLURM matching, connectivity checks and custom consumers.
Documentation
| Guide | Covers |
|---|---|
| API and workflows | Initialization, metrics, checkpoints, resume, datasets, evaluations, modes and lifecycle |
| Saving model outputs | Slot structure, batch-aware naming, manifests, format inference and PNG visualization |
| Run file format | Directory layout and the meta.json, provenance, environment and metric records |
| Euler View streaming | Authentication, attachment, dry-run checks, buffering and custom stream consumers |
meta.json JSON Schema |
Machine-readable run metadata contract |
Development
git clone https://github.com/d-rothen/euler-train.git
cd euler-train
pip install -e ".[dev]"
pytest
See CONTRIBUTING.md for project conventions and the release workflow.
License
MIT © Daniel Rothenpieler
Metadata
Release files for euler-train 2.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| euler_train-2.16.0.tar.gz | 95.1 kB | Without provenance | Details for euler_train-2.16.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| euler_train-2.16.0-py3-none-any.whl | Python 3 | none | any | Details for euler_train-2.16.0-py3-none-any.whl |
Total release size: 147.5 kB
Release files / euler_train-2.16.0.tar.gz
| Download URL | euler_train-2.16.0.tar.gz |
|---|---|
| Size | 95.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92d784c47556875363c7ff17d2719771b9ea0a5341a18fe0bac1cb81dd13e456
|
|
BLAKE2b-256 checksum How to use checksums |
b327728d087891d271e53a996ceb63818634e6da64b1353746a623cfd968d2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / euler_train-2.16.0-py3-none-any.whl
| Download URL | euler_train-2.16.0-py3-none-any.whl |
|---|---|
| Size | 52.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d77422293b97a9f19511e893231b3b5452fdd53ab528c68ea2acb6603d169180
|
|
BLAKE2b-256 checksum How to use checksums |
e364adcfac96bbd787b6362f3b8a47672d1ca5ee5f7edc4a782feb7c09213f94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for euler-train 2.16.0
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.