Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Elser inference service mode_version not converted to model_id #124675

Open
jonathan-buttner opened this issue Mar 12, 2025 · 1 comment
Open
Labels
>bug Feature:GenAI Features around GenAI :ml Machine learning Team:ML Meta label for the ML team

Comments

@jonathan-buttner
Copy link
Contributor

jonathan-buttner commented Mar 12, 2025

Affected versions

8.16.0 and greater

Issue

In 8.16 we deprecated the elser service in favor of elastisearch here: https://github.com/elastic/elasticsearch/pull/114052/files#diff-719245221a062735f912753a41ba8d918a099627b89ee1f32fae3a133f7ae73cL55

In that change we no longer support model_version.

We were looking for model_version in 8.15 here: https://github.com/elastic/elasticsearch/blob/8.15/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elser/ElserInternalService.java#L162-L165

and remapping to model_id.

This issue occurs when an elser service is created in 8.12.x and then the cluster is upgraded to 8.16.x+.

In later versions of the inference plugin we'll return an error like this:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Error parsing request config, model id is missing"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Error parsing request config, model id is missing"
  },
  "status": 400
}

Workaround

To determine which inference endpoint is the cause, retrieve the endpoints:

POST .inference/_search
{
  "query": {
    "match_all": {}
  }
}

Find the endpoint that is missing service_settings.model_id

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": ".inference",
        "_id": "model_elser-model-v2",
        "_score": 1,
        "_source": {
          "model_id": "elser-model-v2", <------ inference endpoint id
          "task_type": "sparse_embedding",
          "service": "elser",
          "service_settings": {
            "num_allocations": 1,
            "num_threads": 1,
            "model_version": ".elser_model_2" <----- has model_version and not model_id
          },
          "task_settings": {}
        }
      }
    ]
  }
}

Delete elser-model-v2

DELETE _inference/elser-model-v2

Recreate the inference endpoint

PUT _inference/sparse_embedding/elser-model-v2
{
  "service": "elser",
  "service_settings": {
    "num_allocations": 1,
    "num_threads": 1
  }
}
@jonathan-buttner jonathan-buttner added :ml Machine learning Team:ML Meta label for the ML team >bug Feature:GenAI Features around GenAI labels Mar 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Feature:GenAI Features around GenAI :ml Machine learning Team:ML Meta label for the ML team
Projects
None yet
Development

No branches or pull requests

2 participants