Skip to main content

euler

euler-train

Local-first experiment tracking for PyTorch — structured metrics, outputs and provenance, without a tracking server.

PyPI Python versions License: MIT CI


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 and best-checkpoint state land in meta.json.
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.13.0

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

Source distribution (sdist)

Source distribution for euler-train 2.13.0
File Size Uploaded Provenance Actions
euler_train-2.13.0.tar.gz 79.9 kB Without provenance Details for euler_train-2.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for euler-train 2.13.0
File Interpreter ABI Platform Actions
euler_train-2.13.0-py3-none-any.whl Python 3 none any Details for euler_train-2.13.0-py3-none-any.whl

Total release size: 125.4 kB

Release files / euler_train-2.13.0.tar.gz

Download URL euler_train-2.13.0.tar.gz
Size 79.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e1ff90e38e7e8ad6aa5832dd1f1bda03f3806a6d9f252655379c8fbe04515f
BLAKE2b-256 checksum
How to use checksums
49e7742a849bb058b545503acaadbd1e63045d3e5b017d3592d1d261a244b7d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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.13.0-py3-none-any.whl

Download URL euler_train-2.13.0-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d86a19b46304f7fecc2da89a8df8bd6604c7571d9a716d22847ccab4014092bd
BLAKE2b-256 checksum
How to use checksums
5aa9fdcada6974825bee91a118672408635368f634fe49afecd4d4e93c9ec6a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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.13.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.

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