All Whitney v1 requests use application/json. Training data is expressed as
token ID arrays and dense tensors; you do not need generated protocol code or a
provider SDK.
Forward and backward
Submit this payload as the payload of a forward or forward_backward
operation:
Tensor values are dense and row-major. Their count must equal the product of
shape. Cross-entropy targets must be int64; optional weights must be
float32; both tensors must match the input length.
GRPO’s importance_sampling payload
RL loops align four tensors instead of two — shifted target_tokens,
prompt-masked weights, the rollout-policy logprobs returned by sample(),
and per-token advantages — all the same length as input.token_ids.
Positions inside the prompt carry zero weight, zero logprob, and zero
advantage; only completion positions carry real values:
Here the model saw a 3-token prompt and a 2-token completion; input and
target_tokens both cover the shifted 4-token window (the completion’s last
token only ever appears as a target). The first two positions are
prompt-masked to zero; the last two carry the sampler’s own logprobs and a
single scalar advantage broadcast across the completion. Building this by
hand for every algorithm variant is exactly what
examples/training/http/whitney_datums.py’s
rl_datum() does — see GRPO for the full loop.
Sample
Use the same payload for run-scoped or explicit sampler-scoped sample.
required_weight_version prevents reading stale weights.
Full operation envelope
Every primitive is posted to /v1/training/runs/{run_id}/operations or, for
an existing sampler, /v1/training/samplers/{sampler_id}/operations:
The request hash is SHA-256 of canonical JSON containing surface and
payload; see the HTTP cookbook helper
for an executable implementation. On an ambiguous response, retry the exact
same sequence ID, idempotency key, hash, and body.
Never place token or tensor payloads in URLs, logs, documentation feedback, or durable operation metadata.