-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Add Mixedbread AI Rerank support #140477
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
Open
Evgenii-Kazannik
wants to merge
34
commits into
elastic:main
Choose a base branch
from
Evgenii-Kazannik:Add-Mixedbread-AI-Rerank-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,127
−26
Open
Add Mixedbread AI Rerank support #140477
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
f52f5e2
Add Mixedbread AI Rerank support
Evgenii-Kazannik 0a184ca
Add Mixedbread AI Rerank support tests
Evgenii-Kazannik dc1f701
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 6133d64
Apply spotless
Evgenii-Kazannik 6b63ffb
Add Mixedbread AI Rerank support
Evgenii-Kazannik 2cd922c
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 9ec0f7d
Add action creator tests
Evgenii-Kazannik 3fd0d23
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 4cb12db
Make windows size configurable
Evgenii-Kazannik 18d5ce4
Address comments and add service tests
Evgenii-Kazannik fd98ef0
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 5bbffe1
[CI] Update transport version definitions
83a6497
Switch to new approach for transport version
Evgenii-Kazannik fbd6d5d
Use ConstructingObjectParser
Evgenii-Kazannik f4c5c0d
Address comments
Evgenii-Kazannik c72e6a2
Merge remote-tracking branch 'origin/Add-Mixedbread-AI-Rerank-support…
Evgenii-Kazannik faa5ce8
[CI] Auto commit changes from spotless
36f7994
Fix the test
Evgenii-Kazannik 87f09e5
Checkstyle fix
Evgenii-Kazannik fa208ee
Fix the test
Evgenii-Kazannik 5ed8e6a
Clean up
Evgenii-Kazannik 6c3bc8f
Clean up
Evgenii-Kazannik cd94963
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 81f9aca
[CI] Update transport version definitions
e447752
ci: retrigger
Evgenii-Kazannik 59d97d8
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 68108cf
[CI] Update transport version definitions
2ab34e0
Address comments and refactor
Evgenii-Kazannik 65f2b64
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik a20144f
[CI] Update transport version definitions
9b1a82c
Address comments
Evgenii-Kazannik 84aab0e
[CI] Update transport version definitions
035c7a3
Merge branch 'main' into Add-Mixedbread-AI-Rerank-support
Evgenii-Kazannik 64956c1
Adjust to a new model creation approach
Evgenii-Kazannik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 140477 | ||
| summary: "[Inference API] Add Mixedbread Rerank support to the Inference Plugin" | ||
| area: Machine Learning | ||
| type: enhancement | ||
| issues: [] | ||
1 change: 1 addition & 0 deletions
1
server/src/main/resources/transport/definitions/referable/ml_inference_mixedbread_added.csv
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9271000 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| bulk_by_scroll_request_includes_relocation_field,9270000 | ||
| ml_inference_mixedbread_added,9271000 |
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
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
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
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
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
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
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
78 changes: 78 additions & 0 deletions
78
.../src/main/java/org/elasticsearch/xpack/inference/services/mixedbread/MixedbreadModel.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.inference.services.mixedbread; | ||
|
|
||
| import org.elasticsearch.common.settings.SecureString; | ||
| import org.elasticsearch.core.Nullable; | ||
| import org.elasticsearch.inference.ModelConfigurations; | ||
| import org.elasticsearch.inference.ModelSecrets; | ||
| import org.elasticsearch.inference.TaskSettings; | ||
| import org.elasticsearch.xpack.inference.external.action.ExecutableAction; | ||
| import org.elasticsearch.xpack.inference.services.RateLimitGroupingModel; | ||
| import org.elasticsearch.xpack.inference.services.ServiceUtils; | ||
| import org.elasticsearch.xpack.inference.services.mixedbread.action.MixedbreadActionVisitor; | ||
| import org.elasticsearch.xpack.inference.services.settings.ApiKeySecrets; | ||
| import org.elasticsearch.xpack.inference.services.settings.RateLimitSettings; | ||
|
|
||
| import java.net.URI; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Abstract class representing a Mixedbread model for inference. | ||
| * This class extends RateLimitGroupingModel and provides common functionality for Mixedbread models. | ||
| */ | ||
| public abstract class MixedbreadModel extends RateLimitGroupingModel { | ||
| private final SecureString apiKey; | ||
| private final RateLimitSettings rateLimitServiceSettings; | ||
| protected URI uri; | ||
|
|
||
| public MixedbreadModel( | ||
| ModelConfigurations configurations, | ||
| ModelSecrets secrets, | ||
| @Nullable ApiKeySecrets apiKeySecrets, | ||
| RateLimitSettings rateLimitServiceSettings, | ||
| URI uri | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| ) { | ||
| super(configurations, secrets); | ||
|
|
||
| this.rateLimitServiceSettings = Objects.requireNonNull(rateLimitServiceSettings); | ||
| apiKey = ServiceUtils.apiKey(apiKeySecrets); | ||
| this.uri = uri; | ||
| } | ||
|
|
||
| protected MixedbreadModel(MixedbreadModel model, TaskSettings taskSettings) { | ||
| super(model, taskSettings); | ||
|
|
||
| rateLimitServiceSettings = model.rateLimitServiceSettings(); | ||
| apiKey = model.apiKey(); | ||
| uri = model.uri(); | ||
| } | ||
|
|
||
| public SecureString apiKey() { | ||
| return apiKey; | ||
| } | ||
|
|
||
| public RateLimitSettings rateLimitServiceSettings() { | ||
| return rateLimitServiceSettings; | ||
| } | ||
|
|
||
| public abstract ExecutableAction accept(MixedbreadActionVisitor creator, Map<String, Object> taskSettings); | ||
|
|
||
| public URI uri() { | ||
| return uri; | ||
| } | ||
|
|
||
| public RateLimitSettings rateLimitSettings() { | ||
| return rateLimitServiceSettings; | ||
| } | ||
|
|
||
| public int rateLimitGroupingHash() { | ||
| return apiKey().hashCode(); | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The area should be "Inference" rather than "Machine Learning"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced: [ML] -> [Inference API]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also a good change, but I was referring to the
areafield, which should beInference, notMachine Learning.