- Notifications
You must be signed in to change notification settings - Fork 25.5k
[ML] Move to the Cohere V2 API for new inference endpoints #129884
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
Merged
Merged
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
Pinging @elastic/ml-core (Team:ML) |
Hi @davidkyle, I've created a changelog YAML for you. |
davidkyle commented Jun 23, 2025
...inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereService.java Show resolved Hide resolved
...e/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java Show resolved Hide resolved
...e/src/main/java/org/elasticsearch/xpack/inference/services/cohere/request/CohereRequest.java Show resolved Hide resolved
.../org/elasticsearch/xpack/inference/services/cohere/request/v1/CohereV1CompletionRequest.java Show resolved Hide resolved
.../org/elasticsearch/xpack/inference/services/cohere/request/v2/CohereV2CompletionRequest.java Show resolved Hide resolved
# Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
prwhelan approved these changes Jun 24, 2025
...e/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java Show resolved Hide resolved
...e/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java Outdated Show resolved Hide resolved
…inference/services/cohere/CohereServiceSettings.java Co-authored-by: Pat Whelan <pat.whelan@elastic.co>
Test this please |
💔 Backport failed
You can use sqren/backport to manually backport by running |
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 25, 2025
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
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.19.0 v9.1.0
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.
The Cohere V2 API contains 2 changes that must be adapted for
model
parameter is no longer optionalinput_type
parameter is no longer optionalCreating an endpoint without a model now causes a validation exception.
input_type
is declared either in task_settings or in the inference call, if not set in either or these places input_type defaults to search_query.New inference endpoints will use the V2 API, existing endpoints will continue to use the V1 API. The user does not have the option of picking the V1 API in new endpoints. One possibly controversial aspect is that the API version is not surfaced to the user, the version is persisted with the model config but not included in the
GET _inference
response. I implemented this behaviour because the user does not have the ability to pick the API, in retrospect hiding the version now seems confusing.The request classes have been moved to
org.elasticsearch.xpack.inference.services.cohere.request.v1
and renamed. The new V2 request classes are inorg.elasticsearch.xpack.inference.services.cohere.request.v2
(they are very similar).The upgrade test
CohereServiceUpgradeIT
tests that the old v1 endpoints still work after upgrading.