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

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