跳转到主要内容
服务和应用/推理服务相关接口
POSTInference Service APIs起始版本 5.1.8同步需要认证

添加模型服务

添加模型服务

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

请求参数

请求体字段

  • paramObject必填

    param 请求体结构

    • nameString必填

      资源名称

    • descriptionString

      资源的详细描述

    • yamlString必填

      yaml格式的配置文件

    • requestCpuInteger必填

      需要使用的cpu数量

    • requestMemoryLong必填

      需要使用的内存数量

    • zoneUuidString

      区域UUID

    • modelCenterUuidString必填

      暂无描述。

    • gpuComputeCapabilityString

      暂无描述。

    • installPathString必填

      安装路径。

    • systemBoolean

      系统。

    • startCommandString必填

      开始命令。

    • pythonVersionString

      暂无描述。

    • condaVersionString

      暂无描述。

    • typeString

      类型。

    • frameworkString

      暂无描述。

    • resourceUuidString

      资源UUID

    • tagUuidsList

      标签UUID列表

    • sourceString

      来源信息。

    • modelUuidsList

      模型UUID。

    • architectureImagesList

      暂无描述。

    • supportDistributedBoolean

      暂无描述。

    • containerCommandString

      容器启动命令。

    • containerArgsString

      容器启动参数。

    • vendorToSpecUuidsMapMap

      GPU厂商到GPU规格UUID列表的映射。

  • systemTagsList

    系统标签

  • userTagsList

    用户标签

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • successboolean必填

    添加模型服务的结果

  • errorErrorCode必填

    错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

  • inventoryModelServiceInventory必填

    详情参考inventory

    • uuidString必填

      资源的UUID,唯一标识该资源

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • readmeString必填

      README内容

    • yamlString必填

      服务YAML配置

    • requestCpuInteger必填

      请求CPU数量

    • requestMemoryLong必填

      请求内存大小

    • modelCenterUuidString必填

      模型中心UUID

    • typeString必填

      模型服务类型

    • frameworkString必填

      模型服务框架

    • sourceString必填

      模型服务来源

    • sizeLong必填

      模型服务大小

    • systemBoolean必填

      是否为系统模型服务

    • hasNewVersionBoolean必填

      是否存在新版本

    • gpuComputeCapabilityString必填

      GPU算力要求

    • installPathString必填

      模型服务安装路径

    • pythonVersionString必填

      Python版本

    • condaVersionString必填

      Conda版本

    • versionString必填

      模型服务版本

    • startCommandString必填

      启动命令

    • containerCommandString必填

      容器启动命令

    • containerArgsString必填

      容器启动参数

    • supportDistributedBoolean必填

      是否支持分布式部署

    • cpuArchitecturesList必填

      支持的CPU架构

    • vendorToSpecUuidsMapMap必填

      GPU厂商与规格UUID映射

    • modelServiceRefsList必填

      模型与模型服务的绑定关系

    • modelServiceImagesList必填

      模型服务镜像列表

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

请求地址

POST/zstack/v1/ai/model-services

/zstack/v1/ai/model-services

操作 ID

AddModelService

永久链接

请求示例

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>"]}'

响应示例

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 } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史