Custom model environments¶
To create a custom inference model, you must select an environment that the model will use. An environment includes packages and language and system libraries used for models. You can select one of two types of environments:
Drop-in environments contain web server Scoring Code and a
start_server.shfile for the model to use. They are provided by DataRobot in the Workshop.
Custom environments do not contain the Scoring Code and
start_server.shfile, which instead must be provided in the folder of the custom model you intend to use with the environment. You can create your own in the Workshop. You can also create a custom drop-in environment by including the Scoring Code and
start_server.shfile in the environment folder.
By providing an environment separate from a custom model, DataRobot can build the environment for you. This allows you to reuse the environment for as many models as you want. It also provides the ability to provide a model by uploading a folder containing its code and model artifacts without providing web server Scoring Code and a
start_server.sh file with every model.
DataRobot provides drop-in environments from the Custom Model Workshop. Drop-in environments contain the web server Scoring Code and a
start_server.sh file for the custom model so that you do not need to provide them in the model's folder. The following table details the drop-in environments provided by DataRobot. Each environment is prefaced with [DataRobot] in the Environments tab of the Custom Model Workshop.
|Java Drop-In||DataRobot Scoring Code models|
|Python 3 PyTorch Drop-In||PyTorch models (.pth)|
|Python 3 Scikit-Learn Drop-In||Scikit-Learn models (.pkl)|
|Python 3 XGBoost Drop-In||Native XGBoost models (.pkl)|
|Python 3 Keras Drop-In||Keras models backed by tensorflow (.h5)|
|R Drop-in Environment||Models trained using caret if the method name and package name match (check here) (Log in to GitHub before clicking this link.)|
All Python environments contain Scikit-Learn to help with preprocessing (if necessary), but only Scikit-Learn can make predictions on sklearn models.
Create a custom environment¶
To create a custom environment, you must upload a compressed folder in .tar, .tar.gz, or .zip format. Be sure to review the guidelines for preparing a custom environment folder before proceeding. You may also consider creating a drop-in environment by adding Scoring Code and a
start_server.sh file to your environment folder.
Navigate to Model Registry > Custom Model Workshop and select the Environments tab. This tab lists the environments provided by DataRobot and those you have created. Click Add New Environment to configure the environment details.
Complete the fields in the modal.
|Environment name||The name of the environment.|
|Context file||The tarball archive containing the Dockerfile and any other relevant files.|
|Prebuilt image (optional)||A Docker image saved as a tarball in .tar, .gz, or .tgz format. If you provide a prebuilt image, you do not need to provide a context file. (It is unnecessary because the context provides information on the contents of the environment contained in the prebuilt image.)|
|Programming Language||The language in which the environment was made.|
When all fields are complete, click Add. The custom environment is ready for use in the Workshop.
If you supplied a prebuilt image or built an environment with a context file, you can download the built environment image as a .tar.
Add an environment version¶
Troubleshoot or update a custom environment by adding a new version of it to the Workshop. In the Versions tab, select New Version.
Upload the file for a new version and provide a brief description, then click Add.
The new version is available in the Verison tab; all past environment versions are saved for later use.