Deploying a trained model
This section describes how to deploy a trained model using the AI & Analytics Engine via
- Using the GUI
- Using API access through SDK
Using the GUI
Creating a Deployment
Once a model has been built using the training data and evaluated on the test data, it can be deployed into a live prediction API. The "Deployment" asset refers to an endpoint where the prediction API has been taken live and invoked at any time. To create a deployment, one can either use the dashboard, or use the floating-action button from any model's detail page, or from the models' comparison page by hovering over the evaluated models' ratings:
|Method 1||Method 2|
Upon clicking on the "NEW DEPLOYMENT", a two-step menu will open. There are 2 possible options for deployment. One is to use the PI EXCHANGE Cloud environment. When clicking on this option and then "NEXT", you will need to select whether to create a new endpoint or use an existing one. When finished, you press "DEPLOY".
|Step 1||Step 2|
If an on-premise deployment is required a short deployment guide will appear in the second step. It will explain that the trained model will be packaged into a Docker image with explanations on how to serve the model.
Retrieving Deployment Information
Once the model is deployed you will be shown the deployment summary page. The page supplies some basic information on the deployed model, sample code of calling the API in multiple programming languages and also an API test.
Listing all Deployments in an App
To list all deployments of an app you can access the upper tabs ribbon in "DEPLOYMENTS". Clicking on it will open the deployments list where you get a short summary of each one. Clicking on the deployment in that list will bring you the the summary page of that deployment.
Updating/Deleting a Model
To update a model (Revoking API keys, generating new API keys or just copying the endpoint URL) you enter the "SETTINGS" tab on the tabs ribbon within the deployment page. Example:
In a similar manner, clicking on the garbage bin icon on the rightmost side of the ribbon will allow you to confirm the deletion of the specific deployment.
Using API access through SDK
To access the API functions, you need to first authenticate into the platform by the following
from aiaengine import api client = api.Client()
Then you need to import
model required in the next steps.
from aiaengine.api import model
Deploy a model
Now you can deploy the trained model once the evaluation meets your expection. Simply input the id of model and follow
client.models.DeployModel( model.DeployModelRequest( id='id_of_deployed_model', training_id=( client.models.GetModel( model.GetModelRequest(id='id_of_deployed_model') ) .last_success_training.id ) ) )