elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.62k stars 8.22k forks source link

[ML] Add support for returning `pt_tiny_elser` from the `ml.trainedModelsProvider.getELSER()` helper function #193633

Open spong opened 1 month ago

spong commented 1 month ago

In plumbing through the Security Assistant Knowledge Base API integration tests (https://github.com/elastic/kibana/pull/192665), I ended up having to add support for a modelId override to our API's when interacting with the Knowledge Base as we currently use the ml.trainedModelsProvider.getELSER() helper (which does not return pt_tiny_elser in test environments) to get the modelId for setting up ELSER, ingest pipelines, retrievers, etc. The O11y Assistant folks also have an open issue (https://github.com/elastic/kibana/issues/192757) to do the same.

It would be nice if the getELSER() helper function below could either be overridden to return pt_tiny_elser in our test environments, or if our test environments could be updated such that the function returns pt_tiny_elser.

https://github.com/elastic/kibana/blob/68a924411b9d88eb39b8f0b47b4ee22acab3f729/x-pack/plugins/ml/server/models/model_management/models_provider.ts#L542-L552

[!NOTE] Perhaps the need for this will go away or change somewhat when we switch from managing ELSER via the trainedModels API to using a default inference endpoint (https://github.com/elastic/kibana/issues/192461).

elasticmachine commented 1 month ago

Pinging @elastic/ml-ui (:ml)