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

AddModelService

AddModelService

Execution Availability

Try It Out

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

Request Inputs

Body Fields

  • paramObjectRequired

    param request body object.

    • nameStringRequired

      Resource name

    • descriptionString

      Detailed description of the resource

    • yamlStringRequired

      Configuration file in YAML format

    • requestCpuIntegerRequired

      Number of CPUs required

    • requestMemoryLongRequired

      Amount of memory required

    • zoneUuidString

      Zone UUID

    • modelCenterUuidStringRequired

      No description provided.

    • gpuComputeCapabilityString

      No description provided.

    • installPathStringRequired

      安装路径。

    • systemBoolean

      系统。

    • startCommandStringRequired

      开始命令。

    • pythonVersionString

      No description provided.

    • condaVersionString

      No description provided.

    • typeString

      类型。

    • frameworkString

      No description provided.

    • resourceUuidString

      Resource UUID

    • tagUuidsList

      Tag UUID list

    • sourceString

      来源信息。

    • modelUuidsList

      模型UUID。

    • architectureImagesList

      No description provided.

    • supportDistributedBoolean

      Whether distributed inference deployment is supported

    • containerCommandString

      Optional. The container startup command.

    • containerArgsString

      Optional. The container startup arguments.

    • vendorToSpecUuidsMapMap

      Optional. The mapping from GPU vendor to GPU specification UUIDs.

  • systemTagsList

    System tags

  • userTagsList

    User tags

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    Result of adding the model service

  • errorErrorCodeRequired

    Error code. If this field is not null, the operation fails. If the operation succeeds, this field is null. For details, see error

    • codeStringRequired

      Error code number, a globally unique identifier of the error, for example, SYS.1000 or HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed information of the error

    • elaborationStringRequired

      Reserved field. The default value is null

    • opaqueLinkedHashMapRequired

      Reserved field. The default value is null

    • causeErrorCodeRequired

      Root error, which causes the current error. If no original error exists, this field is null

  • inventoryModelServiceInventoryRequired

    For details, 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

POST/zstack/v1/ai/model-services

/zstack/v1/ai/model-services

Operation ID

AddModelService

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/ai/model-services' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"param":{"name":"<name>","description":"<description>","yaml":"<yaml>","requestCpu":1,"requestMemory":1,"zoneUuid":"<zoneUuid>","modelCenterUuid":"<modelCenterUuid>","gpuComputeCapability":"<gpuComputeCapability>","installPath":"<installPath>","system":true,"startCommand":"<startCommand>","pythonVersion":"<pythonVersion>","condaVersion":"<condaVersion>","type":"<type>","framework":"<framework>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"],"source":"<source>","modelUuids":["<modelUuids>"],"architectureImages":["<architectureImages>"],"supportDistributed":true,"containerCommand":"<containerCommand>","containerArgs":"<containerArgs>","vendorToSpecUuidsMap":{}},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "name": "text to text model service", "description": "This is text to text model service you can chose model", "yaml": "model service parameters", "requestCpu": 4, "requestMemory": 1024 } }

Change History

This API has no change history records yet.

View all change history