delete-inference.asciidoc 2.2 KB

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