- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
[ML] Add ContextualAI inference service #134933
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
[ML] Add ContextualAI inference service #134933
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  | 
    
| 
           Pinging @elastic/ml-core (Team:ML)  | 
    
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.
LGTM
| 
           @elasticmachine test this please  | 
    
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.
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
        
      | 
           @elasticmachine test this please  | 
    
| 
           @davidkyle - thank you for your support. Happy to make any further changes if necessary.  | 
    
| 
           @elasticmachine test this please  | 
    
| 
           @elasticmachine test this please  | 
    
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.
LGTM
…-dls * upstream/main: [ML] Add ContextualAI inference service (elastic#134933)
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