Updating a Model Deployment using API

You can update the configuration of a Model Deployment without recreating it. Updates are performed using a PATCH request that specifies the fields to modify in updateMask and provides their new values in spec. All the other fields remain unchanged.

The following example changes the replica range of a Model Deployment:
curl -s -X PATCH -H "Content-Type: application/json" -H "Authorization: Bearer ${AWC_TOKEN}" "https://${DOMAIN}/api/v1/deployments/[***DEPLOYMENT_ID***]" -d '{"updateMask": "spec.autoscaling.minReplicas,spec.autoscaling.maxReplicas", "spec": {"autoscaling": {"minReplicas": 1, "maxReplicas": 3}}}'

The updateMask value is a comma-separated list of field paths. Each path starts at spec and uses camelCase notation. Fields that are not included in updateMask retain their current values, regardless of what is provided in spec. The spec.task and spec.deploymentMode fields cannot be changed after the deployment is created.

For text generation deployments running in Knative mode, updates that modify the pod template cause the service to scale down the previous revision before starting the new one in order to free GPU resources. During this transition, a short period without active serving replicas is expected while the new revision loads the model.