2023-09-29 16:12:07 +08:00
|
|
|
[role="xpack"]
|
|
|
|
[[put-inference-api]]
|
|
|
|
=== Create {infer} API
|
|
|
|
|
2023-11-02 20:02:29 +08:00
|
|
|
experimental[]
|
|
|
|
|
2024-04-04 21:42:03 +08:00
|
|
|
Creates an {infer} endpoint to perform an {infer} task.
|
2023-09-29 16:12:07 +08:00
|
|
|
|
2024-07-02 20:47:14 +08:00
|
|
|
IMPORTANT: The {infer} APIs enable you to use certain services, such as built-in
|
|
|
|
{ml} models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI or Hugging Face.
|
2024-07-09 22:30:42 +08:00
|
|
|
For built-in models and models uploaded through Eland, the {infer} APIs offer an alternative way to use and manage trained models.
|
2024-07-01 16:12:16 +08:00
|
|
|
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>>.
|
|
|
|
|
2023-09-29 16:12:07 +08:00
|
|
|
[discrete]
|
|
|
|
[[put-inference-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2024-04-05 19:10:03 +08:00
|
|
|
`PUT /_inference/<task_type>/<inference_id>`
|
2023-09-29 16:12:07 +08:00
|
|
|
|
|
|
|
[discrete]
|
|
|
|
[[put-inference-api-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
2024-03-20 19:15:21 +08:00
|
|
|
* Requires the `manage_inference` <<privileges-list-cluster,cluster privilege>>
|
|
|
|
(the built-in `inference_admin` role grants this privilege)
|
2023-09-29 16:12:07 +08:00
|
|
|
|
|
|
|
[discrete]
|
|
|
|
[[put-inference-api-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
2024-07-01 16:12:16 +08:00
|
|
|
The create {infer} API enables you to create an {infer} endpoint and configure a {ml} model to perform a specific {infer} task.
|
2024-04-02 19:34:46 +08:00
|
|
|
|
2024-07-01 16:12:16 +08:00
|
|
|
The following services are available through the {infer} API, click the links to review the configuration details of the services:
|
2024-04-02 19:34:46 +08:00
|
|
|
|
2024-07-12 22:14:54 +08:00
|
|
|
* <<infer-service-amazon-bedrock,Amazon Bedrock>>
|
2024-07-01 16:12:16 +08:00
|
|
|
* <<infer-service-azure-ai-studio,Azure AI Studio>>
|
|
|
|
* <<infer-service-azure-openai,Azure OpenAI>>
|
|
|
|
* <<infer-service-cohere,Cohere>>
|
|
|
|
* <<infer-service-elasticsearch,Elasticsearch>> (for built-in models and models uploaded through Eland)
|
|
|
|
* <<infer-service-elser,ELSER>>
|
|
|
|
* <<infer-service-google-ai-studio,Google AI Studio>>
|
2024-07-02 20:47:14 +08:00
|
|
|
* <<infer-service-google-vertex-ai,Google Vertex AI>>
|
2024-07-01 16:12:16 +08:00
|
|
|
* <<infer-service-hugging-face,Hugging Face>>
|
|
|
|
* <<infer-service-mistral,Mistral>>
|
|
|
|
* <<infer-service-openai,OpenAI>>
|