starforge-core installed.
Install
Already present in every catalog image. For a custom image:The design constraints, because they change how you use it
Never raises
Reporting is a side channel. If collection breaks, your training keeps running. You do not need
to wrap calls in
try.No-op without credentials
Running the same script on your laptop does nothing and makes no network calls, so there is no
separate “local mode” branch to maintain.
Imports anywhere
Standard library only. It will not fail to import because an image is missing
requests.init()
False on a laptop, and
that is not an error. Idempotent: calling it twice is safe, and passing hparams the second time
adds them.
Mapping
Hyperparameters for the console’s Config panel. Nested dictionaries are flattened with dots, so
{"policy": {"lr": 1e-6}} becomes policy.lr.bool
default:"True"
Starts a background thread that samples GPU utilisation, memory and network for the System tab.
Set
False if something else in your job already reports hardware.float
default:"10"
Seconds between hardware samples.
STARFORGE_MONITOR_INTERVAL overrides the default.log()
step increments
an internal counter, which is what you want in a reward function that has no notion of a global step.
log_hparams() and finish()
log_hparams adds to the Config panel after init. finish stops hardware collection and flushes
the buffer; it is idempotent and also registered with atexit, so a script that exits normally does
not strictly need to call it. Call it anyway — a process killed before atexit runs loses whatever
is still buffered.
Hugging Face and TRL
init, per-log-step log, and finish on the Trainer’s own lifecycle. Works with any
transformers.Trainer and every TRL trainer built on it.
transformers.TrainerCallback — Hugging Face dispatches callbacks by method
name, so duck typing is enough, and not subclassing keeps starforge.report importable in an image
with no transformers.
Confirm it worked
Submit the job and open its Charts tab. A point appears within a few seconds of your firstlog().
If the logs are moving and the charts stay empty, the reporting call is not running. Check inside
the container:
1 and there are still no points, init() was never reached — put a print next to it
and resubmit.
The rest of the SDK
starforge.report is the public surface. The package also exports the JobSpec contract types
(JobSpec, Recipe, ResourceSpec, …) and Reporter, the low-level client the platform’s own
framework bridges use. Those are documented as
the ingest contract and JobSpec; reach for them
when writing a framework adapter, not when instrumenting a training script.