Clear trained model deployment cache API
editClear trained model deployment cache API
editClears 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.
Request
editPOST _ml/trained_models/<model_id>/deployment/cache/_clear
Prerequisites
editRequires the manage_ml
cluster privilege. This privilege is included in the
machine_learning_admin
built-in role.
Description
editA 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 parameters
edit-
<model_id>
- (Required, string) The unique identifier of the trained model.
Examples
editThe 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 }