Skip to content

[Inference API] Add mapping and model changes for exposing endpoint heuristics#141393

Merged
jonathan-buttner merged 75 commits intoelastic:mainfrom
jonathan-buttner:ia-pie-sync
Feb 13, 2026
Merged

[Inference API] Add mapping and model changes for exposing endpoint heuristics#141393
jonathan-buttner merged 75 commits intoelastic:mainfrom
jonathan-buttner:ia-pie-sync

Conversation

@jonathan-buttner
Copy link
Copy Markdown
Contributor

@jonathan-buttner jonathan-buttner commented Jan 27, 2026

This PR is the first stage to implement exposing the endpoint heuristics. To facility this the following changes were made:

  • Modified the index schema to support the following document format:
Example document
{
  "_index": ".inference",
  "_id": "model_.elser-2-elastic",
  "_source": {
    "model_id": ".elser-2-elastic",
    "task_type": "sparse_embedding",
    "service": "elastic",
    "service_settings": {
      "model_id": "elser_model_2"
    },
    "task_settings": {},
    "chunking_settings": {
      "strategy": "sentence",
      "max_chunk_size": 250,
      "sentence_overlap": 1
    },
    "metadata": {
      "heuristics": {
        "properties": [
          "multilingual",
          "english"
        ],
        "status": "active",
        "release_date": "2024-01-15",
        "end_of_life_date": null
      },
      "display": {
        "name": "abc"
      },
      "internal": {
        "fingerprint": "1234567890",
        "version": 1
      }
    }
  }
}
  • Modified the ModelConfigurations to accept the EndpointMetadata and store it
  • It filters out the internal object when using the filtered method
  • Modified InferenceService so the parsePersistedConfig* methods can also take an UnparsedModel
    • Eventually it'd be good to move all services to this implementation because it gives us flexibility with adding new fields
    • I needed this because the EndpointMetadata is parsed within the ModelRegistry at the same place as the task type and service name
  • Modified the ElasticInferenceService models to accept EndpointMetadata within their constructors
    • This is necessary so we can store it within the ModelConfigurations
  • To avoid the new metadata field being written and potentially causing unanticipated validation/mapping issues, the authorization polling logic will skip sending the authorization GET request until all nodes in the cluster can handle the new metadata field

The endpoint metadata isn't used at the moment. The cluster state and inference index will contain the metadata (for all endpoints). For EIS endpoints that already existed in the index, the metadata field will default to the EMPTY implementation. For new EIS endpoints, the metadata will be populated with the fields that EIS currently returns (properties, status, release_date, end_of_life_date). The other fields like fingerprint and kibana_connector_name will remain null. The version field will be set to 0.

This PR doesn't implement the logic to update the old endpoints. That logic will be added in a follow up PR.

User created endpoints will have metadata set to the EMPTY state.

The empty metadata state is not serialized to avoid a mixed cluster mapping failure where older nodes' mapping hasn't been updated yet.

Testing

Our rolling upgrade tests initially caught the mapping issue. Those will fail if we persist the new field during an upgrade.

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @jonathan-buttner, I've created a changelog YAML for you.

Copy link
Copy Markdown
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonathan-buttner jonathan-buttner enabled auto-merge (squash) February 12, 2026 17:05
@jonathan-buttner jonathan-buttner enabled auto-merge (squash) February 12, 2026 18:55
@jonathan-buttner jonathan-buttner merged commit 2aa4156 into elastic:main Feb 13, 2026
35 checks passed
@jonathan-buttner jonathan-buttner deleted the ia-pie-sync branch February 13, 2026 15:38
sidosera pushed a commit to sidosera/elasticsearch that referenced this pull request Feb 13, 2026
…euristics (elastic#141393)

* Starting cluster state changes

* Adding metadata model and tests

* Adding model configuration changes

* Update docs/changelog/141393.yaml

* [CI] Update transport version definitions

* [CI] Auto commit changes from spotless

* Switching to fingerprint

* [CI] Auto commit changes from spotless

* Adding heuristics tests to the auth model

* Trying to fix transport version

* [CI] Update transport version definitions

* Fixing transport version and working response entity tests

* [CI] Auto commit changes from spotless

* Working ElasticInferenceServiceAuthorizationModelTests tests

* Refactoring ElasticInferenceService to include endpoint metadata

* Tests working

* Updating EndpointMetadata to include display object

* [CI] Auto commit changes from spotless

* Undo esql changes

* Fixing transport version

* Adding hidden field tests and fixing mapping

* Adding more tests and refactoring

* Fixing tests

* Excluding empty metadata

* Adding rolling upgrade test

* [CI] Auto commit changes from spotless

* Removing rolling upgrade tests

* Fixing tests

* Skipping auth call if cluster is currently upgrading

* Refactoring actions

* Fixing transport version

* Adding more tests

* [CI] Auto commit changes from spotless

* Exclude empty metadata from cluster state

* Fix transport version

* Fixing long line

* Addressing feedback

* Finish Jan feedback

* [CI] Auto commit changes from spotless

* Addressing remaining feedback

* Adding some comments for ModelConfigurations

* [CI] Auto commit changes from spotless

* Addressing Donal's feedback v2

* Switching to display_name

* Adding endpoint metadata toXContent test

* Adding tests for minimal service settings

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Feb 25, 2026
This PR continues from elastic#141393. It wires in parsing the endpoint
metadata from the persisted endpoints. This means endpoint metadata
will now be available from the GET inference APIs.

As we had to make `UnparsedModel` the way to parse persisted configs
for EIS, I took the opportunity to refactor the `InferenceService.parsePersistedConfig`
methods so that there is now only one, the one expecting an `UnparsedModel`.

This is a nice clean up in that area. Even after this PR there is quite some duplication
across services for their parse request/persistent config code. I'll follow up to clean
further in separate PRs in the future.
dimitris-athanasiou added a commit that referenced this pull request Mar 2, 2026
…3081)

This PR continues from #141393. It wires in parsing the endpoint
metadata from the persisted endpoints. This means endpoint metadata
will now be available from the GET inference APIs.

As we had to make `UnparsedModel` the way to parse persisted configs
for EIS, I took the opportunity to refactor the `InferenceService.parsePersistedConfig`
methods so that there is now only one, the one expecting an `UnparsedModel`. Also, 
I'm removing the duplication by pulling this method up in `SenderService`.
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
…stic#143081)

This PR continues from elastic#141393. It wires in parsing the endpoint
metadata from the persisted endpoints. This means endpoint metadata
will now be available from the GET inference APIs.

As we had to make `UnparsedModel` the way to parse persisted configs
for EIS, I took the opportunity to refactor the `InferenceService.parsePersistedConfig`
methods so that there is now only one, the one expecting an `UnparsedModel`. Also, 
I'm removing the duplication by pulling this method up in `SenderService`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants