Query parameters

  • allow_no_matchboolean

    Specifies what to do when the request:

    • Contains wildcard expressions and there are no models that match.
    • Contains the _all string or no identifiers and there are no matches.
    • Contains wildcard expressions and there are only partial matches.

    If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.

  • decompress_definitionboolean

    Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (false).

  • exclude_generatedboolean

    Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

  • fromnumber

    Skips the specified number of models.

  • includestring

    A comma delimited string of optional fields to include in the response body.

    Values are definition, feature_importance_baseline, hyperparameters, total_feature_importance, or definition_status.

  • sizenumber

    Specifies the maximum number of models to obtain.

  • tagsstring | array[string]

    A comma delimited string of tags. A trained model can have many tags, or none. When supplied, only trained models that contain all the supplied tags are returned.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • countnumber Required
    • trained_model_configsarray[object] Required

      An array of trained model resources, which are sorted by the model_id value in ascending order.

      Hide trained_model_configs attributes Show trained_model_configs attributes object
      • model_idstring Required
      • model_typestring

        Values are tree_ensemble, lang_ident, or pytorch.

      • tagsarray[string] Required

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

      • versionstring
      • compressed_definitionstring
      • created_bystring

        Information on the creator of the trained model.

      • create_timestring | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • default_field_mapobject

        Any field map described in the inference configuration takes precedence.

        Hide default_field_map attribute Show default_field_map attribute object
        • *string Additional properties
      • descriptionstring

        The free-text description of the trained model.

      • estimated_heap_memory_usage_bytesnumber

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

      • estimated_operationsnumber

        The estimated number of operations to use the trained model.

      • fully_definedboolean

        True if the full model definition is present.

      • inference_configobject

        Inference configuration provided when storing the model config

        Hide inference_config attributes Show inference_config attributes object
        • regressionobject
          Hide regression attributes Show regression attributes object
          • results_fieldstring

            Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • num_top_feature_importance_valuesnumber

            Specifies the maximum number of feature importance values per document.

        • classificationobject
          Hide classification attributes Show classification attributes object
          • num_top_classesnumber

            Specifies the number of top class predictions to return. Defaults to 0.

          • num_top_feature_importance_valuesnumber

            Specifies the maximum number of feature importance values per document.

          • prediction_field_typestring

            Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.

          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • top_classes_results_fieldstring

            Specifies the field to which the top classes are written. Defaults to top_classes.

        • text_classificationobject

          Text classification configuration options

          Hide text_classification attributes Show text_classification attributes object
          • num_top_classesnumber

            Specifies the number of top class predictions to return. Defaults to 0.

          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • classification_labelsarray[string]

            Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels

          • vocabularyobject
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • zero_shot_classificationobject

          Zero shot classification configuration options

          Hide zero_shot_classification attributes Show zero_shot_classification attributes object
          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • hypothesis_templatestring

            Hypothesis template used when tokenizing labels for prediction

          • classification_labelsarray[string] Required

            The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradiction

          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • multi_labelboolean

            Indicates if more than one true label exists.

          • labelsarray[string]

            The labels to predict.

        • fill_maskobject

          Fill mask inference options

          Hide fill_mask attributes Show fill_mask attributes object
          • mask_tokenstring

            The string/token which will be removed from incoming documents and replaced with the inference prediction(s). In a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer has a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests. However, if this field is present in a request, its value must match the predefined value for that model/tokenizer, otherwise the request will fail.

          • num_top_classesnumber

            Specifies the number of top class predictions to return. Defaults to 0.

          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • vocabularyobject Required
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • learning_to_rankobject
          Hide learning_to_rank attributes Show learning_to_rank attributes object
          • default_paramsobject
            Hide default_params attribute Show default_params attribute object
            • *object Additional properties
          • feature_extractorsarray[object]
          • num_top_feature_importance_valuesnumber Required
        • nerobject

          Named entity recognition options

          Hide ner attributes Show ner attributes object
          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • classification_labelsarray[string]

            The token classification labels. Must be IOB formatted tags

          • vocabularyobject
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • pass_throughobject

          Pass through configuration options

          Hide pass_through attributes Show pass_through attributes object
          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • vocabularyobject
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • text_embeddingobject

          Text embedding inference options

          Hide text_embedding attributes Show text_embedding attributes object
          • embedding_sizenumber

            The number of dimensions in the embedding output

          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • vocabularyobject Required
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • text_expansionobject

          Text expansion inference options

          Hide text_expansion attributes Show text_expansion attributes object
          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • vocabularyobject Required
            Hide vocabulary attribute Show vocabulary attribute object
            • indexstring Required
        • question_answeringobject

          Question answering inference options

          Hide question_answering attributes Show question_answering attributes object
          • num_top_classesnumber

            Specifies the number of top class predictions to return. Defaults to 0.

          • tokenizationobject

            Tokenization options stored in inference configuration

            Hide tokenization attributes Show tokenization attributes object
            • bert
            • bert_ja
            • mpnet
            • roberta
            • xlm_roberta
          • results_fieldstring

            The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • max_answer_lengthnumber

            The maximum answer length to consider

      • inputobject Required
        Hide input attribute Show input attribute object
        • field_namesarray[string] Required

          An array of input field names for the model.

      • license_levelstring

        The license level of the trained model.

      • metadataobject
        Hide metadata attributes Show metadata attributes object
      • model_size_bytesnumber | string

      • model_packageobject
        Hide model_package attributes Show model_package attributes object
        • create_timenumber

          Time unit for milliseconds

        • descriptionstring
        • inference_configobject
          Hide inference_config attribute Show inference_config attribute object
          • *object Additional properties
        • metadataobject
          Hide metadata attribute Show metadata attribute object
        • minimum_versionstring
        • model_repositorystring
        • model_typestring
        • packaged_model_idstring Required
        • platform_architecturestring
        • prefix_stringsobject
          Hide prefix_strings attributes Show prefix_strings attributes object
          • ingeststring

            String prepended to input at ingest

        • sizenumber | string

        • sha256string
        • tagsarray[string]
        • vocabulary_filestring
      • locationobject
        Hide location attribute Show location attribute object
        • indexobject Required
          Hide index attribute Show index attribute object
          • namestring Required
      • platform_architecturestring
      • prefix_stringsobject
        Hide prefix_strings attributes Show prefix_strings attributes object
        • ingeststring

          String prepended to input at ingest

GET /_ml/trained_models
GET _ml/trained_models/
resp = client.ml.get_trained_models()
const response = await client.ml.getTrainedModels();
response = client.ml.get_trained_models
$resp = $client->ml()->getTrainedModels();
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/"