Serve Model
curl --request POST \
--url http://127.0.0.1:9321/api/models \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"gpus": 0,
"name": "<string>",
"backend": "<string>",
"max_model_len": 131200,
"gpu_memory_utilization": 0.525
}
'import requests
url = "http://127.0.0.1:9321/api/models"
payload = {
"model": "<string>",
"gpus": 0,
"name": "<string>",
"backend": "<string>",
"max_model_len": 131200,
"gpu_memory_utilization": 0.525
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
gpus: 0,
name: '<string>',
backend: '<string>',
max_model_len: 131200,
gpu_memory_utilization: 0.525
})
};
fetch('http://127.0.0.1:9321/api/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9321",
CURLOPT_URL => "http://127.0.0.1:9321/api/models",
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>',
'gpus' => 0,
'name' => '<string>',
'backend' => '<string>',
'max_model_len' => 131200,
'gpu_memory_utilization' => 0.525
]),
CURLOPT_HTTPHEADER => [
"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 := "http://127.0.0.1:9321/api/models"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://127.0.0.1:9321/api/models")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:9321/api/models")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"backend": "<string>",
"desired_state": "<string>",
"model_pulled": false,
"gpu_count": 0,
"gpu_ids": [
"<string>"
],
"gpu_utilization": {},
"endpoint": "<string>",
"max_model_len": 123,
"gpu_memory_utilization": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Models
Serve Model
Reference for merged 0.6.0 source. The latest verified binary release is 0.5.5; use your Engine’s /api/openapi.json for its installed contract.
Serve Model
curl --request POST \
--url http://127.0.0.1:9321/api/models \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"gpus": 0,
"name": "<string>",
"backend": "<string>",
"max_model_len": 131200,
"gpu_memory_utilization": 0.525
}
'import requests
url = "http://127.0.0.1:9321/api/models"
payload = {
"model": "<string>",
"gpus": 0,
"name": "<string>",
"backend": "<string>",
"max_model_len": 131200,
"gpu_memory_utilization": 0.525
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
gpus: 0,
name: '<string>',
backend: '<string>',
max_model_len: 131200,
gpu_memory_utilization: 0.525
})
};
fetch('http://127.0.0.1:9321/api/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9321",
CURLOPT_URL => "http://127.0.0.1:9321/api/models",
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>',
'gpus' => 0,
'name' => '<string>',
'backend' => '<string>',
'max_model_len' => 131200,
'gpu_memory_utilization' => 0.525
]),
CURLOPT_HTTPHEADER => [
"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 := "http://127.0.0.1:9321/api/models"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://127.0.0.1:9321/api/models")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:9321/api/models")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"gpus\": 0,\n \"name\": \"<string>\",\n \"backend\": \"<string>\",\n \"max_model_len\": 131200,\n \"gpu_memory_utilization\": 0.525\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"backend": "<string>",
"desired_state": "<string>",
"model_pulled": false,
"gpu_count": 0,
"gpu_ids": [
"<string>"
],
"gpu_utilization": {},
"endpoint": "<string>",
"max_model_len": 123,
"gpu_memory_utilization": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Minimum string length:
1Pattern:
^[\w.\-/]+(:[\w.\-]+)?$Required range:
x >= 0Pattern:
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$Required range:
256 <= x <= 262144Required range:
0.1 <= x <= 0.95Response
HTTP 201 response
Available options:
pending, scheduled, running, paused, completed, failed, cancelled, retrying, building, degraded, restarting, stopped Show child attributes
Show child attributes