AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 9.2This functionality is generally available and ready for production usage.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Create an inference endpoint to perform an inference task with the contexualai service.
The type of service supported for the specified task type. In this case, contextualai.
Values:contextualai
service_settingsobjectrequired
Settings used to install the inference model. These settings are specific to the contextualai service.
api_keystringrequired
A valid API key for your Contexutual AI account.
Important
You need to provide the API key only once, during the inference model creation.
The get inference endpoint API does not retrieve your API key.
model_idstringrequired
The name of the model to use for the inference task.
Refer to the Contextual AI documentation for the list of available rerank models.
rate_limitobject
This setting helps to minimize the number of rate limit errors returned from Contextual AI.
The contextualai service sets a default number of requests allowed per minute depending on the task type.
For rerank, it is set to 1000.
requests_per_minutenumber
The number of requests allowed per minute.
By default, the number of requests allowed per minute is set by each service as follows:
alibabacloud-ai-search service: 1000
amazonbedrock service: 240
anthropic service: 50
azureaistudio service: 240
azureopenai service and task type text_embedding: 1440
azureopenai service and task types completion or chat_completion: 120
cohere service: 10000
contextualai service: 1000
elastic service and task type chat_completion: 240
fireworksai service: 6000
googleaistudio service: 360
googlevertexai service: 30000
hugging_face service: 3000
jinaai service: 2000
llama service: 3000
mistral service: 240
openai service and task type text_embedding: 3000
openai service and task type completion: 500
openshift_ai service: 3000
voyageai service: 2000
watsonxai service: 120
task_settingsobject
Settings to configure the inference task.
These settings are specific to the task type you specified.
The number of most relevant documents to return.
If not specified, the reranking results of all documents will be returned.
Only for the rerank task type.
The chunking configuration object.
Applies only to the embedding, sparse_embedding and text_embedding task types.
Not applicable to the rerank, completion, or chat_completion task types.
max_chunk_sizenumber · default: 250
The maximum size of a chunk in words.
This value cannot be lower than 20 (for sentence strategy) or 10 (for word strategy).
This value should not exceed the window size for the associated model.
overlapnumber · default: 100
The number of overlapping words for chunks.
It is applicable only to a word chunking strategy.
This value cannot be higher than half the max_chunk_size value.
sentence_overlapnumber · default: 1
The number of overlapping sentences for chunks.
It is applicable only for a sentence chunking strategy.
It can be either 1 or 0.
separator_groupstring
Only applicable to the recursive strategy and required when using it.
Sets a predefined list of separators in the saved chunking settings based on the selected text type.
Values can be markdown or plaintext.
Using this parameter is an alternative to manually specifying a custom separators list.
separatorsstring[]
Only applicable to the recursive strategy and required when using it.
A list of strings used as possible split points when chunking text.
Each string can be a plain string or a regular expression (regex) pattern.
The system tries each separator in order to split the text, starting from the first item in the list.
After splitting, it attempts to recombine smaller pieces into larger chunks that stay within
the max_chunk_size limit, to reduce the total number of chunks generated.
strategystring · default: sentence
The chunking strategy: sentence, word, none or recursive.
If strategy is set to recursive, you must also specify:
max_chunk_size
either separators orseparator_group
Learn more about different chunking strategies in the linked documentation.