Queue a candidate run in the agent's own cluster: start the candidate, measure it against the current setup with AIPerf, run the answer check, and remove it
POST
/
api
/
v1
/
agents
/
{id}
/
candidate-runs
Queue a candidate run in the agent's own cluster: start the candidate, measure it against the current setup with AIPerf, run the answer check, and remove it
curl --request POST \
--url http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": true,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": [
"<string>"
],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": true
},
"runtime_args": [
"<string>"
],
"timeout_seconds": 10830
}
'import requests
url = "http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs"
payload = {
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": True,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": ["<string>"],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": True
},
"runtime_args": ["<string>"],
"timeout_seconds": 10830
}
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({
accelerator: '<string>',
endpoint: '<string>',
gpu_count: 8,
label: '<string>',
load: {
concurrency: 128,
input_tokens: 16384,
output_tokens: 16384,
requests: 2500,
streaming: true,
tokenizer: '<string>'
},
model: '<string>',
workload: {
cancellation: 'http-disconnect',
command: ['<string>'],
drain: 'connection',
image: '<string>',
metrics_path: '/metrics',
models_path: '/v1/models',
port: 32768,
protocol: 'openai',
readiness_path: '/health',
shutdown_grace_seconds: 1800
},
model_revision: '<string>',
quality: {eval_set: '<string>', skip: true},
runtime_args: ['<string>'],
timeout_seconds: 10830
})
};
fetch('http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs"
payload := strings.NewReader("{\n \"accelerator\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"gpu_count\": 8,\n \"label\": \"<string>\",\n \"load\": {\n \"concurrency\": 128,\n \"input_tokens\": 16384,\n \"output_tokens\": 16384,\n \"requests\": 2500,\n \"streaming\": true,\n \"tokenizer\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"workload\": {\n \"cancellation\": \"http-disconnect\",\n \"command\": [\n \"<string>\"\n ],\n \"drain\": \"connection\",\n \"image\": \"<string>\",\n \"metrics_path\": \"/metrics\",\n \"models_path\": \"/v1/models\",\n \"port\": 32768,\n \"protocol\": \"openai\",\n \"readiness_path\": \"/health\",\n \"shutdown_grace_seconds\": 1800\n },\n \"model_revision\": \"<string>\",\n \"quality\": {\n \"eval_set\": \"<string>\",\n \"skip\": true\n },\n \"runtime_args\": [\n \"<string>\"\n ],\n \"timeout_seconds\": 10830\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"candidate_run": {
"agent": "<string>",
"agent_id": "<string>",
"control": {},
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"result": {
"candidate": {},
"cleaned_up": true,
"control": {},
"control_after": {},
"image_digest": "<string>",
"noise": 123,
"quality": {},
"ready_seconds": 123
},
"spec": {
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": true,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": [
"<string>"
],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": true
},
"runtime_args": [
"<string>"
],
"timeout_seconds": 10830
},
"state": "queued",
"attempts": 123,
"created_by": "<string>",
"deadline_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"failure_detail": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"phase": "<string>",
"runs_in": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"category": "<string>",
"remediation": "<string>",
"request_id": "<string>",
"retryable": true
}
}Authorizations
Body
application/json
A candidate setup to try in the agent's own cluster. The image must be pinned by digest and allowed by the agent's operator; the entry point cannot be a shell.
⌘I
Queue a candidate run in the agent's own cluster: start the candidate, measure it against the current setup with AIPerf, run the answer check, and remove it
curl --request POST \
--url http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": true,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": [
"<string>"
],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": true
},
"runtime_args": [
"<string>"
],
"timeout_seconds": 10830
}
'import requests
url = "http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs"
payload = {
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": True,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": ["<string>"],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": True
},
"runtime_args": ["<string>"],
"timeout_seconds": 10830
}
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({
accelerator: '<string>',
endpoint: '<string>',
gpu_count: 8,
label: '<string>',
load: {
concurrency: 128,
input_tokens: 16384,
output_tokens: 16384,
requests: 2500,
streaming: true,
tokenizer: '<string>'
},
model: '<string>',
workload: {
cancellation: 'http-disconnect',
command: ['<string>'],
drain: 'connection',
image: '<string>',
metrics_path: '/metrics',
models_path: '/v1/models',
port: 32768,
protocol: 'openai',
readiness_path: '/health',
shutdown_grace_seconds: 1800
},
model_revision: '<string>',
quality: {eval_set: '<string>', skip: true},
runtime_args: ['<string>'],
timeout_seconds: 10830
})
};
fetch('http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:18000/api/v1/agents/{id}/candidate-runs"
payload := strings.NewReader("{\n \"accelerator\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"gpu_count\": 8,\n \"label\": \"<string>\",\n \"load\": {\n \"concurrency\": 128,\n \"input_tokens\": 16384,\n \"output_tokens\": 16384,\n \"requests\": 2500,\n \"streaming\": true,\n \"tokenizer\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"workload\": {\n \"cancellation\": \"http-disconnect\",\n \"command\": [\n \"<string>\"\n ],\n \"drain\": \"connection\",\n \"image\": \"<string>\",\n \"metrics_path\": \"/metrics\",\n \"models_path\": \"/v1/models\",\n \"port\": 32768,\n \"protocol\": \"openai\",\n \"readiness_path\": \"/health\",\n \"shutdown_grace_seconds\": 1800\n },\n \"model_revision\": \"<string>\",\n \"quality\": {\n \"eval_set\": \"<string>\",\n \"skip\": true\n },\n \"runtime_args\": [\n \"<string>\"\n ],\n \"timeout_seconds\": 10830\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"candidate_run": {
"agent": "<string>",
"agent_id": "<string>",
"control": {},
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"result": {
"candidate": {},
"cleaned_up": true,
"control": {},
"control_after": {},
"image_digest": "<string>",
"noise": 123,
"quality": {},
"ready_seconds": 123
},
"spec": {
"accelerator": "<string>",
"endpoint": "<string>",
"gpu_count": 8,
"label": "<string>",
"load": {
"concurrency": 128,
"input_tokens": 16384,
"output_tokens": 16384,
"requests": 2500,
"streaming": true,
"tokenizer": "<string>"
},
"model": "<string>",
"workload": {
"cancellation": "http-disconnect",
"command": [
"<string>"
],
"drain": "connection",
"image": "<string>",
"metrics_path": "/metrics",
"models_path": "/v1/models",
"port": 32768,
"protocol": "openai",
"readiness_path": "/health",
"shutdown_grace_seconds": 1800
},
"model_revision": "<string>",
"quality": {
"eval_set": "<string>",
"skip": true
},
"runtime_args": [
"<string>"
],
"timeout_seconds": 10830
},
"state": "queued",
"attempts": 123,
"created_by": "<string>",
"deadline_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"failure_detail": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"phase": "<string>",
"runs_in": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"category": "<string>",
"remediation": "<string>",
"request_id": "<string>",
"retryable": true
}
}