Submit an ordered sample or logprobs primitive.
curl --request POST \
--url http://localhost:3001/v1/training/samplers/{sampler_id}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"seq_id": 2,
"idempotency_key": "<string>",
"request_hash": "<string>",
"payload": {
"prompt": {
"token_ids": [
1
]
},
"parameters": {
"max_tokens": 2048,
"temperature": 1,
"top_p": 0.5,
"top_k": 0,
"min_p": 0,
"seed": 1,
"stop_token_ids": []
},
"num_samples": 32,
"include_prompt_logprobs": false,
"topk_prompt_logprobs": 0,
"required_weight_version": 1
}
}
'import requests
url = "http://localhost:3001/v1/training/samplers/{sampler_id}/operations"
payload = {
"seq_id": 2,
"idempotency_key": "<string>",
"request_hash": "<string>",
"payload": {
"prompt": { "token_ids": [1] },
"parameters": {
"max_tokens": 2048,
"temperature": 1,
"top_p": 0.5,
"top_k": 0,
"min_p": 0,
"seed": 1,
"stop_token_ids": []
},
"num_samples": 32,
"include_prompt_logprobs": False,
"topk_prompt_logprobs": 0,
"required_weight_version": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
seq_id: 2,
idempotency_key: '<string>',
request_hash: '<string>',
payload: {
prompt: {token_ids: [1]},
parameters: {
max_tokens: 2048,
temperature: 1,
top_p: 0.5,
top_k: 0,
min_p: 0,
seed: 1,
stop_token_ids: []
},
num_samples: 32,
include_prompt_logprobs: false,
topk_prompt_logprobs: 0,
required_weight_version: 1
}
})
};
fetch('http://localhost:3001/v1/training/samplers/{sampler_id}/operations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"session_id": "<string>",
"run_id": "<string>",
"seq_id": 2,
"kind": "forward",
"status": "parked",
"result": {},
"error_code": "<string>",
"progress": {},
"progress_updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>",
"funding_source": "platform"
}unified-training
Submit an ordered sample or logprobs primitive.
Token IDs and sampling parameters use strict typed JSON.
POST
/
v1
/
training
/
samplers
/
{sampler_id}
/
operations
Submit an ordered sample or logprobs primitive.
curl --request POST \
--url http://localhost:3001/v1/training/samplers/{sampler_id}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"seq_id": 2,
"idempotency_key": "<string>",
"request_hash": "<string>",
"payload": {
"prompt": {
"token_ids": [
1
]
},
"parameters": {
"max_tokens": 2048,
"temperature": 1,
"top_p": 0.5,
"top_k": 0,
"min_p": 0,
"seed": 1,
"stop_token_ids": []
},
"num_samples": 32,
"include_prompt_logprobs": false,
"topk_prompt_logprobs": 0,
"required_weight_version": 1
}
}
'import requests
url = "http://localhost:3001/v1/training/samplers/{sampler_id}/operations"
payload = {
"seq_id": 2,
"idempotency_key": "<string>",
"request_hash": "<string>",
"payload": {
"prompt": { "token_ids": [1] },
"parameters": {
"max_tokens": 2048,
"temperature": 1,
"top_p": 0.5,
"top_k": 0,
"min_p": 0,
"seed": 1,
"stop_token_ids": []
},
"num_samples": 32,
"include_prompt_logprobs": False,
"topk_prompt_logprobs": 0,
"required_weight_version": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
seq_id: 2,
idempotency_key: '<string>',
request_hash: '<string>',
payload: {
prompt: {token_ids: [1]},
parameters: {
max_tokens: 2048,
temperature: 1,
top_p: 0.5,
top_k: 0,
min_p: 0,
seed: 1,
stop_token_ids: []
},
num_samples: 32,
include_prompt_logprobs: false,
topk_prompt_logprobs: 0,
required_weight_version: 1
}
})
};
fetch('http://localhost:3001/v1/training/samplers/{sampler_id}/operations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"session_id": "<string>",
"run_id": "<string>",
"seq_id": 2,
"kind": "forward",
"status": "parked",
"result": {},
"error_code": "<string>",
"progress": {},
"progress_updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>",
"funding_source": "platform"
}Authorizations
Whitney-issued API key. No organization-selection header is accepted.
Path Parameters
Pattern:
^wtsm_[0-9a-f]{32}$Body
application/json
Response
Durable operation handle.
Pattern:
^wto_[0-9a-f]{32}$Pattern:
^wts_[0-9a-f]{32}$Pattern:
^wtr_[0-9a-f]{32}$Required range:
x >= 1Available options:
forward, forward_backward, optim_step, save_state, load_state, save_weights_for_sampler, export_lora, sample, logprobs, finish, cancel Available options:
parked, pending, executing, succeeded, failed, cancelled 