Model Management
Once a model is deployed, it is accessible through the Promote platform.
Home page
Models are visible on the Home page. Newly deployed models are listed in the Dev column. Models that are under consideration for production are listed in the Staging column. Models that are in use are listed in the Production column.
To promote a model to the next level, click on the model's down arrow and select promote. To return a model to development from staging, click the down arrow and select reject.
Each time a new model is deployed, Promote archives the previous version, encrypts it, and persist it to disk. Only one version of a given user's model can be running at a time. This ensures that all traffic to a named model is returned by the version that is currently online.
All models that are deployed to Promote are given a route, which is the URL that POST requests are sent to when a predictive request is made.
All user-level models, found in the Dev and Staging columns, have a route with the pattern:
/promote-url/<user_name>/models/<model_name>/
https://promotesandbox.alteryx.com/colin/models/HelloWorld/
- User: colin
- Model: HelloWorld
- Production: False
Separating models that are in development from those that are running in production is an important part of deploying predictive models.
To facilitate this, Promote ships with a dedicated "production" route that can be used to separate user-level models from models that are integrated into production systems.
/promote-url/production/models/<model_name>/
https://promotesandbox.alteryx.com/production/models/HelloWorld/
- User: production
- Model: HelloWorld
- Production: True
Because these models have the production route, they are handled separately from the user-level models.
To manage a model, click the related down arrow and click view latest build.
The Overview tab provides general information about the model you selected.
- The Info section provides you with this information about the model:
- Name
- Type
- Replications
- Version
- API Endpoint
-
The Code section displays the actual code for the model (only for Python models).
-
The Objects section lists any objects the model uses (only for Python models).
-
The Packages section lists the name of packages the model requires, as well as their corresponding versions.
The Execute tab provides a test area for a model. Input your model code in the field on the left and click Execute Model. The results of the model test will populate the display on the right.
Models from Designer
To test Alteryx models, use the Score tool in Designer.
The Samples tab provides code to execute the selected model in various languages, including:
- cURL
- R
- Python
- Ruby
- Java
- PHP
- Salesforce
- Node.js
Select the appropriate language tab, copy the code, and paste the code snippet into your production environment.
The Versions tab provides a list of the previous versions of the selected model, up to and including the current deployment. The Metadata section provides metadata information that was added when the model was deployed. To learn how to add metadata to your models, see Python Client or R Client.
A model selected from the Dev or Staging columns will include all previous versions. A model selected from the Production column only shows production versions of the model.
To switch to a previous version of a model:
- Review the version history to find the model version you want to deploy.
- Click redeploy.
A deployment occurs for that version of the model. The current version of the model remains active until the version being deployed is ready. A zero-downtime switch is made and the previous version of your model is online and ready to receive predictions.
The Logs tab provides the most recent log output from the model.
The Analytics tab acts as a monitoring dashboard, providing information on requests, model latency, failures and successes. The time range can be selected to visualize different time scales, from the last hour to the last 14 days. The aggregations and graphs update to match the selection. By default, the last day is shown.
Aggregations of key details are displayed.
- Requests: Total number of requests made against the model.
- Failures: Total number of requests that failed.
- Success Rate: The percentage of successful requests out of the total requests made.
- Avg Latency: The average latency rate between request made and response returned.
The graphs depict request details across the time frame.
- Total Requests: Each request made against the model.
- Response Codes: The response code returned.
- Mean Latency: The average latency in ms.
The History tab provides a list of all prediction requests made of the model. To set controls for prediction logging, see Admin.
The table displays the following information:
- Promote ID: Promote assigns a unique ID to each request made.
- Time: The time and date the request was made.
- Version: The version of model the request was made against.
- Response: The response code returned, colored green for success or red for failure. Information on a specific HTTP status codes can be found at httpstatuses.com.
- Codes in the 200s indicates success.
- Codes in the 300s indicate redirection.
- Codes in the 400s indicate client response errors.
- Codes in the 500s indicate server response errors.
- Input/Output: Click Show to open a code container with information about the input data and output results. This information is specific to your model.
To close the container, click Hide.
Filters: The list provided can be filtered by Date, Response Code type, and Model Version. Click Reset All to remove all filters.
The Advanced tab provides control over the model environment.
A Base Image for either Python or R can be saved by typing or pasting the image reference into the text field and clicking Save.
Resources can be allocated to a model using the controls for Number of Replications. Increase or decrease the number of replicas available with the arrows and click Save to update the resources dedicated to the model.
Set Environment Variables by clicking the plus icon.
New environment variables
Adding or removing a new environment variable will cause the model to rebuild.
Type or paste the Name and Value into the text fields and click Save.
Values can be updated without removing the variable by typing in the Value text field on the list display.
To remove an environment variable, click the down arrow on the associated line. Select Delete from the dropdown menu.
To redeploy the model, click restart.
To delete the model, click delete, and click Confirm on the confirmation window.
Promote offers a series of API endpoints that allow you to interact with your Promote models using a remote Bash terminal (for Windows users, we recommend Git Bash).
Authentication Requirements
Before you can interact with the API endpoints, you must acquire an access token from Promote:
# Replace "MANAGER" with the IP address of your manager node. # Replace "USERNAME" with your Promote username. # Replace "PASSWORD" with your Promote password. curl 'http://MANAGER/api/login' -H 'Content-Type: application/json' --data '{"username":"USERNAME","password":"PASSWORD"}'
Promote returns an access token. Keep it someplace secure, because you need it to request information from the API endpoints.
List model names
Have the Promote API return the names of the models it hosts:
# Replace "ACCESS_TOKEN" with the access token Promote provided to you. # Replace "MANAGER" with the IP address of your manager server. curl -X GET -H "Content-Type: application/json" -H 'Authorization: Bearer ACCESS_TOKEN' https://MANAGER/api/models
See model versions
Have the Promote API return the versions of the models it hosts:
# Replace "ACCESS_TOKEN" with the access token Promote provided to you. # Replace "MANAGER" with the IP address of your manager server. # Replace "USERNAME" with your Promote username. Replace "MODELNAME" with the name of the Promote model. curl -X GET -H "Content-Type: application/json" -H 'Authorization: Bearer ACCESS_TOKEN' http://MANAGER/api/models/USERNAME/MODELNAME/info
Get Promote system information
Have the Promote API return information about the status of your system:
# Replace "ACCESS_TOKEN" with the access token Promote provided to you. # lReplace "MANAGER" with the IP address of your manager server curl -X GET -H "Content-Type: application/json" -H 'Authorization: Bearer ACCESS_TOKEN' http://MANAGER/api/metrics
Post predictions
Have the Promote API make a prediction based on data you provide:
# Replace "USERNAME" with your Promote username, "APIKEY" your Promote API key, "{JSON: DATA}" with your data in JSON format, "MANAGER" with the IP address of your manager server, and "MODELNAME" with the name of the model you want to query curl -X POST -H "Content-Type: application/json" --user USERNAME:APIKEY --data '{JSON: DATA}' http://MANAGER/USERNAME/models/MODELNAME/predict
You may request predictions from Promote without authentication.