DeleteLlmTemplate

Updated at:

Deletes an LLM template.

Operation description

Deletes a model template created under a model provider template. After the model template is deleted, the system triggers a configuration refresh for the associated model groups.

Before you begin

The model to be deleted cannot be the default model of any associated model group. If it is still set as the default model, the invocation failed and LlmTemplate.IsDefaultModel is returned.

For model groups that allow modifying the default model, proceed as follows:

  1. Confirm the ProviderTemplateId of the model to be deleted and the ModelTemplateId that sets it as the default model.

  2. Invoke BatchCreateLlmTemplates to create another active model under the same provider template and set IsDefaultModel to true for the new model. Specify the model group for which you want to switch the default model by using ModelTemplateId.

  3. Confirm that the default model has been switched for all relevant model groups, and then invoke this operation by using the LlmTemplateId of the original model. Switching the default model for only one group does not remove the restriction on the original default model for other groups.

When you invoke BatchCreateLlmTemplates, if a model group does not have default model Settings and you do not explicitly specify one in the current request, the service sets the first model in the list as the default model. Therefore, if you create only one model for the first time, it may become the default model even if you set IsDefaultModel to false, and it cannot be directly deleted. The default model for the Common model group is fixed and cannot be modified by using the preceding method.

Models that are under system administration and cannot be modified, as well as models that are not available to customers, cannot be deleted by invoking this operation. A model is not necessarily deletable just because it is not the default model.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

appstreaming:DeleteLlmTemplate

delete

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

LlmTemplateId

string

Yes

The ID of the model to be deleted. You can call ListLlmTemplates to obtain the ID. Use the LlmTemplateId of the specific model. Do not use the model group ID or provider template ID.

The model must exist and be manageable by the current account. If the model has been deleted or does not exist, LlmTemplate.NotFound is returned. For instructions on how to handle default models, see the operation description.

llmt-xxxx

Response elements

Element

Type

Description

Example

object

The request result.

RequestId

string

The request ID.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

Examples

Success response

JSON format

{
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 LlmTemplate.IsDefaultModel The LLM template is the default model of a model template and cannot be deleted. An attempt was made to delete an LLM template that serves as the default model for a ModelTemplate.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.