Python
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
)
response = client.model_servers.update_backend(
model_server_id="model_server_id",
new_model_deployment_id="new_model_deployment_id",
)
print(response.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"),
)
response, err := client.ModelServers.UpdateBackend(
context.TODO(),
"model_server_id",
sgp.ModelServerUpdateBackendParams{
NewModelDeploymentID: sgp.F("new_model_deployment_id"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AccountID)
}curl --request PUT \
--url https://api.egp.scale.com/v4/serving/{model_server_id}/backend \
--header 'Content-Type: application/json' \
--data '
{
"new_model_deployment_id": "<string>"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_model_deployment_id: '<string>'})
};
fetch('https://api.egp.scale.com/v4/serving/{model_server_id}/backend', 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/{model_server_id}/backend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'new_model_deployment_id' => '<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.put("https://api.egp.scale.com/v4/serving/{model_server_id}/backend")
.header("Content-Type", "application/json")
.body("{\n \"new_model_deployment_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/serving/{model_server_id}/backend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_model_deployment_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"model_server_id": "<string>",
"account_id": "<string>",
"new_model_deployment_id": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>",
"old_model_deployment_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Model server
Change backend of the Model Server
PUT
/
v4
/
serving
/
{model_server_id}
/
backend
Python
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
)
response = client.model_servers.update_backend(
model_server_id="model_server_id",
new_model_deployment_id="new_model_deployment_id",
)
print(response.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"),
)
response, err := client.ModelServers.UpdateBackend(
context.TODO(),
"model_server_id",
sgp.ModelServerUpdateBackendParams{
NewModelDeploymentID: sgp.F("new_model_deployment_id"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AccountID)
}curl --request PUT \
--url https://api.egp.scale.com/v4/serving/{model_server_id}/backend \
--header 'Content-Type: application/json' \
--data '
{
"new_model_deployment_id": "<string>"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_model_deployment_id: '<string>'})
};
fetch('https://api.egp.scale.com/v4/serving/{model_server_id}/backend', 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/{model_server_id}/backend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'new_model_deployment_id' => '<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.put("https://api.egp.scale.com/v4/serving/{model_server_id}/backend")
.header("Content-Type", "application/json")
.body("{\n \"new_model_deployment_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/serving/{model_server_id}/backend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_model_deployment_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"model_server_id": "<string>",
"account_id": "<string>",
"new_model_deployment_id": "<string>",
"model_deployment_id": "<string>",
"alias": "<string>",
"old_model_deployment_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
application/json
Response
Successful Response
Point the model server to a new model deployment.
Args: old_model_deployment_id(str): The ID of the model deployment to use as the new backend.
⌘I

