Updated on 2025-09-15 GMT+08:00

Updating Model Information

Function

This API is used to update a model and generate a new version. You can call this API to update model information, including the name, description, and current version ID. It allows you to add a new version by passing in the version name, description, base model type, and model address. This is an asynchronous API. It is used in conjunction with the ListModelVersions API to check the model version information. If the version failed, it cannot be updated to the current version. The model path must exist when a model is added. Otherwise, an error will be reported.

URI

PUT /v1/workspaces/{workspace_id}/models/{model_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

workspace_id

Yes

String

Definition: Workspace ID. For how to obtain a workspace ID, see [Obtaining a Workspace ID] (dataartsfabric_03_0022.xml).

Constraints: N/A.

Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A.

model_id

Yes

String

Definition: Model ID. For how to obtain a model ID, see [Obtaining a Model ID] (dataartsfabric_03_0024.xml).

Constraints: N/A.

Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Definition: Tenant token. It is used for API calling authentication. For how to obtain a token, see [Authentication] (dataartsfabric_03_0005.xml).

Constraints: N/A.

Range: Up to 65,534 characters.

Default Value: N/A.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

No

String

Definition: Model name.

Constraints: N/A.

Range: 1 to 64 characters. Only letters, digits, hyphens (-), underscores (_), periods (.), and spaces are allowed.

Default Value: N/A.

description

No

String

Definition: Description.

Constraints: N/A.

Range: [0, 1024].

Default Value: N/A.

current_version_id

No

String

Definition: Model version ID.

Constraints: This ID is automatically generated by the system and cannot be changed. If you enter an ID, the input does not take effect.

Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A.

version

No

ModelVersionInput object

Definition: Details of each model version.

Constraints: N/A.

Table 4 ModelVersionInput

Parameter

Mandatory

Type

Description

name

Yes

String

Definition: Model version name.

Constraints: N/A.

Range: 1 to 64 characters. Only letters, digits, hyphens (-), underscores (_), periods (.), and spaces are allowed.

Default Value: N/A.

description

No

String

Definition: Description.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

config

No

ModelConfig object

Definition: Model configuration.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Table 5 ModelConfig

Parameter

Mandatory

Type

Description

llm_model_config

No

LlmModelConfig object

Definition: LLM configuration.

Constraints: N/A.

Table 6 LlmModelConfig

Parameter

Mandatory

Type

Description

base_model_type

Yes

String

Definition: Base model type.

Constraints: N/A.

Range: For how to obtain a base model type, see [Listing Base Models] (ListBaseModels.xml).

Default Value: N/A.

model_path

No

String

Definition: Model file path.

Constraints: Only valid OBS paths are allowed.

Range: N/A.

Default Value: N/A.

local_model_path

No

String

Definition: Local model file path.

Constraints: Only local model file paths are allowed.

Range: N/A.

Default Value: N/A.

Response Parameters

Status code: 200

A model is updated.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 408

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Example Requests

Update a model. The name is LLama3-8b, the description is description, and the current version ID is 0b5633ba2b904511ad514346f4d23d4b. The following is an example of the configuration for generating a new version.

PUT https://{endpoint}/v1/workspaces/{workspace_id}/models/{model_id}

{
  "name" : "LLama3-8b",
  "description" : "description",
  "current_version_id" : "0b5633ba2b904511ad514346f4d23d4b",
  "version" : {
    "name" : "name",
    "description" : "description",
    "config" : {
      "llm_model_config" : {
        "base_model_type" : "string",
        "model_path" : "obs://bucketname/objectdir/modelpath/"
      }
    }
  }
}

Example Responses

Status code: 200

A model is updated.

{
  "visibility" : "PRIVATE",
  "id" : "0b5633ba2b904511ad514346f4d23d4b",
  "name" : "LLama3-8b",
  "description" : "description",
  "type" : "LLM_MODEL",
  "create_time" : "2023-05-30T12:24:30.401Z",
  "update_time" : "2023-05-30T12:24:30.401Z",
  "current_version" : {
    "id" : "0b5633ba2b904511ad514346f4d23d4b",
    "name" : "name",
    "cap_white_list" : [ "cap1 cap2 ca* cap*" ],
    "description" : "description",
    "config" : {
      "llm_model_config" : {
        "base_model_type" : "string",
        "model_path" : "obs://bucketname/objectdir/modelpath/"
      }
    },
    "create_time" : "2023-05-30T12:24:30.401Z",
    "create_user" : {
      "domain_name" : "string",
      "domain_id" : "0b5633ba2b904511ad514346f4d23d4b",
      "user_name" : "string",
      "user_id" : "0b5633ba2b904511ad514346f4d23d4b"
    }
  },
  "create_user" : {
    "domain_name" : "string",
    "domain_id" : "0b5633ba2b904511ad514346f4d23d4b",
    "user_name" : "string",
    "user_id" : "0b5633ba2b904511ad514346f4d23d4b"
  },
  "update_user" : {
    "domain_name" : "string",
    "domain_id" : "0b5633ba2b904511ad514346f4d23d4b",
    "user_name" : "string",
    "user_id" : "0b5633ba2b904511ad514346f4d23d4b"
  },
  "new_version" : {
    "id" : "0b5633ba2b904511ad514346f4d23d4b",
    "name" : "name",
    "cap_white_list" : [ "cap1 cap2 ca* cap*" ],
    "description" : "description",
    "config" : {
      "llm_model_config" : {
        "base_model_type" : "string",
        "model_path" : "obs://bucketname/objectdir/modelpath/"
      }
    },
    "create_time" : "2023-05-30T12:24:30.401Z",
    "create_user" : {
      "domain_name" : "string",
      "domain_id" : "0b5633ba2b904511ad514346f4d23d4b",
      "user_name" : "string",
      "user_id" : "0b5633ba2b904511ad514346f4d23d4b"
    }
  }
}

Status code: 400

BadRequest

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error" : {
    "code" : "403",
    "message" : "X-Auth-Token is invalid in the request",
    "title" : "Forbidden"
  },
  "error_code" : 403,
  "error_msg" : "X-Auth-Token is invalid in the request",
  "title" : "Forbidden"
}

Status code: 404

NotFound

{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404"
}

Status code: 408

Request Time-out

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}

Status code: 500

InternalServerError

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}

Status Codes

Status Code

Description

200

A model is updated.

400

BadRequest

401

Unauthorized

403

Forbidden

404

NotFound

408

Request Time-out

500

InternalServerError

Error Codes

See Error Codes.