Skip to content

On-premise users: click in-app to access the full platform documentation for your version of DataRobot.

Manage custom model dependencies

Custom models can contain various machine learning libraries in the model code, but not every drop-in environment provided by DataRobot natively supports all libraries. However, you can manage these dependencies from the Workshop and update the base drop-in environments to support your model code. To manage model dependencies, you must include a requirements.txt file uploaded as part of your custom model. The text file must indicate the machine learning libraries used in the model code.

For example, consider a custom R model that uses Caret and XGBoost libraries. If this model is added to the Workshop and the R drop-in environment is selected, the base environment will only support Caret, not XGBoost. To address this, edit requirements.txt to include the Caret and XGBoost dependencies. After editing and re-uploading the requirements file, the base environment includes XGBoost, making the model available within the environment.


Custom model dependencies aren't applied when testing a model locally with DRUM.

List the following, depending on the model language, in requirements.txt:

  • For R models, list the machine learning library dependencies.

  • For Python models, list the dependencies and any version constraints for the libraries. Supported constraint types include <, <=, ==, >=, >, and multiple constraints can be issued in a single entry (for example, pandas >= 0.24, < 1.0).

Once the requirements file is updated to include dependencies and constraints, navigate to your custom model's Assemble tab. Upload the file under the Model > Content header. The Model Dependencies field updates to display the dependencies and constraints listed in the file.

From the Assemble tab, select a base drop-in environment under the Model Environment header. DataRobot warns you that a new environment must be built to account for the model dependencies. Select Build environment, and DataRobot installs the required libraries and constraints to the base environment.

Once the base environment is updated, your custom model will be usable with the environment, allowing you to test, deploy, or register it.

Updated February 8, 2023