Update an inference endpoint Added in 8.17.0

POST /_inference/{task_type}/{inference_id}/_update

Modify task_settings, secrets (within service_settings), or num_allocations for an inference endpoint, depending on the specific endpoint service and task_type.

IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, 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.

Path parameters

  • task_type string Required

    The type of inference task that the model performs.

    Values are sparse_embedding, text_embedding, rerank, or completion.

  • inference_id string Required

    The unique identifier of the inference endpoint.

application/json

Body Required

  • Additional properties are allowed.

    Hide chunking_settings attributes Show chunking_settings attributes object
    • Specifies the maximum size of a chunk in words This value cannot be higher than 300 or lower than 20 (for sentence strategy) or 10 (for word strategy)

    • overlap number

      Specifies the number of overlapping words for chunks Only for word chunking strategy This value cannot be higher than the half of max_chunk_size

    • Specifies the number of overlapping sentences for chunks Only for sentence chunking strategy It can be either 1 or 0

    • strategy string

      Specifies the chunking strategy It could be either sentence or word

  • service string Required

    The service type

  • service_settings object Required

    Additional properties are allowed.

  • Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • Additional properties are allowed.

      Hide chunking_settings attributes Show chunking_settings attributes object
      • Specifies the maximum size of a chunk in words This value cannot be higher than 300 or lower than 20 (for sentence strategy) or 10 (for word strategy)

      • overlap number

        Specifies the number of overlapping words for chunks Only for word chunking strategy This value cannot be higher than the half of max_chunk_size

      • Specifies the number of overlapping sentences for chunks Only for sentence chunking strategy It can be either 1 or 0

      • strategy string

        Specifies the chunking strategy It could be either sentence or word

    • service string Required

      The service type

    • service_settings object Required

      Additional properties are allowed.

    • Additional properties are allowed.

    • inference_id string Required

      The inference Id

    • task_type string Required

      Values are sparse_embedding, text_embedding, rerank, or completion.

POST /_inference/{task_type}/{inference_id}/_update
curl \
 --request POST http://api.example.com/_inference/{task_type}/{inference_id}/_update \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"":{"max_chunk_size":42.0,"overlap":42.0,"sentence_overlap":42.0,"strategy":"string"},"service":"string","service_settings":{},"task_settings":{}}'
Request examples
{
  "": {
    "max_chunk_size": 42.0,
    "overlap": 42.0,
    "sentence_overlap": 42.0,
    "strategy": "string"
  },
  "service": "string",
  "service_settings": {},
  "task_settings": {}
}
Response examples (200)
{
  "": {
    "max_chunk_size": 42.0,
    "overlap": 42.0,
    "sentence_overlap": 42.0,
    "strategy": "string"
  },
  "service": "string",
  "service_settings": {},
  "task_settings": {},
  "inference_id": "string",
  "task_type": "sparse_embedding"
}