@@ -5,6 +5,7 @@ import SimpleSelect from '@odh-dashboard/internal/components/SimpleSelect';
55import { FieldValidationProps } from '@odh-dashboard/internal/hooks/useZodFormValidation' ;
66import { ZodErrorHelperText } from '@odh-dashboard/internal/components/ZodErrorFormHelperText' ;
77import { ServingRuntimeModelType } from '@odh-dashboard/internal/types' ;
8+ import { SupportedArea , useIsAreaAvailable } from '@odh-dashboard/internal/concepts/areas' ;
89import { ModelTypeLabel } from '../types' ;
910
1011// Schema
@@ -60,42 +61,46 @@ export const ModelTypeSelectField: React.FC<ModelTypeSelectFieldProps> = ({
6061 validationProps,
6162 validationIssues = [ ] ,
6263 isEditing,
63- } ) => (
64- < >
65- < FormGroup fieldId = "model-type-select" label = "Model type" isRequired >
66- < SimpleSelect
67- options = { [
68- {
69- key : ServingRuntimeModelType . PREDICTIVE ,
70- label : ModelTypeLabel . PREDICTIVE ,
71- } ,
72- {
73- key : ServingRuntimeModelType . GENERATIVE ,
74- label : ModelTypeLabel . GENERATIVE ,
75- } ,
76- ] }
77- onChange = { ( key ) => {
78- if ( isValidModelType ( key ) ) {
79- setModelType ?.( { type : key , legacyVLLM : false } ) ;
80- }
81- } }
82- onBlur = { validationProps ?. onBlur }
83- placeholder = "Select model type"
84- value = { modelType ?. type }
85- toggleProps = { { style : { minWidth : '300px' } } }
86- dataTestId = "model-type-select"
87- isDisabled = { isEditing || isDisabled }
88- />
89- < ZodErrorHelperText zodIssue = { validationIssues } />
90- </ FormGroup >
91- { modelType ?. type === ServingRuntimeModelType . GENERATIVE && (
92- < Checkbox
93- id = "legacy-mode-checkbox"
94- data-testid = "legacy-mode-checkbox"
95- label = "Deploy this model in legacy mode using a serving runtime and inference server"
96- isChecked = { modelType . legacyVLLM }
97- onChange = { ( _e , checked ) => setModelType ?.( { ...modelType , legacyVLLM : checked } ) }
98- />
99- ) }
100- </ >
101- ) ;
64+ } ) => {
65+ const isVLLMOnMaaSEnabled = useIsAreaAvailable ( SupportedArea . VLLM_ON_MAAS ) . status ;
66+
67+ return (
68+ < >
69+ < FormGroup fieldId = "model-type-select" label = "Model type" isRequired >
70+ < SimpleSelect
71+ options = { [
72+ {
73+ key : ServingRuntimeModelType . PREDICTIVE ,
74+ label : ModelTypeLabel . PREDICTIVE ,
75+ } ,
76+ {
77+ key : ServingRuntimeModelType . GENERATIVE ,
78+ label : ModelTypeLabel . GENERATIVE ,
79+ } ,
80+ ] }
81+ onChange = { ( key ) => {
82+ if ( isValidModelType ( key ) ) {
83+ setModelType ?.( { type : key , legacyVLLM : false } ) ;
84+ }
85+ } }
86+ onBlur = { validationProps ?. onBlur }
87+ placeholder = "Select model type"
88+ value = { modelType ?. type }
89+ toggleProps = { { style : { minWidth : '300px' } } }
90+ dataTestId = "model-type-select"
91+ isDisabled = { isEditing || isDisabled }
92+ />
93+ < ZodErrorHelperText zodIssue = { validationIssues } />
94+ </ FormGroup >
95+ { isVLLMOnMaaSEnabled && modelType ?. type === ServingRuntimeModelType . GENERATIVE && (
96+ < Checkbox
97+ id = "legacy-mode-checkbox"
98+ data-testid = "legacy-mode-checkbox"
99+ label = "Deploy this model in legacy mode using a serving runtime and inference server"
100+ isChecked = { modelType . legacyVLLM }
101+ onChange = { ( _e , checked ) => setModelType ?.( { ...modelType , legacyVLLM : checked } ) }
102+ />
103+ ) }
104+ </ >
105+ ) ;
106+ } ;
0 commit comments