-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Inference API ] Deprecate task_settings in favour of parameters #114176
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
Hi @maxhniebergall, I've created a changelog YAML for you. Note that since this PR is labelled |
davidkyle
reviewed
Oct 7, 2024
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/inference/action/PutInferenceModelAction.java
Show resolved
Hide resolved
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceIndex.java
Outdated
Show resolved
Hide resolved
...plugin/inference/src/main/java/org/elasticsearch/xpack/inference/registry/ModelRegistry.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/InferenceService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/inference/ModelConfigurations.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/inference/action/PutInferenceModelAction.java
Show resolved
Hide resolved
…eTaskSettings # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In this change we deprecate task_settings and alias it to "parameters". Moreover, when creating inference endpoints, users can pass an object named "parameters" in place of "task_settings", where the object can have all of the same fields it had before. If the user passes "task_settings" to the create endpoint API, the operation will succeed, but there will be a warning asking them to migrate to using "parameters" instead. In the response to the create endpoint API, both "parameters" and "task_settings" objects will be included, and they will have all of the same fields, to allow users to update their programs to expect "parameters" instead of "task_settings" without breaking backwards compatibility. When users perform a
GET _inference/all, the response will include both "parameters" and "task_settings" until at least 9.0.TODO
Examples of create endpoint API:
Put ELSER
Request:
{ "service": "elasticsearch", "service_settings": { "model_id": ".elser_model_2", "num_allocations": 1, "num_threads": 1 } }Response:
{ "inference_id": "elser_endpoint2", "task_type": "sparse_embedding", "service": "elasticsearch", "service_settings": { "num_allocations": 1, "num_threads": 1, "model_id": ".elser_model_2" }, "task_settings": {}, "parameters": {} }Put cohere
Request:
{ "service": "cohere", "service_settings": { "model_id": "embed-english-v3.0", "api_key": <REDACTED> }, "task_settings": { "input_type": "ingest" } }Response:
{ "inference_id": "testss", "task_type": "text_embedding", "service": "cohere", "service_settings": { "similarity": "dot_product", "dimensions": 1024, "model_id": "embed-english-v3.0", "rate_limit": { "requests_per_minute": 10000 }, "embedding_type": "float" }, "task_settings": { "input_type": "ingest" }, "parameters": { "input_type": "ingest" } }Request:
{ "service": "cohere", "service_settings": { "model_id": "embed-english-v3.0", "api_key": "gNMQtKcON8qrF3CjuZ270SJq7TCVyG6il08jZ4nV" }, "parameters": { "input_type": "ingest" } }Response:
{ "inference_id": "tests2", "task_type": "text_embedding", "service": "cohere", "service_settings": { "similarity": "dot_product", "dimensions": 1024, "model_id": "embed-english-v3.0", "rate_limit": { "requests_per_minute": 10000 }, "embedding_type": "float" }, "task_settings": { "input_type": "ingest" }, "parameters": { "input_type": "ingest" } }Get _inference/all
Response:
{ "endpoints": [ { "inference_id": ".elser-2", "task_type": "sparse_embedding", "service": "elasticsearch", "service_settings": { "num_threads": 1, "model_id": ".elser_model_2", "adaptive_allocations": { "enabled": true, "min_number_of_allocations": 1, "max_number_of_allocations": 8 } }, "task_settings": {}, "parameters": {} }, { "inference_id": "elser_endpoint1", "task_type": "sparse_embedding", "service": "elasticsearch", "service_settings": { "num_allocations": 1, "num_threads": 1, "model_id": ".elser_model_2" }, "task_settings": {}, "parameters": {} }, { "inference_id": "testss", "task_type": "text_embedding", "service": "cohere", "service_settings": { "similarity": "dot_product", "dimensions": 1024, "model_id": "embed-english-v3.0", "rate_limit": { "requests_per_minute": 10000 }, "embedding_type": "float" }, "task_settings": { "input_type": "ingest" }, "parameters": { "input_type": "ingest" } } ] }