job_id. A Tinker TrainingClient represents the same job.
The control loop
1
Create the interactive job
A native client calls
POST /v1/training/jobs/create-model
with base_model, or with from_checkpoint and load_optimizer. A Tinker
client calls create_lora_training_client(...). Native clients send no
seq_id and no heartbeat.2
Checkpoint weights for sampling
Call
POST /v1/training/jobs/{job_id}/save-weights-for-sampler with a
name, then wait for its save future to complete. Only then sample from that
checkpoint so each rollout is tied to a durable artifact of the same job.3
Collect rollout groups
Sample several candidate responses for each prompt with
POST /v1/training/jobs/{job_id}/sample, naming that checkpoint.
Your application owns prompt construction, tokenization, and grouping.4
Compute rewards and advantages
Score each response, then turn rewards into the advantages your loss
function needs.
5
Build training datums
Combine prompt and response tokens with per-position targets, weights, log
probabilities, or advantages.
6
Update the same job
Send
POST /v1/training/jobs/{job_id}/forward-backward and wait for it to
complete successfully. Only then send
POST /v1/training/jobs/{job_id}/optim-step.7
Save a recovery boundary
Save the state with
POST /v1/training/jobs/{job_id}/save-weights, wait for
the save future to complete, and then persist its path with the application
step and dataset cursor before you begin the next iteration.Routes
The SDK model ID is the canonical Fastino job ID. Futures and sampling clients
do not create independent runs.
To turn deterministic grading into group-relative advantages, follow
Train with verifiable rewards.
Build aligned datums
A datum holds N input tokens and N-value tensors inloss_fn_inputs. Tokenize
with the base model’s Hugging Face tokenizer
(transformers.AutoTokenizer.from_pretrained(base_model)), and use the same
tokenizer to decode samples. When calling apply_chat_template, pass
enable_thinking=False so the answer starts after a closed reasoning block.
This is a tokenizer template argument, not a Training API request field.
For a prompt followed by a completion:
model_inputis every token except the last.target_tokensis every token except the first.weightsis0on prompt positions and1on completion positions.logprobsare the sampler’s log probabilities of the completion tokens, and0on prompt positions.advantageshold the completion’s advantage on completion positions, and0on prompt positions.
forward_backward_custom helper can compute a custom loss in your process and
translate it into supported model operations; your Python loss code does not
execute on Fastino. Any forward and forward-backward operations the helper
issues are billed normally.
Keep dependent work ordered
Wait for a forward-backward future to complete successfully before submitting its optimizer step. This prevents a prequeued optimizer step from running after forward-backward fails or is cancelled. Wait for the optimizer step to complete before saving the updated state. Native JSON clients callforward-backward
and optim-step. Each
queueing response contains a future_id. Poll
get-future until
the status is completed, failed, or cancelled; one wait=true request can
return before completion.
Tinker clients track each future returned by a supported call and resolve
futures individually. Only sample futures can be cancelled on either
interface. Batch retrieval through retrieve_futures is not supported.
Recover the loop
Persist the job ID, the application step, the dataset cursor, and the latest checkpoint path. A restarted controller can then tell which work completed without replaying an update. Future results remain available for one hour. Within that window, poll the knownfuture_id to resolve uncertain work. A 410 means the result is no
longer recoverable; do not blindly replay the operation. For long-term
recovery, use only a completed checkpoint whose path was written to your
durable application record after its save future completed.
For the recovery sequence and checkpoint kinds, follow
Checkpoints and recovery.
One controller updates one job during its lifetime. A native client can create
from a checkpoint, and a Tinker client can create from saved state. Both paths
start a new interactive job seeded from the source checkpoint, so persist both
job IDs as application-owned lineage.
