Skip to main content

CREATE DEPLOYMENT

CREATE DEPLOYMENT creates or updates a deployment for a trained model.

Syntax

CREATE [ OR REPLACE ] [ IF NOT EXISTS ] DEPLOYMENT deployment_name
[ TO engine_name ]
USING (
model_name [ VERSION model_version ]
)*
[ COMMENT 'comment' ]

Deployment name

A unique name for the deployment.

Engine name

An optional serving engine name to host the deployed model, if empty will deploy to the default serving engine.

Model

  • Name: the name of the model to deploy.
  • Version: the optional model version number.

Comment

An optional comment to save for this deployment version.

Output

A new deployment will be created if one doesn't exist, or else a deployment will be updated to host the latest model or version if specified. The previous model version will still continue to be hosted until the next deployment is successful.

If a deployment fails, a version will be created to revert to the previous model. The output will include both the failed record with an error message, and the new verted version.

The output will include the following columns:

  • deployment_name - the name deployment.
  • deployment_version - the deployment version.
  • engine_name - the name of the serving engine.
  • model_name - the name of the model.
  • model_version - the verison of the model.
  • url - the qualified url for this particular deployment verison.
  • comment - the optional comment associated with the deployment.
  • error - the optional error captured for a failed deployment.

Examples

The following will deploy the latest titanic model to the default serving engine:

CREATE DEPLOYMENT IF NOT EXISTS my_deployment USING titanic

The following will update my_deployment to host version 2 of the titanic model in a new serving engine:

CREATE OR REPLACE DEPLOYMENT my_deployment to gpu_serving_engine USING titanic VERSION 2
COMMENT 'retrain of model on fresh data'