Skip to content

Adding default endpoint for Elastic Rerank#117939

Merged
ymao1 merged 9 commits intoelastic:mainfrom
ymao1:default-reranker
Dec 6, 2024
Merged

Adding default endpoint for Elastic Rerank#117939
ymao1 merged 9 commits intoelastic:mainfrom
ymao1:default-reranker

Conversation

@ymao1
Copy link
Contributor

@ymao1 ymao1 commented Dec 3, 2024

Resolves https://github.com/elastic/ml-team/issues/1404

Summary

Adds default endpoint for Elastic Rerank model. To verify, run locally and then access

GET http://localhost:9200/_inference/_all

The response should include the new default endpoint for the rerank model

{
    "inference_id": ".rerank-v1-elasticsearch",
    "task_type": "rerank",
    "service": "elasticsearch",
    "service_settings": {
        "num_threads": 1,
        "model_id": ".rerank-v1",
        "adaptive_allocations": {
            "enabled": true,
            "min_number_of_allocations": 0,
            "max_number_of_allocations": 32
        }
    },
    "task_settings": {
        "return_documents": true
    }
}

Then use the endpoint

POST http://localhost:9200/_inference/rerank/.rerank-v1-elasticsearch
{
  "query": "yo",
  "input": [
    "Hello world", "Goodnight moon"
  ]
}

The first time you call this API, it should download the model.

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

Looks good.

I made a suggestion but if you want to do that in another PR that is fine

chunkingSettings
);
} else if (modelId.equals(RERANKER_ID)) {
return new ElasticRerankerModel(
Copy link
Member

Choose a reason for hiding this comment

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

++ thanks for this bug fix

@ymao1 ymao1 added >enhancement :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.18.0 labels Dec 4, 2024
@ymao1 ymao1 self-assigned this Dec 4, 2024
@ymao1 ymao1 marked this pull request as ready for review December 4, 2024 21:11
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @ymao1, I've created a changelog YAML for you.

@ymao1 ymao1 requested a review from davidkyle December 5, 2024 13:55
Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@davidkyle
Copy link
Member

@ymao1 ymao1 merged commit 54c320e into elastic:main Dec 6, 2024
@ymao1 ymao1 deleted the default-reranker branch December 6, 2024 14:08
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x
ymao1 added a commit to ymao1/elasticsearch that referenced this pull request Dec 6, 2024
* Adding default endpoint for Elastic Rerank

* CustomElandRerankTaskSettings -> RerankTaskSettings

* Update docs/changelog/117939.yaml
elasticsearchmachine pushed a commit that referenced this pull request Dec 6, 2024
* Adding default endpoint for Elastic Rerank

* CustomElandRerankTaskSettings -> RerankTaskSettings

* Update docs/changelog/117939.yaml
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Dec 8, 2024
This reverts commit 54c320e.

# Conflicts:
#	x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java
davidkyle added a commit that referenced this pull request Dec 9, 2024
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Dec 9, 2024
davidkyle added a commit that referenced this pull request Dec 11, 2024
…lag(#117939)"… (#118253)

* Revert "Revert "Adding default endpoint for Elastic Rerank (#117939)" (#118221)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >enhancement :ml Machine learning Team:ML Meta label for the ML team v8.18.0 v9.0.0

3 participants