import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
model_server_info = client.model_servers.create(
model_deployment_id="model_deployment_id",
name="name",
)
print(model_server_info.account_id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
modelServerInfo, err := client.ModelServers.New(context.TODO(), sgp.ModelServerNewParams{
ModelDeploymentID: sgp.F("model_deployment_id"),
Name: sgp.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", modelServerInfo.AccountID)
}
curl --request POST \
--url https://api.egp.scale.com/v4/serving \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', model_deployment_id: '<string>', alias: '<string>'})
};
fetch('https://api.egp.scale.com/v4/serving', 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.egp.scale.com/v4/serving",
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([
'name' => '<string>',
'model_deployment_id' => '<string>',
'alias' => '<string>'
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/serving")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model_deployment_id\": \"<string>\",\n \"alias\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/serving")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"model_deployment_id\": \"<string>\",\n \"alias\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"model_server_id": "<string>",
"account_id": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create a new Model Server
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
model_server_info = client.model_servers.create(
model_deployment_id="model_deployment_id",
name="name",
)
print(model_server_info.account_id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
modelServerInfo, err := client.ModelServers.New(context.TODO(), sgp.ModelServerNewParams{
ModelDeploymentID: sgp.F("model_deployment_id"),
Name: sgp.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", modelServerInfo.AccountID)
}
curl --request POST \
--url https://api.egp.scale.com/v4/serving \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', model_deployment_id: '<string>', alias: '<string>'})
};
fetch('https://api.egp.scale.com/v4/serving', 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.egp.scale.com/v4/serving",
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([
'name' => '<string>',
'model_deployment_id' => '<string>',
'alias' => '<string>'
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/serving")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model_deployment_id\": \"<string>\",\n \"alias\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/serving")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"model_deployment_id\": \"<string>\",\n \"alias\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"model_server_id": "<string>",
"account_id": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Create a new model server with an initial backend configuration.
Args: name (str): The name of the model server. Only used for display purposes. model_deployment_id (str): The ID of the model deployment to use as the initial backend. alias (str, optional): An alias for the model server. Defaults to None. If configured the model server can be accessed via the alias instead of the model server ID. i.e /models/server/alias/{alias}/execute
Response
Successful Response
Model server information. name: The name of the model server. Only used for display purposes. model_server_id: The ID of the model server. model_deployment_id: The ID of the model deployment being used as the backend. account_id: The ID of the account that owns the model server. alias: An alias for the model server. If configured the model server can be accessed via the alias instead of the model server ID. i.e /models/server/alias/{alias}/execute

