DeleteLlmTemplate
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:
Confirm the ProviderTemplateId of the model to be deleted and the ModelTemplateId that sets it as the default model.
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.
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
Test
RAM authorization
|
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.