elasticsearch/docs/reference/ml/trained-models/apis/clear-trained-model-deployment-cache.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

55 lines
1.6 KiB
Text

[role="xpack"]
[[clear-trained-model-deployment-cache]]
= Clear trained model deployment cache API
[subs="attributes"]
++++
<titleabbrev>Clear trained model deployment cache</titleabbrev>
++++
Clears the {infer} cache on all nodes where the deployment is assigned.
[[clear-trained-model-deployment-cache-request]]
== {api-request-title}
`POST _ml/trained_models/<deployment_id>/deployment/cache/_clear`
[[clear-trained-model-deployment-cache-prereq]]
== {api-prereq-title}
Requires the `manage_ml` cluster privilege. This privilege is included in the
`machine_learning_admin` built-in role.
[[clear-trained-model-deployment-cache-desc]]
== {api-description-title}
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.
[[clear-trained-model-deployment-cache-path-params]]
== {api-path-parms-title}
`deployment_id`::
(Required, string)
include::{es-ref-dir}/ml/ml-shared.asciidoc[tag=deployment-id]
[[clear-trained-model-deployment-cache-example]]
== {api-examples-title}
The following example clears the cache for the new deployment for the
`elastic__distilbert-base-uncased-finetuned-conll03-english` trained model:
[source,console]
--------------------------------------------------
POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/cache/_clear
--------------------------------------------------
// TEST[skip:TBD]
The API returns the following results:
[source,console-result]
----
{
"cleared": true
}
----