diff --git a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts index 10e6618672f49..395b8640e4661 100644 --- a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts +++ b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts @@ -105,6 +105,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object defaultMessage: 'E5 (EmbEddings from bidirEctional Encoder rEpresentations)', }), license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small', type: ['pytorch', 'text_embedding'], }, '.multilingual-e5-small_linux-x86_64': { @@ -122,6 +123,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object 'E5 (EmbEddings from bidirEctional Encoder rEpresentations), optimized for linux-x86_64', }), license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64', type: ['pytorch', 'text_embedding'], }, } as const); @@ -142,9 +144,13 @@ export interface ModelDefinition { os?: string; arch?: string; default?: boolean; + /** Indicates if model version is recommended for deployment based on the cluster configuration */ recommended?: boolean; hidden?: boolean; + /** Software license of a model, e.g. MIT */ license?: string; + /** Link to the external license/documentation page */ + licenseUrl?: string; type?: readonly string[]; } diff --git a/x-pack/plugins/ml/public/application/model_management/add_model_flyout.tsx b/x-pack/plugins/ml/public/application/model_management/add_model_flyout.tsx index 6c69446b8725e..cf4efb4846fc0 100644 --- a/x-pack/plugins/ml/public/application/model_management/add_model_flyout.tsx +++ b/x-pack/plugins/ml/public/application/model_management/add_model_flyout.tsx @@ -226,18 +226,6 @@ const ClickToDownloadTabContent: FC = ({ /> - - - - - @@ -286,25 +274,45 @@ const ClickToDownloadTabContent: FC = ({ {model.model_id} - {model.recommended ? ( - - - } - > - - - - - - ) : null} + + + {model.recommended ? ( + + + } + > + + + + + + ) : null} + {model.licenseUrl && model.softwareLicense ? ( + + + {model.softwareLicense === 'MIT' ? ( + + ) : null} + + + ) : null} + + } name={model.model_id} diff --git a/x-pack/plugins/ml/public/application/model_management/models_list.tsx b/x-pack/plugins/ml/public/application/model_management/models_list.tsx index 0fc27fcb33fd4..0aebca5c1673c 100644 --- a/x-pack/plugins/ml/public/application/model_management/models_list.tsx +++ b/x-pack/plugins/ml/public/application/model_management/models_list.tsx @@ -91,6 +91,8 @@ export type ModelItem = TrainedModelConfigResponse & { modelName?: string; os?: string; arch?: string; + softwareLicense?: string; + licenseUrl?: string; }; export type ModelItemFull = Required; @@ -280,6 +282,8 @@ export const ModelsList: FC = ({ modelName: modelDefinition.modelName, os: modelDefinition.os, arch: modelDefinition.arch, + softwareLicense: modelDefinition.license, + licenseUrl: modelDefinition.licenseUrl, } as ModelItem; }); resultItems = [...resultItems, ...notDownloaded]; @@ -534,7 +538,7 @@ export const ModelsList: FC = ({ content={ } > diff --git a/x-pack/plugins/ml/server/models/model_management/model_provider.test.ts b/x-pack/plugins/ml/server/models/model_management/model_provider.test.ts index ff18327fdea5e..48c80ceca1a95 100644 --- a/x-pack/plugins/ml/server/models/model_management/model_provider.test.ts +++ b/x-pack/plugins/ml/server/models/model_management/model_provider.test.ts @@ -87,6 +87,7 @@ describe('modelsProvider', () => { version: 1, modelName: 'e5', license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small', type: ['pytorch', 'text_embedding'], }, { @@ -100,6 +101,7 @@ describe('modelsProvider', () => { version: 1, modelName: 'e5', license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64', type: ['pytorch', 'text_embedding'], }, ]); @@ -167,6 +169,7 @@ describe('modelsProvider', () => { modelName: 'e5', type: ['pytorch', 'text_embedding'], license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small', }, { arch: 'amd64', @@ -179,6 +182,7 @@ describe('modelsProvider', () => { modelName: 'e5', type: ['pytorch', 'text_embedding'], license: 'MIT', + licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64', }, ]); });