Updated on 2025-08-13 GMT+08:00

Update models.

Function

Updating Model Configurations

URI

PUT /v1/koosearch/models/{model_name}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

model_name

Yes

String

Model name.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

Token used for API authentication. For how to obtain the token, see section 3.2 "Authentication."

Constraints:

N/A.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

detail

No

String

Model description.

endpoint

No

String

Model endpoint

extend_config

No

ModelExtendConfig object

User-defined model configuration, in JSON format.

alias

No

String

Name required by the Ascend model scenario request.

Table 4 ModelExtendConfig

Parameter

Mandatory

Type

Description

iam_info

Yes

IamInfo object

IAM authentication agency information

custom_header

No

map<string, object>

Extended request header

deployment_id

No

String

deployment_id of a model

vector_config

No

VectorConfig object

Vector model configuration.

nlp_config

No

NlpConfig object

Configuration of the NLP foundation model.

Table 5 IamInfo

Parameter

Mandatory

Type

Description

iam_enabled

No

Boolean

Indicates whether to enable authentication

agency_enabled

No

Boolean

Indicates whether to use an agency account for authentication

project_id

No

String

Project ID of the IAM user. This parameter is mandatory when iam_enable is set to true.

domain_name

No

String

Name of the agency account

agency_name

No

String

Agency name.

Table 6 VectorConfig

Parameter

Mandatory

Type

Description

embedding_url

Yes

String

URL for calling the embedding or query2query model.

rerank_url

Yes

String

URL for calling the reranking model.

Table 7 NlpConfig

Parameter

Mandatory

Type

Description

context_length

Yes

Integer

Context length, that is, the maximum number of tokens that can be considered by the NLP foundation model during a specific inference.

Response Parameters

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Example Requests

PUT https://{endpoint}/v1/koosearch/models/pangu_38b

{
  "detail" : "pangu_38b",
  "endpoint" : "http://10.0.0.169:31010",
  "extend_config" : {
    "deployment_id" : "123",
    "iam_info" : {
      "project_id" : "123",
      "iam_enabled" : false,
      "agency_enabled" : false
    },
    "nlp_config" : {
      "context_length" : 32
    }
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

Updated

400

Invalid request body

500

Internal error

Error Codes

See Error Codes.