Getting Started
1. Install
Section titled “1. Install”Install from PyPI (ships with the bundled Rust server binary):
pip install trailer-sdkBuild from source (development mode):
# Compile the Rust server + bundle the frontendpython build.py# Compile the PyO3 extension (editable install)uv run maturin develop2. Log your first experiment
Section titled “2. Log your first experiment”from trailer import Tracker
t = Tracker(project="demo")for step in range(10): t.log({"loss": 1.0 / (step + 1), "lr": 0.01}, step=step)t.finish()Tracker(project=...)groups runs under a project and generates arun_idautomaticallyt.log({...}, step=step)logs a set of scalar metricst.finish()marks the run as finished
3. Open the dashboard
Section titled “3. Open the dashboard”trailer upYour browser opens http://127.0.0.1:5120, where you can see the demo project and the loss curve.
4. Log more data types
Section titled “4. Log more data types”Trailer supports the full range of data types:
t.log_text("summary", "experiment summary") # textt.log_figure(fig, name="my-plot") # matplotlib figure / G2 spect.log_table({"epoch": [1, 2], "acc": [0.8, 0.9]}) # tablet.log_image(img, name="sample") # PIL / numpy / patht.log_histogram(weights, name="w1") # weight distributiont.log_pca(vectors, name="embeddings") # PCA 3D scattert.log_model(model, name="my-net") # PyTorch model graphSee Advanced data types.
5. Advanced options
Section titled “5. Advanced options”t = Tracker( project="advanced-demo", config={"lr": 0.01, "batch": 32}, # log hyperparameters metric_directions={"accuracy": "max"}, # declare metric direction for `best`)Log remotely
Section titled “Log remotely”t = Tracker( project="demo", host="http://team-server:5120", token="rt_xxxx", # API token from your profile page)