delete-inference.asciidoc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 `semantic_text` fields and {infer} processors that reference the endpoint and returns them in a list, but does not delete the endpoint.
  37. Defaults to `false`.
  38. `force`::
  39. (Optional, Boolean)
  40. Deletes the endpoint regardless if it's used in a `semantic_text` field or in an {infer} pipeline.
  41. [discrete]
  42. [[delete-inference-api-example]]
  43. ==== {api-examples-title}
  44. The following API call deletes the `my-elser-model` {infer} model that can
  45. perform `sparse_embedding` tasks.
  46. [source,console]
  47. ------------------------------------------------------------
  48. DELETE /_inference/sparse_embedding/my-elser-model
  49. ------------------------------------------------------------
  50. // TEST[skip:TBD]
  51. The API returns the following response:
  52. [source,console-result]
  53. ------------------------------------------------------------
  54. {
  55. "acknowledged": true
  56. }
  57. ------------------------------------------------------------
  58. // NOTCONSOLE