Type to search.

Create a trained model

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 7.10 This 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.

Enable you to supply a trained model that is not created by data frame analytics.

Required privileges

Cluster privileges manage_ml

Path parameters

model_id string required

The unique identifier of the trained model.

Query parameters

defer_definition_decompression boolean · default: false The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.0 This 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.

If set to true and a compressed_definition is provided, the request defers definition decompression and skips relevant validations.

wait_for_completion boolean · default: false The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.8 This 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.

Whether to wait for all child operations (e.g. model download) to complete.

Request body

compressed_definition string

The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified.

description string

A human-readable description of the inference trained model.

metadata object

An object map that contains metadata about the model.

model_type enum · default: tree_ensemble

The model type.

Supported values include:

  • tree_ensemble: The model definition is an ensemble model of decision trees.
  • lang_ident: A special type reserved for language identification models.
  • pytorch: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only NLP models are supported.
Values: tree_ensemble lang_ident pytorch
model_size_bytes number

The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied.

platform_architecture string

The platform architecture (if applicable) of the trained mode. If the model only works on one platform, because it is heavily optimized for a particular processor architecture and OS combination, then this field specifies which. The format of the string must match the platform identifiers used by Elasticsearch, so one of, linux-x86_64, linux-aarch64, darwin-x86_64, darwin-aarch64, or windows-x86_64. For portable models (those that work independent of processor architecture or OS features), leave this field unset.

tags string[]

An array of tags to organize the model.

Response

application/json
model_id string required

Identifier for the trained model.

model_type enum

The model type

Supported values include:

  • tree_ensemble: The model definition is an ensemble model of decision trees.
  • lang_ident: A special type reserved for language identification models.
  • pytorch: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only NLP models are supported.
Values: tree_ensemble lang_ident pytorch
tags string[] required

A comma delimited string of tags. A trained model can have many tags, or none.

version string

The Elasticsearch version number in which the trained model was created.

compressed_definition string
created_by string

Information on the creator of the trained model.

create_time union oneOf

The time when the trained model was created.

One of: string or number
default_field_map map string to string

Any field map described in the inference configuration takes precedence.

description string

The free-text description of the trained model.

estimated_heap_memory_usage_bytes number

The estimated heap usage in bytes to keep the trained model in memory.

estimated_operations number

The estimated number of operations to use the trained model.

fully_defined boolean

True if the full model definition is present.

inference_config object

The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required.

Same fields as inference_config
input object required

The input field names for the model definition.

field_names string[] required

An array of input field names for the model.

license_level string

The license level of the trained model.

model_size_bytes number | string
platform_architecture string