# Can not deploy ELSER to my ML cluster

**URL:** <https://discuss.elastic.co/t/can-not-deploy-elser-to-my-ml-cluster/372284>\
**Category:** Elasticsearch\
**Created:** [December 20, 2024, 6:17pm UTC](https://discuss.elastic.co/t/can-not-deploy-elser-to-my-ml-cluster/372284 "2024-12-20T18:17:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ali_b/32/140210_2.png) [@Ali\_B](https://discuss.elastic.co/u/Ali_B)\
**Post date:** [December 20, 2024, 6:17pm UTC](https://discuss.elastic.co/t/can-not-deploy-elser-to-my-ml-cluster/372284/1 "2024-12-20T18:17:56Z")

</div>

I am trying to add ELSER to my existing ES index. When I run the below code following the docs:

```auto
    # Creates the ELSER model configuration. Automatically downloads the model if it doesn't exist.
    res = client.ml.put_trained_model(
        model_id=".elser_model_2",
        input={"field_names": ["text_field"]},
    )
    print(res)

```

I get the following error:

```auto
elasticsearch.BadRequestError: BadRequestError(400, 'action_request_validation_exception', "Validation Failed: 
1: [model_type] must be set if [definition] is not defined.;
2: [inference_config] must not be null.;
3: Invalid model_id; '.elser_model_2' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric;")

```

Any ideas what I am doing wrong here?
