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

克隆模型服务

克隆模型服务

调试可用性

在线调试

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

路径参数

请求参数

路径参数

  • uuidString必填

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

请求体字段

  • nameString

    资源名称。

  • descriptionString

    资源的详细描述。

  • readmeString

    文档模型服务。

  • sizelong

    返回记录数。

  • gpuComputeCapabilityString

    暂无描述。

响应状态

200 OK

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

  • successboolean必填

    操作是否成功。

  • errorErrorCode必填

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

    • codeString必填

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

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

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

请求地址

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

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

操作 ID

CloneModelService

永久链接

请求示例

curl -X POST '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>","readme":"<readme>","size":1,"gpuComputeCapability":"<gpuComputeCapability>","installPath":"<installPath>","startCommand":"<startCommand>","pythonVersion":"<pythonVersion>","condaVersion":"<condaVersion>","system":true,"type":"<type>","yaml":"<yaml>","source":"<source>","framework":"<framework>","requestCpu":1,"requestMemory":1,"resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"],"systemTags":["<systemTags>"],"userTags":["<userTags>"],"cpuArchitectures":["<cpuArchitectures>"],"architectureImages":["<architectureImages>"],"supportDistributed":true,"params":{"containerCommand":"<containerCommand>","containerArgs":"<containerArgs>","vendorToSpecUuidsMap":{}}}'

响应示例

200
{ "inventory": { "uuid": "90d425a802ff44eeb530f21587633700", "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": "432c5fdd49374bb0a2fd7877f0a877cf", "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": "c13336388d574fec824752525ae05a21", "modelServiceUuid": "90d425a802ff44eeb530f21587633700", "cpuArchitecture": "x86_64", "vmImageUuid": "b31bc4574f22426a89902edac5d14a72", "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": "46c0e4bb46e849059e6d6bc8881d86f3", "modelServiceUuid": "90d425a802ff44eeb530f21587633700", "cpuArchitecture": "aarch64", "vmImageUuid": "b2085e2ac2d84029a7947cb09178daaa", "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" } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史