Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trainy.ai/llms.txt

Use this file to discover all available pages before exploring further.

A run starts with pluto.init() and ends with either run.finish() (mark it complete on the server) or run.close() (release local resources without changing the run’s server-side state). This page covers the parameters for each, plus how to resume a finished run.

Starting a Run

import pluto

run = pluto.init(
    project="my-project",
    name="experiment-1",
    config={"lr": 1e-3, "batch_size": 32},
    tags=["baseline"],
)
Common parameters:
ParameterTypeDescription
projectstrProject name (auto-created if it doesn’t exist).
namestrHuman-readable run name. Pluto also auto-generates a sequential display ID like MMP-42.
configdictHyperparameters. Snapshot at init; for in-run edits use run.update_config().
tagslist[str]Initial tag set. Edit later with run.add_tags() / run.remove_tags().
run_idint | strResume an existing run by numeric ID or display ID. Used with resume=True.
resumeboolIf True, re-open a previously finished run instead of creating a new one.
fork_run_idint | strFork from a parent run. See Run Forking.
fork_stepintRequired with fork_run_id. Step number to fork at.
inherit_configboolWhen forking, deep-merge the parent’s config into the child’s. Defaults to True.
inherit_tagsboolWhen forking, copy the parent’s tags. Defaults to False.

Resuming a Finished Run

run = pluto.init(project="my-project", run_id="MMP-42", resume=True)
run.log({"eval/accuracy": 0.94}, step=10000)
run.finish()
Both numeric IDs (12345) and display IDs ("MMP-42") are accepted.

Ending a Run

The SDK exposes two teardown methods:
MethodLocal cleanupMarks the run on the serverUse when
run.finish()YesYes — transitions to COMPLETED (or FAILED on uncaught exception)The training loop is done and you want the run to leave the active state.
run.close()YesNo — server status is unchangedA short-lived process attached to an ongoing run and shouldn’t end it.
Both stop the monitor thread, drain the sync queue, and close HTTP clients. run.finish() also fires automatically on interpreter shutdown via atexit. run.close() unregisters the atexit hook, so a process that calls close() won’t accidentally complete the run when it exits.

When to Use close() Instead of finish()

close() supports multi-process workflows where one process attaches to an active run and shouldn’t take it down on exit. Two common cases:
  • Eval job appending to a live training run. The training loop holds the “real” finish(). The eval process opens the same run with resume=True, writes metrics, and close()s — leaving the run active.
  • Side process uploading artifacts while the main run is still producing data elsewhere.
# In a side process attaching to a still-running training job
run = pluto.init(project="my-project", run_id="MMP-42", resume=True)
run.log({"eval/loss": 0.32}, step=current_train_step)
run.close()  # local teardown only, run stays active on the server
close() is idempotent and thread-safe; subsequent finish() calls on a closed run are no-ops.