clear-trained-model-deployment-cache.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [role="xpack"]
  2. [[clear-trained-model-deployment-cache]]
  3. = Clear trained model deployment cache API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Clear trained model deployment cache</titleabbrev>
  7. ++++
  8. Clears a trained model deployment cache on all nodes where the trained model is assigned.
  9. [[clear-trained-model-deployment-cache-request]]
  10. == {api-request-title}
  11. `POST _ml/trained_models/<model_id>/deployment/cache/_clear`
  12. [[clear-trained-model-deployment-cache-prereq]]
  13. == {api-prereq-title}
  14. Requires the `manage_ml` cluster privilege. This privilege is included in the
  15. `machine_learning_admin` built-in role.
  16. [[clear-trained-model-deployment-cache-desc]]
  17. == {api-description-title}
  18. A trained model deployment may have an inference cache enabled. As requests are handled by each allocated node,
  19. their responses may be cached on that individual node. Calling this API clears the caches without restarting the
  20. deployment.
  21. [[clear-trained-model-deployment-cache-path-params]]
  22. == {api-path-parms-title}
  23. `<model_id>`::
  24. (Required, string)
  25. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id]
  26. [[clear-trained-model-deployment-cache-example]]
  27. == {api-examples-title}
  28. The following example clears the cache for the new deployment for the
  29. `elastic__distilbert-base-uncased-finetuned-conll03-english` trained model:
  30. [source,console]
  31. --------------------------------------------------
  32. POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear
  33. --------------------------------------------------
  34. // TEST[skip:TBD]
  35. The API returns the following results:
  36. [source,console-result]
  37. ----
  38. {
  39. "cleared": true
  40. }
  41. ----