API docs

Architecture

How sessions, training runs, checkpoints and samplers fit together, and what each one costs to keep open.

The managed fine-tuning jobs API hides most of the machinery: you upload a dataset, submit a job and read back a result_model. The low-level training API exposes that machinery directly. Either way, the same four resources do the work, and knowing how they relate makes the reference pages much easier to navigate.

The resource hierarchy

session  sess_A1
├─ training run  run_3Bz           live GPU state: weights, optimizer, step count
│  ├─ checkpoint  (training)       resumable snapshot of the run
│  └─ checkpoint  (sampler)        servable weights
└─ sampler  sess_A1:sample:0       inference session

Sessions group everything opened together. You never create one directly: opening a training run or a sampler opens a session implicitly, and the create response carries its session_id. Retrieve a session returns every run and sampler opened under it, and assigning a session to a project moves the session and everything under it into a project in one call.

Training runs hold live GPU state. Create a training run allocates GPUs and loads the base model with a LoRA adapter of the requested rank (default 32). From then on the run carries the adapter weights, the optimizer state and the current step count, and every training route is keyed on its training_run_id. Each forward-backward pass and optimizer step mutates that state in place.

Checkpoints are snapshots written from a run with Create a checkpoint. One route, two products, selected by type. A training checkpoint captures what is needed to resume the run later: pass its path as from_path when creating a new run, or load it into a live run with Load state. A sampler checkpoint emits servable weights: its path is what Create a sampler and the compatibility routes accept as a model.

Samplers are inference sessions, opened against either a base_model or a model_path pointing at sampler weights. Once open, a sampler serves Generate samples and Compute prompt logprobs requests.

The nucleus:// path scheme

Weights live at stable, addressable paths. Every checkpoint has one, and it is the value you pass around whenever a route asks for a model that is not a base model.

nucleus://run_3Bz:train:0/sampler_weights/000240
          │       │     │ │               │
          │       │     │ │               └─ step number
          │       │     │ └─ weight kind
          │       │     └─ service index
          │       └─ service
          └─ training run ID
SegmentMeaning
run_3BzThe training run that wrote the weights.
train:0The service that produced them and its index. Sessions can hold several services; each gets its own counter, which is why sampler IDs look like sess_A1:sample:0.
sampler_weightsThe kind of weights at this path. Sampler checkpoints are written under sampler_weights and are the only kind a sampler can load.
000240The training step at which the snapshot was taken, zero-padded.

Paths appear throughout the API:

Lifecycle and cost

Runs and samplers hold GPU allocations from the moment they are created until you close them. Checkpoints hold storage until they expire or are deleted. Nothing is released implicitly, so the shape of a well-behaved workload is: open a run, train, write a sampler checkpoint, close the run, and serve from a sampler you close when traffic stops.

ResourceCreated byReleased by
Training runCreate a training runClose a training run
SamplerCreate a samplerClose a sampler
CheckpointCreate a checkpointttl_seconds expiry, or Delete a checkpoint
SessionImplicitly, with the first run or sampler opened under itNothing to release: a session holds no GPUs or storage of its own

Set ttl_seconds when you write a checkpoint to have it cleaned up automatically, or leave it null to keep the checkpoint until you delete it. You can change your mind later with Update checkpoint expiry.

Creating runs and writing checkpoints allocate real resource, so those POST routes accept an Idempotency-Key header; closing and deleting are plain DELETE calls and are always safe to retry. See Errors and retries.

Architecture | Nucleus AI API