Clear trained model deployment cache APIedit

Clears a trained model deployment cache on all nodes where the trained model is assigned.

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Requestedit

POST _ml/trained_models/<model_id>/deployment/cache/_clear

Prerequisitesedit

Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Descriptionedit

A trained model deployment may have an inference cache enabled. As requests are handled by each allocated node, their responses may be cached on that individual node. Calling this API clears the caches without restarting the deployment.

Path parametersedit

<model_id>
(Required, string) The unique identifier of the trained model.

Examplesedit

The following example clears the cache for the new deployment for the elastic__distilbert-base-uncased-finetuned-conll03-english trained model:

POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear

The API returns the following results:

{
   "cleared": true
}