Skip to main content
Model Repository/Model APIs
POSTModel APIsSince 5.1.8SynchronousAuth Required

AddModel

AddModel

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

      The resource name.

    • installPathStringRequired

      The model installation path.

    • descriptionString

      Optional. The detailed description of the resource.

    • parametersString

      Optional. The detailed model parameters.

    • modelCenterUuidStringRequired

      The model center UUID.

    • logoString

      Optional.

    • vendorString

      Optional.

    • introductionString

      Optional.

    • sizeLong

      Optional.

    • versionString

      Optional.

    • tokenString

      Optional.

    • resourceUuidString

      Optional. The resource UUID.

    • tagUuidsList

      Optional. The tag UUID list.

    • modelServiceUuidsList

      Optional.

    • recommendedGpuNumString

      Optional.

    • gpuConstraintDescriptionString

      Optional.

    • modelIdString

      Optional.

    • shareModeString

      Optional. The sharing mode.

    • defaultModelServiceUuidString

      Optional. The default model service UUID.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • 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.

  • inventoryModelInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The resource description.

    • installPathStringRequired

      The model installation path.

    • parametersStringRequired

      The model parameters.

    • modelCenterUuidStringRequired

      The model center UUID.

    • logoStringRequired

      The model logo.

    • vendorStringRequired

      The model vendor.

    • modelIdStringRequired

      The model ID.

    • introductionStringRequired

      The model introduction.

    • sizeLongRequired

      The model size.

    • versionStringRequired

      The model version.

    • typeStringRequired

      The model type.

    • minGpuMemoryLongRequired

      The minimum GPU memory.

    • recommendedGpuMemoryLongRequired

      The recommended GPU memory.

    • recommendedGpuNumListRequired

      The recommended number of GPUs.

    • gpuConstraintDescriptionStringRequired

      The GPU constraint description.

    • versionSemverStringRequired

      The semantic version.

    • isLatestVersionBooleanRequired

      Whether the model is the latest version.

    • artifactChecksumStringRequired

      The artifact checksum.

    • artifactSizeBytesLongRequired

      The artifact size in bytes.

    • architectureTypeStringRequired

      The model architecture type.

    • frameworkVersionStringRequired

      The framework version.

    • requiredAcceleratorStringRequired

      The required accelerator.

    • pipelineTagStringRequired

      The pipeline tag.

    • modelServiceRefsListRequired

      The bindings between the model and model services.

    • extraGpuMemRequestLongRequired

      The extra GPU memory request.

    • SAMPLE_SIZEIntegerRequired

      The sample size.

    • createDateTimestampRequired

      The creation time.

    • lastOpDateTimestampRequired

      The last operation time.

Endpoint

POST/zstack/v1/ai/models

/zstack/v1/ai/models

Operation ID

AddModel

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/ai/models' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"param":{"name":"<name>","installPath":"<installPath>","description":"<description>","parameters":"<parameters>","modelCenterUuid":"<modelCenterUuid>","logo":"<logo>","vendor":"<vendor>","introduction":"<introduction>","size":1,"version":"<version>","token":"<token>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"],"modelServiceUuids":["<modelServiceUuids>"],"recommendedGpuNum":"<recommendedGpuNum>","gpuConstraintDescription":"<gpuConstraintDescription>","modelId":"<modelId>","shareMode":"<shareMode>","defaultModelServiceUuid":"<defaultModelServiceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "description": "", "extraGpuMemRequest": 4294967296, "SAMPLE_SIZE": 1000 } }

Change History

This API has no change history records yet.

View all change history