delete-inference.asciidoc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. [role="xpack"]
  2. [[delete-inference-api]]
  3. === Delete {infer} API
  4. Deletes an {infer} endpoint.
  5. IMPORTANT: The {infer} APIs enable you to use certain services, such as built-in {ml} models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.
  6. For built-in models and models uploaded through Eland, the {infer} APIs offer an alternative way to use and manage trained models.
  7. However, if you do not plan to use the {infer} APIs to use these models or if you want to use non-NLP models, use the <<ml-df-trained-models-apis>>.
  8. [discrete]
  9. [[delete-inference-api-request]]
  10. ==== {api-request-title}
  11. `DELETE /_inference/<inference_id>`
  12. `DELETE /_inference/<task_type>/<inference_id>`
  13. [discrete]
  14. [[delete-inference-api-prereqs]]
  15. ==== {api-prereq-title}
  16. * Requires the `manage_inference` <<privileges-list-cluster,cluster privilege>>
  17. (the built-in `inference_admin` role grants this privilege)
  18. [discrete]
  19. [[delete-inference-api-path-params]]
  20. ==== {api-path-parms-title}
  21. <inference_id>::
  22. (Required, string)
  23. The unique identifier of the {infer} endpoint to delete.
  24. <task_type>::
  25. (Optional, string)
  26. The type of {infer} task that the model performs.
  27. [discrete]
  28. [[delete-inference-query-parms]]
  29. == {api-query-parms-title}
  30. `dry_run`::
  31. (Optional, Boolean)
  32. When `true`, checks the `semantic_text` fields and {infer} processors that reference the endpoint and returns them in a list, but does not delete the endpoint.
  33. Defaults to `false`.
  34. `force`::
  35. (Optional, Boolean)
  36. Deletes the endpoint regardless if it's used in a `semantic_text` field or in an {infer} pipeline.
  37. [discrete]
  38. [[delete-inference-api-example]]
  39. ==== {api-examples-title}
  40. The following API call deletes the `my-elser-model` {infer} model that can
  41. perform `sparse_embedding` tasks.
  42. [source,console]
  43. ------------------------------------------------------------
  44. DELETE /_inference/sparse_embedding/my-elser-model
  45. ------------------------------------------------------------
  46. // TEST[skip:TBD]
  47. The API returns the following response:
  48. [source,console-result]
  49. ------------------------------------------------------------
  50. {
  51. "acknowledged": true
  52. }
  53. ------------------------------------------------------------
  54. // NOTCONSOLE