Delete inference APIedit

This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Deletes an inference model deployment.

The inference APIs enable you to use certain services, such as ELSER, OpenAI, or Hugging Face, in your cluster. This is not the same feature that you can use on an ML node with custom machine learning models. If you want to train and use your own model, use the Machine learning trained model APIs.

Requestedit

DELETE /_inference/<task_type>/<model_id>

Prerequisitesedit

Path parametersedit

<model_id>
(Required, string) The unique identifier of the inference model to delete.
<task_type>
(Required, string) The type of inference task that the model performs.

Examplesedit

The following API call deletes the my-elser-model inference model that can perform sparse_embedding tasks.

response = client.inference.delete_model(
  task_type: 'sparse_embedding',
  model_id: 'my-elser-model'
)
puts response
DELETE /_inference/sparse_embedding/my-elser-model

The API returns the following response:

{
  "acknowledged": true
}