Deploy Aligned Model
curl --request POST \
--url https://api.nugen.in/api/v3/models/{model_id}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nugen.in/api/v3/models/{model_id}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nugen.in/api/v3/models/{model_id}/deployment', 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.nugen.in/api/v3/models/{model_id}/deployment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nugen.in/api/v3/models/{model_id}/deployment"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.nugen.in/api/v3/models/{model_id}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/models/{model_id}/deployment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"model_id": "alignment_01k4x9m2p7q3r8c1"
}{
"detail": {
"model_id": "model_01kmqm4nrn9fw6r",
"message": "Model is already deployed. Please undeploy first."
}
}{
"detail": {
"model_id": "model_01kmqm4nrn9fw6r",
"message": "Model not found"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Models
Deploy Aligned Model
Deploy an aligned model for inference use.
This endpoint deploys a domain-aligned model, making it available for inference.
Path Parameters:
model_id: Unique identifier of the aligned model to deploy
Returns:
model_id: The aligned model being deployed
Raises:
400: If the model is already deployed, or all 10 deployment slots of your organisation are in use; undeploy a model first404: If the model or its alignment project is not found409: If the model is still in train-time alignment; passearly=trueto deploy its newest checkpoint
Example Request:
POST /api/v3/models/{model_id}/deployment
Headers: {"Authorization": "Bearer <api_key>"}
Example Response:
{"model_id": "model_01kmqm4nrn9fw6r"}
Notes:
- Deployment is asynchronous and may take 5-15 minutes to complete
- Poll
GET /api/v3/models/{model_id}/deployment/status; onFAILEDthe failure reason is inresult.error - Once deployed, the model will be available at its inference endpoint
- Model must be in
UNDEPLOYEDstate before deployment
POST
/
api
/
v3
/
models
/
{model_id}
/
deployment
Deploy Aligned Model
curl --request POST \
--url https://api.nugen.in/api/v3/models/{model_id}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nugen.in/api/v3/models/{model_id}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nugen.in/api/v3/models/{model_id}/deployment', 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.nugen.in/api/v3/models/{model_id}/deployment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nugen.in/api/v3/models/{model_id}/deployment"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.nugen.in/api/v3/models/{model_id}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/models/{model_id}/deployment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"model_id": "alignment_01k4x9m2p7q3r8c1"
}{
"detail": {
"model_id": "model_01kmqm4nrn9fw6r",
"message": "Model is already deployed. Please undeploy first."
}
}{
"detail": {
"model_id": "model_01kmqm4nrn9fw6r",
"message": "Model not found"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Deploy the newest checkpoint of a run still in train-time alignment. The inference GPU serves the latest checkpoint it has written and refreshes on its own, so answers change as train-time alignment continues. Evaluation is unaffected and still runs on the finished model.
Response
Successfully initiated model deployment
Model ID of the aligned model being deployed
Example:
"alignment_01k4x9m2p7q3r8c1-deployed"
Was this page helpful?