[Inference API] Add Completion Inference API for Alibaba Cloud AI Search Model#112512
Conversation
|
Pinging @elastic/ml-core (Team:ML) |
|
Hi, @davidkyle, we have an LLM called qwen in Alibaba Cloud, and we provide inference services for it, here is the Completion Inference API, can you help review it? |
|
@elasticmachine test this please |
|
Thank you @weizijun, I'm excited another contribution from you. |
davidkyle
left a comment
There was a problem hiding this comment.
The code looks good. I have a question about why the input must be an odd number of strings, I don't understand the reason for that. Thank you.
hi @davidkyle , Thank you for taking the time to review my code. I really appreciate it! The reason we check the input is that Alibaba Cloud's completion API supports the functionality for historical conversations. For example: For details, you can refer to the messages parameter in the body of this document: https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-generation-api-details Due to limitations in the inference framework, currently in our implementation, if there are more than one input parameter, we process the first n inputs as history queries and history answers, and use the last parameter as the current query, so we check the number of inputs. we are also considering placing the historical Q&A in task_settings with a format similar to the one below: This way, the input parameters will only require the current query to be filled in. |
|
hi~ @davidkyle |
|
Thanks @Huaixinww, your idea for adding history is very inventive given the restrictions of the inference API design, this is a very imaginative solution. In future we want to expose all the options in the Alibaba API so the user can explicitly set the message history and any other options. Starting with your example, I ran this completion: And the history is clearly considered in the response. |
|
@elasticmachine test this please |
|
@elasticmachine update branch |
|
@elasticmachine test this please |
…inference/external/action/alibabacloudsearch/AlibabaCloudSearchCompletionAction.java
|
@elasticmachine test this please |
|
@elasticmachine test this please |
|
@elasticmachine update branch |
|
@elasticmachine test this please |
|
@szabosteve please can you update the docs with the new completion task |
💚 Backport successful
|
Related to #111181
Add Completion Inference API for Alibaba Cloud AI Search Model.
Prerequisites to Model Creation
An Alibaba Cloud Account with Alibaba Cloud Opensearch access
An api key used to access Alibaba Cloud AI Search Model
Inference Model Creation:
Testing
Creating the inference endpoint for Alibaba Cloud AI Search
Performing completion inference: