Create inference API

edit

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.

Creates an inference endpoint to perform an inference task.

  • The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic or Hugging Face.
  • For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the Machine learning trained model APIs.

Request

edit

PUT /_inference/<task_type>/<inference_id>

Prerequisites

edit
  • Requires the manage_inference cluster privilege (the built-in inference_admin role grants this privilege)

Path parameters

edit
<inference_id>
(Required, string) The unique identifier of the inference endpoint.
<task_type>

(Required, string) The type of the inference task that the model will perform.

Refer to the service list in the API description section for the available task types.

Description

edit

The create inference API enables you to create an inference endpoint and configure a machine learning model to perform a specific inference task.

The following services are available through the inference API. You can find the available task types next to the service name. Click the links to review the configuration details of the services:

The Elasticsearch and ELSER services run on a machine learning node in your Elasticsearch cluster. The rest of the services connect to external providers.