diff --git a/x-pack/plugins/ml/public/application/model_management/deployment_setup.tsx b/x-pack/plugins/ml/public/application/model_management/deployment_setup.tsx index 43e92be653c1b..4c47a6af44d45 100644 --- a/x-pack/plugins/ml/public/application/model_management/deployment_setup.tsx +++ b/x-pack/plugins/ml/public/application/model_management/deployment_setup.tsx @@ -631,6 +631,7 @@ interface StartDeploymentModalProps { cloudInfo: CloudInfo; deploymentParamsMapper: DeploymentParamsMapper; showNodeInfo: boolean; + nlpSettings: NLPSettings; } /** @@ -646,6 +647,7 @@ export const StartUpdateDeploymentModal: FC = ({ cloudInfo, deploymentParamsMapper, showNodeInfo, + nlpSettings, }) => { const isUpdate = !!initialParams; @@ -654,20 +656,22 @@ export const StartUpdateDeploymentModal: FC = ({ deploymentParamsMapper.mapApiToUiDeploymentParams(v) ); + const defaultVCPUUsage: DeploymentParamsUI['vCPUUsage'] = showNodeInfo ? 'medium' : 'low'; + return uiParams?.some((v) => v.optimized === 'optimizedForIngest') ? { deploymentId: `${model.model_id}_search`, optimized: 'optimizedForSearch', - vCPUUsage: 'medium', + vCPUUsage: defaultVCPUUsage, adaptiveResources: true, } : { deploymentId: `${model.model_id}_ingest`, optimized: 'optimizedForIngest', - vCPUUsage: 'medium', + vCPUUsage: defaultVCPUUsage, adaptiveResources: true, }; - }, [deploymentParamsMapper, model.model_id, model.stats?.deployment_stats]); + }, [deploymentParamsMapper, model.model_id, model.stats?.deployment_stats, showNodeInfo]); const [config, setConfig] = useState(initialParams ?? getDefaultParams()); @@ -722,7 +726,9 @@ export const StartUpdateDeploymentModal: FC = ({ onConfigChange={setConfig} errors={errors} isUpdate={isUpdate} - disableAdaptiveResourcesControl={!showNodeInfo} + disableAdaptiveResourcesControl={ + showNodeInfo ? false : !nlpSettings.modelDeployment.allowStaticAllocations + } deploymentsParams={model.stats?.deployment_stats.reduce< Record >((acc, curr) => { @@ -837,6 +843,7 @@ export const getUserInputModelDeploymentParamsProvider = const modalSession = overlays.openModal( toMountPoint(