Skip to main content
Service and Application/Inference Service APIs
PUTInference Service APIsSince 5.1.8SynchronousAuth Required

UpdateModelService

UpdateModelService

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    The resource UUID.

Body Fields

  • nameString

    Optional. The resource name.

  • descriptionString

    Optional. The detailed description of the resource.

  • yamlString

    Optional. The YAML configuration of the model service.

  • requestCpuInteger

    Optional. The required number of CPUs.

  • requestMemoryLong

    Optional. The required memory size.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    The result of updating the model service.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryModelServiceInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The resource description.

    • readmeStringRequired

      The README content.

    • yamlStringRequired

      The service YAML configuration.

    • requestCpuIntegerRequired

      The requested number of CPUs.

    • requestMemoryLongRequired

      The requested memory size.

    • modelCenterUuidStringRequired

      The model center UUID.

    • typeStringRequired

      The model service type.

    • frameworkStringRequired

      The model service framework.

    • sourceStringRequired

      The model service source.

    • sizeLongRequired

      The model service size.

    • systemBooleanRequired

      Whether the model service is a system model service.

    • hasNewVersionBooleanRequired

      Whether a new version is available.

    • gpuComputeCapabilityStringRequired

      The GPU compute capability requirement.

    • installPathStringRequired

      The model service installation path.

    • pythonVersionStringRequired

      The Python version.

    • condaVersionStringRequired

      The Conda version.

    • versionStringRequired

      The model service version.

    • startCommandStringRequired

      The startup command.

    • containerCommandStringRequired

      The container command.

    • containerArgsStringRequired

      The container arguments.

    • supportDistributedBooleanRequired

      Whether distributed deployment is supported.

    • cpuArchitecturesListRequired

      The supported CPU architectures.

    • vendorToSpecUuidsMapMapRequired

      The mapping between GPU vendors and specification UUIDs.

    • modelServiceRefsListRequired

      The bindings between models and the model service.

    • modelServiceImagesListRequired

      The model service image list.

    • createDateTimestampRequired

      The creation time.

    • lastOpDateTimestampRequired

      The last operation time.

Endpoint

PUT/zstack/v1/ai/model-services/{uuid}

/zstack/v1/ai/model-services/{uuid}

Operation ID

UpdateModelService

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/ai/model-services/{uuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"name":"<name>","description":"<description>","yaml":"<yaml>","requestCpu":1,"requestMemory":1,"gpuComputeCapability":"<gpuComputeCapability>","startCommand":"<startCommand>","pythonVersion":"<pythonVersion>","type":"<type>","framework":"<framework>","source":"<source>","architectureImages":["<architectureImages>"],"supportDistributed":true,"environmentParameters":{},"startupParameters":{},"inferenceParams":{},"serviceName":"<serviceName>","servicePorts":["<servicePorts>"],"serviceLivez":"<serviceLivez>","serviceReadyz":"<serviceReadyz>","serviceBootupTime":1,"serviceInstallPath":"<serviceInstallPath>","serviceStartCommand":"<serviceStartCommand>","containerCommand":"<containerCommand>","containerArgs":"<containerArgs>","vendorToSpecUuidsMap":{},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "6c1a5f6167944aa1886294842075279f", "name": "example", "description": "Example description for modelService", "yaml": "services:\n - ports:\n - 3000\n name: qwen1.5-7b-chat:2b34xhrmqwhomjkd\n livez: /livez\n readyz: /readyz\n serviceBootupTime: 30\nenv:\n - key:value\n - key:value\ndistro:\n packages: vim,nfs-utils\npython:\n requirements_txt: ./requirements.txt\n index_url: https://pypi.tuna.tsinghua.edu.cn/simple\n trusted_host: pypi.tuna.tsinghua.edu.cn\n", "requestCpu": 1, "requestMemory": 1024, "modelCenterUuid": "52c542f0c3384b6890e08570e611d52a", "type": "Endpoint", "system": true, "gpuComputeCapability": "3.7", "installPath": "/example/install/path", "pythonVersion": "3.8.10", "condaVersion": "23.7.4", "startCommand": "python3 app.py", "supportDistributed": true, "modelServiceImages": [ { "uuid": "d163eac54dba403abe12e77a0fec3dd5", "modelServiceUuid": "6c1a5f6167944aa1886294842075279f", "cpuArchitecture": "x86_64", "vmImageUuid": "aa45d85a91d94342838797626fd4bbfc", "dockerImage": "registry.example.com/x86_64/myimage:latest", "createDate": "Nov 25, 2025 11:51:50 AM", "lastOpDate": "Nov 25, 2025 11:51:50 AM" }, { "uuid": "e41c7c9d14934ca0aaea2847c2ed8a5e", "modelServiceUuid": "6c1a5f6167944aa1886294842075279f", "cpuArchitecture": "aarch64", "vmImageUuid": "3ab8e36ed4be4fe6bd91ad1e4f22cffd", "dockerImage": "registry.example.com/aarch64/myimage:latest", "createDate": "Nov 25, 2025 11:51:50 AM", "lastOpDate": "Nov 25, 2025 11:51:50 AM" } ], "createDate": "Nov 25, 2025 11:51:50 AM", "lastOpDate": "Nov 25, 2025 11:51:50 AM" } }

Change History

This API has no change history records yet.

View all change history