Scale endpoint to zero [WRITE]
Changed onScale the endpoint down to zero replicas and mark it as Stopped. The endpoint's spec must have scale-to-zero enabled (scaling.scaleToZeroTimeout set); otherwise the call returns 400 "workload cannot be scaled to zero". Not valid when the workload is in the Deleting stage. Use POST /resume to wake the endpoint back up.
Request
- Base URLhttps://api.endpoints.huggingface.cloud (the document declares no server; this is the origin it was published from)
- URLhttps://api.endpoints.huggingface.cloud/v2/endpoint/{namespace}/{name}/scale-to-zero
- AuthHTTP bearer
Path parameters
User or organization name
Endpoint name
Response
Endpoint scaled to zero successfully
Example response
{
"compute": {
"instanceSize": "x1",
"instanceType": "intel-spr",
"scaling": {
"maxReplica": 4,
"measure": {
"hardwareUsage": 80
},
"minReplica": 1,
"scaleToZeroTimeout": 15,
"schedule": [
{
"at": "07:30",
"maxReplica": 4,
"minReplica": 1,
"scaleToZeroTimeout": 15
}
]
}
},
"model": {
"env": {
"MAX_CONCURRENT_REQUESTS": "128"
},
"image": {
"tgi": {
"healthRoute": "/health",
"port": 80,
"url": "https://host/image:tag",
"maxBatchPrefillTokens": 2048,
"maxBatchTotalTokens": 2048,
"maxInputLength": 1024,
"maxTotalTokens": 1512,
"disableCustomKernels": true
}
},
"repository": "meta-llama/Llama-2-7b-hf",
"revision": "main",
"secrets": {
"HF_TOKEN": "hf_xxx"
}
},
"name": "my-endpoint",
"network": {
"cidrList": [
"10.0.0.0/8"
]
},
"privateService": {
"accountId": "123456789012"
},
"provider": {
"region": "us-east-1",
"vendor": "aws"
},
"route": {
"domain": "api.example.com",
"path": "/v1/models/gpt2"
},
"status": {
"readyReplica": 2,
"targetReplica": 4,
"url": "https://68a0f3b5c6ee5c9dcc0e0a01.endpoints.huggingface.cloud"
}
}Changes
- breaking
added
subschema #2subschema #3subschema #4subschema #5subschema #6subschema #7subschema #8subschema #10to the/response propertyoneOflist for the response status - info
added the optional property
//to the response with the status - info
removed
subschema #2subschema #3subschema #4subschema #5subschema #6subschema #7subschema #8subschema #10from the/response propertyoneOflist for the response status
- breaking
- breaking
added
subschema #3to the//////response propertyoneOflist for the response status
- breaking