Create External Eval
curl --request POST \
--url https://{host}/api/benchmarks/external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"harness": "",
"train_run_id": "",
"note": ""
}
'import requests
url = "https://{host}/api/benchmarks/external"
payload = {
"model": "<string>",
"harness": "",
"train_run_id": "",
"note": ""
}
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({model: '<string>', harness: '', train_run_id: '', note: ''})
};
fetch('https://{host}/api/benchmarks/external', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/benchmarks/external",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'harness' => '',
'train_run_id' => '',
'note' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/benchmarks/external"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/benchmarks/external")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/benchmarks/external")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create External Eval
开一次外部评测 run,拿回 run_id 与只能上报分数的 ingest token。
用在平台跑不了、也不该跑的评测上 —— 典型是 CVDP 的 agent 轨:它为每道题拉一个 Docker 容器,而平台作业本身就在容器里。那条评测在评测机上跑,模型走平台的部署 端点,分数回到这里。
token 的 scope 只有 benchmark:它会被贴进外部机器的环境变量,不该顺带能写日志、 改作业状态、传产物。
POST
/
api
/
benchmarks
/
external
Create External Eval
curl --request POST \
--url https://{host}/api/benchmarks/external \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"harness": "",
"train_run_id": "",
"note": ""
}
'import requests
url = "https://{host}/api/benchmarks/external"
payload = {
"model": "<string>",
"harness": "",
"train_run_id": "",
"note": ""
}
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({model: '<string>', harness: '', train_run_id: '', note: ''})
};
fetch('https://{host}/api/benchmarks/external', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/benchmarks/external",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'harness' => '',
'train_run_id' => '',
'note' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/benchmarks/external"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/benchmarks/external")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/benchmarks/external")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"harness\": \"\",\n \"train_run_id\": \"\",\n \"note\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
响应
Successful Response