---
title: Custom model in a DataRobot environment
description: How to deploy a custom model in a DataRobot prediction environment.

---

# Deploy a custom model in a DataRobot Environment {: #deploy-a-custom-model-in-a-datarobot-environment }

Custom inference models allow you to bring your pre-trained models into DataRobot. To deploy a custom model to a DataRobot prediction environment, you can create a custom model in the Custom Model Workshop. Then, you can prepare, test, and register that model, and deploy it to a centralized deployment hub where you can monitor, manage, and govern it alongside your deployed DataRobot models. DataRobot supports custom models built in various programming languages, including Python, R, and Java.

To create and deploy a custom model in DataRobot, follow the workflow outlined below:

``` mermaid
graph TB
  A[Create a custom model] --> B{Use a custom model environment?} 
  B --> |Yes|C[Create a custom model environment]
  B --> |No|D[Prepare the custom model];
  C --> D
  D --> E{Test locally?}
  E --> |No|H[Test the custom model in DataRobot]
  E --> |Yes|F[Install the DataRobot Model Runner]
  F --> G[Test the custom model locally]
  G --> H
  H --> I[Register the custom model]
  I --> J[Deploy the custom model]
```

## Create a custom model {: #create-a-custom-model }

Custom inference models are user-created, pre-trained models (made up of a collection of files) uploaded to DataRobot via the Custom Model Workshop. 

You can assemble custom inference models in either of the following ways:

* Create a custom model _without_ providing the model requirements and `start_server.sh` file on the **Assemble** tab. This type of custom model _must_ use a drop-in environment. Drop-in environments contain the requirements and `start_server.sh` file used by the model. They are [provided by DataRobot](drop-in-environments) in the Custom Model Workshop. You can also [create your own](custom-environments#create-a-custom-environment) drop-in custom environment.

* Create a custom model _with_ the model requirements and `start_server.sh` file on the **Assemble** tab. This type of custom model can be paired with a [custom](custom-environments#create-a-custom-environment) or [drop-in](drop-in-environments) environment.

[Create a custom model <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-inf-model){ .md-button }

### Optional: Create a custom model environment {: #optional-create-a-custom-model-environment }

If you decide to use a custom environment or a custom drop-in environment, you must create that environment in the Custom Model Workshop. You can reuse these environments for other custom models. 

You can assemble custom model environments in either of the following ways:

* Create a custom drop-in environment _with_ the model requirements and `start_server.sh` file for the model. DataRobot provides several [default drop-in environments](#drop-in-environments) in the Custom Model Workshop.

* Create a custom environment _without_ the model requirements and `start_server.sh` file. Instead, you must provide the requirements and a `start_server.sh` file in the model folder for the custom model you intend to use with this environment.

[Create a custom model environment <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-environments){ .md-button }

## Prepare the custom model {: #prepare-the-custom-model }

Before adding custom models and environments to DataRobot, you must prepare and structure the files required to run them successfully. The tools and templates necessary to prepare custom models are hosted in the [Custom Model GitHub repository](https://github.com/datarobot/datarobot-user-models){:target="_blank"} ({% include 'includes/github-sign-in.md' %}). Once you verify the model's files and folder structure, you can proceed to test the model.

[Prepare a custom model <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-model-assembly/index){ .md-button }

### Optional: Test locally {: #test-locally }

The [DataRobot Model Runner (DRUM)](https://pypi.org/project/datarobot-drum/){:target="_blank"} is a tool you can use to work locally with Python, R, and Java custom models. It can verify that a custom model can run and make predictions before you add it to DataRobot. However, this testing is only for development purposes, and DataRobot recommends that you use the Custom Model Workshop to test any model you intend to deploy.

[Test a custom model locally <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-local-test){ .md-button }

### Test in DataRobot {: #test-in-datarobot }

Testing the custom model in the Custom Model Workshop ensures that the model is functional before deployment. These tests use the model environment to run the model and make predictions with test data.

!!! note
    While you can deploy your custom inference model without testing, DataRobot strongly recommends that you ensure your model passes testing in the Custom Model Workshop before deployment.

[Test a custom model in DataRobot <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-model-test){ .md-button }

## Register the custom model {: #register-the-custom-model }

After successfully creating and testing a custom inference model in the Custom Model Workshop, you can add it to the Model Registry as a deployment-ready model package.

[Register a custom model <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](custom-model-reg){ .md-button }

## Deploy the custom model {: #deploy-the-custom-model }

After you register a custom inference model in the Model Registry, you can deploy it. Deployed custom models make predictions using API calls to a dedicated prediction server managed by DataRobot.

[Deploy a custom model <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](deploy-custom-inf-model){ .md-button }.

