curl --request POST \
--url https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy \
--header 'Content-Type: application/json' \
--header 'X-Maitai-Api-Key: <api-key>' \
--data '
{
"model_name": "support-sft-v1",
"promote_existing": false
}
'import requests
url = "https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy"
payload = {
"model_name": "support-sft-v1",
"promote_existing": False
}
headers = {
"X-Maitai-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Maitai-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model_name: 'support-sft-v1', promote_existing: false})
};
fetch('https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/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.trymaitai.ai/api/v1/finetune-runs/{run_id}/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([
'model_name' => 'support-sft-v1',
'promote_existing' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Maitai-Api-Key: <api-key>"
],
]);
$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.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy"
payload := strings.NewReader("{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Maitai-Api-Key", "<api-key>")
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.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy")
.header("X-Maitai-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Maitai-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 61,
"status": "COMPLETED",
"meta": {
"model_deployment_status": "SCHEDULED"
}
}
}Deploy finetune run
Deploy a completed finetune run as a hosted model.
Promotes the finetune into a servable model addressed by model_name: - a new model_name publishes the finetune as a new model; - an existing model’s model_name with promote_existing: true swaps that model’s underlying finetune to this run while keeping the same model reference (so callers targeting that model name pick up the new weights).
Deployment is asynchronous: this returns immediately with the run in a SCHEDULED deployment state, poll GET /finetune-runs/{run_id}/status until phase reaches deployed (or deploy_failed/deploy_cancelled). Once deployed, run a test set against it by creating a test run whose config.model is this model_name. Hosted-model deployment is billed, so an account over its plan limit or with billing blocked returns 402.
curl --request POST \
--url https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy \
--header 'Content-Type: application/json' \
--header 'X-Maitai-Api-Key: <api-key>' \
--data '
{
"model_name": "support-sft-v1",
"promote_existing": false
}
'import requests
url = "https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy"
payload = {
"model_name": "support-sft-v1",
"promote_existing": False
}
headers = {
"X-Maitai-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Maitai-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model_name: 'support-sft-v1', promote_existing: false})
};
fetch('https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/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.trymaitai.ai/api/v1/finetune-runs/{run_id}/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([
'model_name' => 'support-sft-v1',
'promote_existing' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Maitai-Api-Key: <api-key>"
],
]);
$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.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy"
payload := strings.NewReader("{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Maitai-Api-Key", "<api-key>")
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.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy")
.header("X-Maitai-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trymaitai.ai/api/v1/finetune-runs/{run_id}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Maitai-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_name\": \"support-sft-v1\",\n \"promote_existing\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 61,
"status": "COMPLETED",
"meta": {
"model_deployment_status": "SCHEDULED"
}
}
}Authorizations
Your Maitai API key from the Portal.
Path Parameters
Body
Response
Deploy finetune run.
A model finetuning job that trains a new model on a dataset.
Show child attributes
Show child attributes
Was this page helpful?