Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Body

application/json
session_id
string
required

ID of the Loops session this run belongs to.

base_model
string
required

Base model ID (e.g. 'Qwen/Qwen3-8B').

name
string | null

Optional display name for the run. Defaults to the base model name when omitted.

Required string length: 1 - 255
max_seq_len
integer | null

Maximum prompt length (in tokens) the run must handle. Set this to the longest training example you plan to send. Defaults to the maximum supported by the model configuration.

lora_rank
integer
default:64

LoRA rank.

Required range: x >= 1
seed
integer | null

Random seed for reproducibility.

scale_down_delay_seconds
integer
default:900

Seconds of inactivity before the run scales to zero. Must be between 1 and 3600 (1 hour). Defaults to 900 (15 minutes).

Required range: x <= 3600
availability_model
enum<string>
default:standard

Capacity the trainer runs on. 'standard' is not preempted. 'spot' runs below inference and reaches idle reserved capacity, but the run is stopped if its GPUs are reclaimed and cannot be resumed.

Available options:
standard,
spot
Example:

"spot"

replicas
integer
default:1

Number of data-parallel trainer replicas. Each replica is one full copy of the model's preset node group, so the trainer deployment runs (preset node_count * replicas) nodes (e.g. replicas=4 on a 4-node preset → 16 nodes, 4 DP workers). Must be a positive integer. Defaults to 1.

Required range: x >= 1
path
string | null

Optional bt:// URI of an existing checkpoint to load weights from on startup. Form: bt://loops:<run_id>/weights/<checkpoint_name>.

Example:

"bt://loops:k4q95w5/weights/step-100"

reuse_from_run_id
string | null

Optional ID of a prior Loops run whose trainer and/or sampler should be reused for this run instead of provisioning fresh. The prior run must use the same base model and belong to the same team.

reuse_from_session_id
string | null

Optional ID of a prior Loops session whose trainer and/or sampler should be reused for this run. Deprecated in favor of reuse_from_run_id.

base_checkpoint
string | null

Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf:///[@]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://@<job_id>/, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.

base_checkpoint_auth
TrainingWeightAuthV1 · object | null

Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.

Example:
scope
enum<string>
default:default

Choose where this runs. 'default' lets Baseten choose. 'serverless' runs on Baseten's shared capacity, and fails instead of falling back when shared capacity can't serve the request. 'dedicated' gives it its own deployment, which you size and pay for.

Available options:
default,
serverless,
dedicated

Response

200 - application/json
run
LoopsRunV1 · object
required