Checkpoints
Deploy checkpoints
Creates an inference deployment from one or more Loops sampler checkpoints.
POST
/
v1
/
loops
/
checkpoints
/
deploy
cURL
curl --request POST \
--url https://api.baseten.co/v1/loops/checkpoints/deploy \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"checkpoint_ids": null,
"model_name": null,
"instance_type_id": null,
"hf_secret_name": null
}'import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/loops/checkpoints/deploy"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"POST",
url,
headers=headers,
json={'checkpoint_ids': None, 'model_name': None, 'instance_type_id': None, 'hf_secret_name': None}
)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
checkpoint_ids: ['<string>'],
model_name: '<string>',
instance_type_id: '<string>',
hf_secret_name: '<string>'
})
};
fetch('https://api.baseten.co/v1/loops/checkpoints/deploy', 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://api.baseten.co/v1/loops/checkpoints/deploy",
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([
'checkpoint_ids' => [
'<string>'
],
'model_name' => '<string>',
'instance_type_id' => '<string>',
'hf_secret_name' => '<string>'
]),
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://api.baseten.co/v1/loops/checkpoints/deploy"
payload := strings.NewReader("{\n \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\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://api.baseten.co/v1/loops/checkpoints/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/loops/checkpoints/deploy")
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 \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"model_id": "<string>",
"deployment_id": "<string>"
}Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Body
application/json
Sampler checkpoint IDs to deploy together.
Minimum array length:
1Name for the created model.
Minimum string length:
1Instance type ID for the deployment.
Name of the team-scoped secret that supplies HF_TOKEN.
Minimum string length:
1Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api.baseten.co/v1/loops/checkpoints/deploy \
--header "Authorization: Bearer $BASETEN_API_KEY" \
--data '{
"checkpoint_ids": null,
"model_name": null,
"instance_type_id": null,
"hf_secret_name": null
}'import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/loops/checkpoints/deploy"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"POST",
url,
headers=headers,
json={'checkpoint_ids': None, 'model_name': None, 'instance_type_id': None, 'hf_secret_name': None}
)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
checkpoint_ids: ['<string>'],
model_name: '<string>',
instance_type_id: '<string>',
hf_secret_name: '<string>'
})
};
fetch('https://api.baseten.co/v1/loops/checkpoints/deploy', 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://api.baseten.co/v1/loops/checkpoints/deploy",
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([
'checkpoint_ids' => [
'<string>'
],
'model_name' => '<string>',
'instance_type_id' => '<string>',
'hf_secret_name' => '<string>'
]),
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://api.baseten.co/v1/loops/checkpoints/deploy"
payload := strings.NewReader("{\n \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\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://api.baseten.co/v1/loops/checkpoints/deploy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/loops/checkpoints/deploy")
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 \"checkpoint_ids\": [\n \"<string>\"\n ],\n \"model_name\": \"<string>\",\n \"instance_type_id\": \"<string>\",\n \"hf_secret_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"model_id": "<string>",
"deployment_id": "<string>"
}