[ML] Add ContextualAI inference service#134933
Merged
davidkyle merged 19 commits intoelastic:mainfrom Sep 26, 2025
pedrocassalpacheco:feature/contextualai-clean
Merged
[ML] Add ContextualAI inference service#134933davidkyle merged 19 commits intoelastic:mainfrom pedrocassalpacheco:feature/contextualai-clean
davidkyle merged 19 commits intoelastic:mainfrom
pedrocassalpacheco:feature/contextualai-clean
Conversation
- Added complete ContextualAI rerank service implementation - Updated InferencePlugin.java to register ContextualAI service - Fixed service settings validation for REQUEST vs PERSISTENT contexts - Updated debug script to clear cluster state on restart Includes only: - ContextualAI service files under x-pack/plugin/inference/.../contextualai/ - InferencePlugin.java registration - debug_elasticsearch.sh modifications
|
💚 CLA has been signed |
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
Member
|
@elasticmachine test this please |
davidkyle
reviewed
Sep 22, 2025
Member
davidkyle
left a comment
There was a problem hiding this comment.
Looks great thanks @pedrocassalpacheco
Please add tests for the new classes added under this folder - https://github.com/elastic/elasticsearch/tree/main/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services
You can run the tests from your terminal with this command: ./gradlew :x-pack:plugin:inference:test
...c/main/java/org/elasticsearch/xpack/inference/services/contextualai/ContextualAiService.java
Outdated
Show resolved
Hide resolved
...g/elasticsearch/xpack/inference/services/contextualai/request/ContextualAiRerankRequest.java
Outdated
Show resolved
Hide resolved
...ticsearch/xpack/inference/services/contextualai/request/ContextualAiRerankRequestEntity.java
Outdated
Show resolved
Hide resolved
...asticsearch/xpack/inference/services/contextualai/rerank/ContextualAiRerankTaskSettings.java
Show resolved
Hide resolved
Member
|
@elasticmachine test this please |
davidkyle
reviewed
Sep 25, 2025
Contributor
Author
|
@davidkyle - thank you for your support. Happy to make any further changes if necessary. |
Member
|
@elasticmachine test this please |
Member
|
@elasticmachine test this please |
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Sep 26, 2025
…-dls * upstream/main: [ML] Add ContextualAI inference service (elastic#134933)
6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add ContextualAI Rerank Service Implementation
Overview
This PR adds a complete implementation of ContextualAI rerank service integration to Elasticsearch's inference plugin, following the established patterns used by other inference services (OpenAI, Cohere, etc.).
What's Implemented
Files Added/Modified
ContextualAiService.java- Main service implementationContextualAiRerankModel.java- Model representationContextualAiRerankServiceSettings.java- Service configurationContextualAiRerankTaskSettings.java- Task-specific settings with instruction supportContextualAiActionCreator.java- Action creation logicContextualAiRerankRequest.java- HTTP request handling with debug loggingContextualAiRerankRequestEntity.java- JSON serialization with proper field orderingContextualAiRerankResponseEntity.java- Response parsingInferencePlugin.java- Service registrationLastest commit a818ac3
Service registration
Inference test call
Response