

# Deploy a Compiled Model Using the Console
<a name="neo-deployment-hosting-services-console"></a>

You must satisfy the [ prerequisites](https://docs.aws.amazon.com//sagemaker/latest/dg/neo-deployment-hosting-services-prerequisites) section if the model was compiled using AWS SDK for Python (Boto3), the AWS CLI, or the Amazon SageMaker AI console. Follow the steps below to create and deploy a SageMaker AI Neo-compiled model using the SageMaker AI console[https://console.aws.amazon.com/ SageMaker AI](https://console.aws.amazon.com/sagemaker/).

**Topics**
+ [Deploy the Model](#deploy-the-model-console-steps)

## Deploy the Model
<a name="deploy-the-model-console-steps"></a>

 After you have satisfied the [ prerequisites](https://docs.aws.amazon.com//sagemaker/latest/dg/neo-deployment-hosting-services-prerequisites), use the following steps to deploy a model compiled with Neo: 

1. Choose **Models**, and then choose **Create models** from the **Inference** group. On the **Create model** page, complete the **Model name**,** IAM role**, and **VPC** fields (optional), if needed.  
![\[Create Neo model for inference\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/create-pipeline-model.png)

1. To add information about the container used to deploy your model, choose **Add container** container, then choose **Next**. Complete the **Container input options**, **Location of inference code image**, and **Location of model artifacts**, and optionally, **Container host name**, and **Environmental variables** fields.  
![\[Create Neo model for inference\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/neo-deploy-console-container-definition.png)

1. To deploy Neo-compiled models, choose the following:
   + **Container input options**: Choose **Provide model artifacts and inference image**.
   + **Location of inference code image**: Choose the inference image URI from [Neo Inference Container Images](https://docs.aws.amazon.com/sagemaker/latest/dg/neo-deployment-hosting-services-container-images.html), depending on the AWS Region and kind of application. 
   + **Location of model artifact**: Enter the Amazon S3 bucket URI of the compiled model artifact generated by the Neo compilation API.
   + **Environment variables**:
     + Leave this field blank for **SageMaker XGBoost**.
     + If you trained your model using SageMaker AI, specify the environment variable `SAGEMAKER_SUBMIT_DIRECTORY` as the Amazon S3 bucket URI that contains the training script. 
     + If you did not train your model using SageMaker AI, specify the following environment variables:     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/sagemaker/latest/dg/neo-deployment-hosting-services-console.html)

1. Confirm that the information for the containers is accurate, and then choose **Create model**. On the **Create model landing page**, choose **Create endpoint**.   
![\[Create Model landing page\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/neo-deploy-console-create-model-land-page.png)

1. In **Create and configure endpoint** diagram, specify the **Endpoint name**. For **Attach endpoint configuration**, choose **Create a new endpoint configuration**.  
![\[Neo console create and configure endpoint UI.\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/neo-deploy-console-config-endpoint.png)

1. In **New endpoint configuration** page, specify the **Endpoint configuration name**.   
![\[Neo console new endpoint configuration UI.\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/neo-deploy-console-new-endpoint-config.png)

1. Choose **Edit** next to the name of the model and specify the correct **Instance type** on the **Edit Production Variant** page. It is imperative that the **Instance type** value match the one specified in your compilation job.  
![\[Neo console new endpoint configuration UI.\]](http://docs.aws.amazon.com/sagemaker/latest/dg/images/neo-deploy-console-edit-production-variant.png)

1. Choose **Save**.

1. On the **New endpoint configuration** page, choose **Create endpoint configuration**, and then choose **Create endpoint**. 