diff --git a/clients/ui/bff/internal/mocks/static_data_mock.go b/clients/ui/bff/internal/mocks/static_data_mock.go index ec21b4f45b..e54cf46f33 100644 --- a/clients/ui/bff/internal/mocks/static_data_mock.go +++ b/clients/ui/bff/internal/mocks/static_data_mock.go @@ -362,7 +362,7 @@ func GetCatalogModelMocks() []models.CatalogModel { Description: stringToPointer("Granite-8B-Code-Instruct is a 8B parameter model fine tuned from\nGranite-8B-Code-Base on a combination of permissively licensed instruction\ndata to enhance instruction following capabilities including logical\nreasoning and problem-solving skills."), Provider: stringToPointer("provider1"), Tasks: []string{"text-generation", "image-to-text"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), LicenseLink: stringToPointer("https://www.apache.org/licenses/LICENSE-2.0.txt"), Maturity: stringToPointer("Technology preview"), Language: []string{"ar", "cs", "de", "en", "es", "fr", "it", "ja", "ko", "nl", "pt", "zh"}, @@ -716,7 +716,7 @@ Granite 3.1 Instruct Models are primarily finetuned using instruction-response p Description: stringToPointer("Granite 8B Code Instruct - INT4 quantized variant for efficient inference"), Provider: stringToPointer("Provider one"), Tasks: []string{"text-generation", "image-text-to-text"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("sample-source"), @@ -729,7 +729,7 @@ Granite 3.1 Instruct Models are primarily finetuned using instruction-response p Description: stringToPointer("Granite 8B Code Instruct - INT8 quantized variant for balanced performance"), Provider: stringToPointer("IBM"), Tasks: []string{"audio-to-text", "text-to-text", "video-to-text"}, - License: stringToPointer("mit"), + License: stringToPointer("MIT"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("sample-source"), @@ -742,7 +742,7 @@ Granite 3.1 Instruct Models are primarily finetuned using instruction-response p Description: stringToPointer("Granite 8B Code Instruct - BF16 variant for high precision"), Provider: stringToPointer("IBM"), Tasks: []string{"text-generation", "code-generation"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("sample-source"), @@ -755,7 +755,7 @@ Granite 3.1 Instruct Models are primarily finetuned using instruction-response p Description: stringToPointer("BERT base model (uncased) - Pretrained model on English language"), Provider: stringToPointer("Google"), Tasks: []string{"audio-to-text", "text-to-text"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("huggingface"), @@ -796,7 +796,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("GPT-2 is a transformers model pretrained on a very large corpus of English data"), Provider: stringToPointer("provider3"), Tasks: []string{"video-to-text"}, - License: stringToPointer("mit"), + License: stringToPointer("MIT"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("huggingface"), @@ -808,7 +808,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("DistilBERT base model (uncased) - A smaller, faster version of BERT"), Provider: stringToPointer("Hugging Face"), Tasks: []string{"fill-mask", "text-classification"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("huggingface"), @@ -820,7 +820,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("sample description"), Provider: stringToPointer("Admin model 1"), Tasks: []string{"code-generation", "instruction-following"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("adminModel2"), @@ -831,7 +831,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("sample description"), Provider: stringToPointer("Admin model 2"), Tasks: []string{"text-generation", "conversational"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Maturity: stringToPointer("Generally Available"), Language: []string{"en"}, SourceId: stringToPointer("adminModel1"), @@ -842,7 +842,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("Model without performance data"), Provider: stringToPointer("Test Provider"), Tasks: []string{"text-generation"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), Language: []string{"en"}, SourceId: stringToPointer("no-perf-source"), } @@ -855,7 +855,7 @@ python -c "from transformers import pipeline; nlp = pipeline('fill-mask', model= Description: stringToPointer("Granite-8B-Code-Instruct is a 8B parameter model fine tuned from\nGranite-8B-Code-Base on a combination of permissively licensed instruction\ndata to enhance instruction following capabilities including logical\nreasoning and problem-solving skills."), Provider: stringToPointer("provider1"), Tasks: []string{"text-generation"}, - License: stringToPointer("apache-2.0"), + License: stringToPointer("Apache 2.0"), LicenseLink: stringToPointer("https://www.apache.org/licenses/LICENSE-2.0.txt"), Maturity: stringToPointer("Technology preview"), Language: []string{"ar", "cs", "de", "en", "es", "fr", "it", "ja", "ko", "nl", "pt", "zh"}, @@ -1711,7 +1711,7 @@ func GetFilterOptionMocks() map[string]models.FilterOption { Values: []interface{}{ "Apache 2.0", "Gemma License", "Llama 3.1 Community License", "Llama 3.3 Community License", "Llama 4 Community License", "MIT", - "NVIDIA Open Model License", "modified-mit", + "NVIDIA Open Model License", "Modified MIT", }, } diff --git a/clients/ui/frontend/src/__mocks__/mockCatalogFilterOptionsList.ts b/clients/ui/frontend/src/__mocks__/mockCatalogFilterOptionsList.ts index b5c65cae52..2d57d8495e 100644 --- a/clients/ui/frontend/src/__mocks__/mockCatalogFilterOptionsList.ts +++ b/clients/ui/frontend/src/__mocks__/mockCatalogFilterOptionsList.ts @@ -3,7 +3,6 @@ import { CatalogFilterOptionsList, NamedQuery, FilterOperator } from '~/app/mode import { ModelCatalogStringFilterKey, ModelCatalogNumberFilterKey, - ModelCatalogLicense, ModelCatalogProvider, ModelCatalogTask, AllLanguageCode, @@ -70,7 +69,7 @@ export const mockCatalogFilterOptionsList = ( }, [ModelCatalogStringFilterKey.LICENSE]: { type: 'string', - values: [ModelCatalogLicense.APACHE_2_0, ModelCatalogLicense.MIT], + values: ['Apache 2.0', 'MIT'], }, [ModelCatalogStringFilterKey.TASK]: { type: 'string', diff --git a/clients/ui/frontend/src/app/modelCatalogTypes.ts b/clients/ui/frontend/src/app/modelCatalogTypes.ts index e994d548f4..8644208f53 100644 --- a/clients/ui/frontend/src/app/modelCatalogTypes.ts +++ b/clients/ui/frontend/src/app/modelCatalogTypes.ts @@ -2,7 +2,6 @@ import { APIOptions } from 'mod-arch-core'; import { ModelCatalogTask, ModelCatalogProvider, - ModelCatalogLicense, AllLanguageCode, ModelCatalogStringFilterKey, ModelCatalogNumberFilterKey, @@ -283,7 +282,7 @@ export type { ModelCatalogFilterKey }; export type ModelCatalogStringFilterValueType = { [ModelCatalogStringFilterKey.TASK]: ModelCatalogTask; [ModelCatalogStringFilterKey.PROVIDER]: ModelCatalogProvider; - [ModelCatalogStringFilterKey.LICENSE]: ModelCatalogLicense; + [ModelCatalogStringFilterKey.LICENSE]: string; [ModelCatalogStringFilterKey.LANGUAGE]: AllLanguageCode; [ModelCatalogStringFilterKey.TENSOR_TYPE]: ModelCatalogTensorType; [ModelCatalogStringFilterKey.HARDWARE_TYPE]: string; @@ -349,7 +348,7 @@ export type ComputedPerformanceProperties = { export type ModelCatalogFilterStates = { [ModelCatalogStringFilterKey.TASK]: ModelCatalogTask[]; [ModelCatalogStringFilterKey.PROVIDER]: ModelCatalogProvider[]; - [ModelCatalogStringFilterKey.LICENSE]: ModelCatalogLicense[]; + [ModelCatalogStringFilterKey.LICENSE]: string[]; [ModelCatalogStringFilterKey.LANGUAGE]: AllLanguageCode[]; [ModelCatalogStringFilterKey.TENSOR_TYPE]: ModelCatalogTensorType[]; [ModelCatalogStringFilterKey.HARDWARE_TYPE]: string[]; diff --git a/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogActiveFilters.tsx b/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogActiveFilters.tsx index 00f94b80ad..60189731dc 100644 --- a/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogActiveFilters.tsx +++ b/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogActiveFilters.tsx @@ -8,13 +8,11 @@ import { ModelCatalogContext } from '~/app/context/modelCatalog/ModelCatalogCont import { ModelCatalogStringFilterKey, MODEL_CATALOG_PROVIDER_NAME_MAPPING, - MODEL_CATALOG_LICENSE_NAME_MAPPING, MODEL_CATALOG_TASK_NAME_MAPPING, AllLanguageCodesMap, MODEL_CATALOG_FILTER_CATEGORY_NAMES, MODEL_CATALOG_FILTER_CHIP_PREFIXES, ModelCatalogProvider, - ModelCatalogLicense, ModelCatalogTask, AllLanguageCode, ModelCatalogNumberFilterKey, @@ -97,9 +95,7 @@ const ModelCatalogActiveFilters: React.FC = ({ f : valueStr; } case ModelCatalogStringFilterKey.LICENSE: { - return isEnumMember(valueStr, ModelCatalogLicense) - ? MODEL_CATALOG_LICENSE_NAME_MAPPING[valueStr] - : valueStr; + return valueStr; } case ModelCatalogStringFilterKey.TASK: { return isEnumMember(valueStr, ModelCatalogTask) diff --git a/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogStringFilter.tsx b/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogStringFilter.tsx index 9798e98eb9..af10bf4f1a 100644 --- a/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogStringFilter.tsx +++ b/clients/ui/frontend/src/app/pages/modelCatalog/components/ModelCatalogStringFilter.tsx @@ -15,14 +15,14 @@ function isFilterMappingKey(obj: Partial>, s type ModelCatalogStringFilterProps = { title: string; filterKey: K; - filterToNameMapping: Partial>; + filterToNameMapping?: Partial>; filters: ModelCatalogStringFilterOptions[K]; }; const ModelCatalogStringFilter = ({ title, filterKey, - filterToNameMapping, + filterToNameMapping = {}, filters, }: ModelCatalogStringFilterProps): JSX.Element => { const { filterData } = React.useContext(ModelCatalogContext); diff --git a/clients/ui/frontend/src/app/pages/modelCatalog/components/globalFilters/LicenseFilter.tsx b/clients/ui/frontend/src/app/pages/modelCatalog/components/globalFilters/LicenseFilter.tsx index 224476f90c..d1d9a367f1 100644 --- a/clients/ui/frontend/src/app/pages/modelCatalog/components/globalFilters/LicenseFilter.tsx +++ b/clients/ui/frontend/src/app/pages/modelCatalog/components/globalFilters/LicenseFilter.tsx @@ -1,10 +1,7 @@ import * as React from 'react'; import { Divider, StackItem } from '@patternfly/react-core'; import ModelCatalogStringFilter from '~/app/pages/modelCatalog/components/ModelCatalogStringFilter'; -import { - ModelCatalogStringFilterKey, - MODEL_CATALOG_LICENSE_NAME_MAPPING, -} from '~/concepts/modelCatalog/const'; +import { ModelCatalogStringFilterKey } from '~/concepts/modelCatalog/const'; import { CatalogFilterOptions, ModelCatalogStringFilterOptions } from '~/app/modelCatalogTypes'; const filterKey = ModelCatalogStringFilterKey.LICENSE; @@ -26,7 +23,6 @@ const LicenseFilter: React.FC = ({ filters }) => { title="License" filterKey={filterKey} - filterToNameMapping={MODEL_CATALOG_LICENSE_NAME_MAPPING} filters={license} /> diff --git a/clients/ui/frontend/src/app/pages/modelCatalog/utils/__tests__/modelCatalogUtils.spec.ts b/clients/ui/frontend/src/app/pages/modelCatalog/utils/__tests__/modelCatalogUtils.spec.ts index 40a178d45b..99629039ad 100644 --- a/clients/ui/frontend/src/app/pages/modelCatalog/utils/__tests__/modelCatalogUtils.spec.ts +++ b/clients/ui/frontend/src/app/pages/modelCatalog/utils/__tests__/modelCatalogUtils.spec.ts @@ -11,7 +11,6 @@ import { } from '~/app/modelCatalogTypes'; import { AllLanguageCode, - ModelCatalogLicense, ModelCatalogNumberFilterKey, ModelCatalogProvider, ModelCatalogStringFilterKey, @@ -52,7 +51,7 @@ describe('filtersToFilterQuery', () => { ttft_mean = undefined, }: { tasks?: ModelCatalogTask[]; - license?: ModelCatalogLicense[]; + license?: string[]; provider?: ModelCatalogProvider[]; language?: AllLanguageCode[]; hardware_type?: string[]; @@ -107,16 +106,7 @@ describe('filtersToFilterQuery', () => { }, [ModelCatalogStringFilterKey.LICENSE]: { type: 'string', - values: [ - ModelCatalogLicense.APACHE_2_0, - ModelCatalogLicense.GEMMA, - ModelCatalogLicense.LLLAMA_3_3, - ModelCatalogLicense.LLLAMA_3_1, - ModelCatalogLicense.LLLAMA_3_3_ALTERNATE, - ModelCatalogLicense.LLLAMA_4, - ModelCatalogLicense.MIT, - ModelCatalogLicense.MODIFIED_MIT, - ], + values: ['Apache 2.0', 'Gemma', 'Llama 3.3', 'Llama 3.1', 'Llama 4', 'MIT', 'Modified MIT'], }, [ModelCatalogStringFilterKey.LANGUAGE]: { type: 'string', @@ -233,11 +223,8 @@ describe('filtersToFilterQuery', () => { ), ).toBe("provider='Google'"); expect( - filtersToFilterQuery( - mockFormData({ license: [ModelCatalogLicense.APACHE_2_0] }), - mockFilterOptions, - ), - ).toBe("license='apache-2.0'"); + filtersToFilterQuery(mockFormData({ license: ['Apache 2.0'] }), mockFilterOptions), + ).toBe("license='Apache 2.0'"); expect( filtersToFilterQuery(mockFormData({ language: [AllLanguageCode.CA] }), mockFilterOptions), ).toBe("language='ca'"); @@ -260,11 +247,11 @@ describe('filtersToFilterQuery', () => { filtersToFilterQuery( mockFormData({ tasks: [ModelCatalogTask.TEXT_TO_TEXT], - license: [ModelCatalogLicense.APACHE_2_0], + license: ['Apache 2.0'], }), mockFilterOptions, ), - ).toBe("tasks='text-to-text' AND license='apache-2.0'"); + ).toBe("tasks='text-to-text' AND license='Apache 2.0'"); expect( filtersToFilterQuery( mockFormData({ provider: [ModelCatalogProvider.GOOGLE], language: [AllLanguageCode.CA] }), @@ -287,11 +274,8 @@ describe('filtersToFilterQuery', () => { ), ).toBe("provider IN ('Google','DeepSeek')"); expect( - filtersToFilterQuery( - mockFormData({ license: [ModelCatalogLicense.APACHE_2_0, ModelCatalogLicense.MIT] }), - mockFilterOptions, - ), - ).toBe("license IN ('apache-2.0','mit')"); + filtersToFilterQuery(mockFormData({ license: ['Apache 2.0', 'MIT'] }), mockFilterOptions), + ).toBe("license IN ('Apache 2.0','MIT')"); expect( filtersToFilterQuery( mockFormData({ language: [AllLanguageCode.CA, AllLanguageCode.PT] }), @@ -330,7 +314,7 @@ describe('filtersToFilterQuery', () => { mockFormData({ tasks: [ModelCatalogTask.TEXT_TO_TEXT, ModelCatalogTask.IMAGE_TO_TEXT], provider: [ModelCatalogProvider.GOOGLE], - license: [ModelCatalogLicense.MIT], + license: ['MIT'], language: [ AllLanguageCode.CA, AllLanguageCode.PT, @@ -341,7 +325,7 @@ describe('filtersToFilterQuery', () => { mockFilterOptions, ), ).toBe( - "tasks IN ('text-to-text','image-to-text') AND provider='Google' AND license='mit' AND language IN ('ca','pt','vi','zsm')", + "tasks IN ('text-to-text','image-to-text') AND provider='Google' AND license='MIT' AND language IN ('ca','pt','vi','zsm')", ); }); @@ -385,13 +369,13 @@ describe('filtersToFilterQuery', () => { // mockFormData({ // ttft_mean: 100, // tasks: [ModelCatalogTask.TEXT_TO_TEXT], - // license: [ModelCatalogLicense.APACHE_2_0, ModelCatalogLicense.MIT], + // license: ['Apache 2.0', 'MIT'], // rps_mean: 3, // }), // mockFilterOptions, // ), // ).toBe( - // "tasks='text-to-text' AND license IN ('apache-2.0','mit') AND ttft_mean < 100 AND rps_mean > 3", + // "tasks='text-to-text' AND license IN ('Apache 2.0','MIT') AND ttft_mean < 100 AND rps_mean > 3", // ); // }); // }); @@ -815,7 +799,7 @@ describe('hasFiltersApplied', () => { ttft_mean = undefined, }: { tasks?: ModelCatalogTask[]; - license?: ModelCatalogLicense[]; + license?: string[]; provider?: ModelCatalogProvider[]; language?: AllLanguageCode[]; hardware_type?: string[]; @@ -870,7 +854,7 @@ describe('hasFiltersApplied', () => { expect(hasFiltersApplied(mockFormData({ provider: [ModelCatalogProvider.GOOGLE] }))).toBe( true, ); - expect(hasFiltersApplied(mockFormData({ license: [ModelCatalogLicense.MIT] }))).toBe(true); + expect(hasFiltersApplied(mockFormData({ license: ['MIT'] }))).toBe(true); expect(hasFiltersApplied(mockFormData({ language: [AllLanguageCode.EN] }))).toBe(true); expect(hasFiltersApplied(mockFormData({ hardware_type: ['GPU'] }))).toBe(true); expect(hasFiltersApplied(mockFormData({ use_case: [UseCaseOptionValue.CHATBOT] }))).toBe( diff --git a/clients/ui/frontend/src/concepts/modelCatalog/const.ts b/clients/ui/frontend/src/concepts/modelCatalog/const.ts index 1d982bb8a5..2e53872565 100644 --- a/clients/ui/frontend/src/concepts/modelCatalog/const.ts +++ b/clients/ui/frontend/src/concepts/modelCatalog/const.ts @@ -264,71 +264,6 @@ export enum ModelType { UNKNOWN = 'unknown', } -export enum ModelCatalogLicense { - APACHE_2_0 = 'apache-2.0', - GEMMA = 'gemma', - LLLAMA_3_3 = 'llama-3.3', - LLLAMA_3_1 = 'llama3.1', - LLLAMA_3_3_ALTERNATE = 'llama3.3', - LLLAMA_4 = 'llama4', - MIT = 'mit', - MODIFIED_MIT = 'modified-mit', -} - -export const MODEL_CATALOG_LICENSE_NAME_MAPPING = { - [ModelCatalogLicense.APACHE_2_0]: 'Apache 2.0', - [ModelCatalogLicense.GEMMA]: 'Gemma', - [ModelCatalogLicense.LLLAMA_3_3]: 'Llama 3.3', - [ModelCatalogLicense.LLLAMA_3_1]: 'Llama 3.1', - [ModelCatalogLicense.LLLAMA_3_3_ALTERNATE]: 'Llama 3.3 (variant)', - [ModelCatalogLicense.LLLAMA_4]: 'Llama 4', - [ModelCatalogLicense.MIT]: 'MIT', - [ModelCatalogLicense.MODIFIED_MIT]: 'Modified MIT', -}; - -export const MODEL_CATALOG_LICENSE_DETAILS = { - [ModelCatalogLicense.APACHE_2_0]: { - name: 'Apache 2.0', - type: 'Open Source', - description: 'Permissive Apache License 2.0', - }, - [ModelCatalogLicense.GEMMA]: { - name: 'Gemma', - type: 'Custom', - description: 'Google Gemma model license', - }, - [ModelCatalogLicense.LLLAMA_3_3]: { - name: 'Llama 3.3', - type: 'Custom', - description: 'Meta Llama 3.3 license', - }, - [ModelCatalogLicense.LLLAMA_3_1]: { - name: 'Llama 3.1', - type: 'Custom', - description: 'Meta Llama 3.1 license', - }, - [ModelCatalogLicense.LLLAMA_3_3_ALTERNATE]: { - name: 'Llama 3.3 (variant)', - type: 'Custom', - description: 'Meta Llama 3.3 license (variant)', - }, - [ModelCatalogLicense.LLLAMA_4]: { - name: 'Llama 4', - type: 'Custom', - description: 'Meta Llama 4 license', - }, - [ModelCatalogLicense.MIT]: { - name: 'MIT', - type: 'Open Source', - description: 'Permissive MIT license', - }, - [ModelCatalogLicense.MODIFIED_MIT]: { - name: 'Modified MIT', - type: 'Open Source', - description: 'Modified MIT license', - }, -}; - export enum EuropeanLanguagesCode { BG = 'bg', CA = 'ca',