# Create custom inference models
URL: https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-inf-model.html

> How to build a custom inference model in the Custom Model Workshop.

# Create custom inference models

Custom inference models are user-created, pre-trained models that you can upload to DataRobot (as a collection of files) via the Custom Model Workshop. You can then upload a model artifact to create, test, and deploy custom inference models to DataRobot's centralized deployment hub.

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

- Create a custom modelwithoutproviding the model requirements andstart_server.shfile on theAssembletab. This type of custom modelmustuse a drop-in environment. Drop-in environments contain the requirements andstart_server.shfile used by the model. They areprovided by DataRobotin the Custom Model Workshop. You can alsocreate your owndrop-in custom environment.
- Create a custom modelwiththe model requirements andstart_server.shfile on theAssembletab. This type of custom model can be paired with acustomordrop-inenvironment.

Be sure to review the guidelines for [assembling a custom model](https://docs.datarobot.com/en/docs/api/code-first-tools/drum/index.html) before proceeding. If any files overlap between the custom model and the environment folders, the model's files will take priority.

> [!NOTE] Note
> Once a custom model's file contents are assembled, you can [test the contents locally](https://docs.datarobot.com/en/docs/api/code-first-tools/drum/custom-local-test.html) for development purposes before uploading it to DataRobot. After you create a custom model in the Workshop, you can run a [testing suite](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-test.html) from the Assemble tab.

## Create a new custom model

1. To create a custom model, navigate toModel Registry>Custom Model Workshopand select theModelstab. This tab lists the models you have created. ClickAdd new model.
2. In theAdd Custom Inference Modelwindow, enter the fields described in the table below: ElementDescription1Model typeSelectCustom modelorProxy(external).2Model nameName the custom model.3Target type / Target nameSelect the target type (binary classification,regression,multiclass,text generation(premium feature),anomaly detection, orunstructured) and enter the name of the target feature.4Positive class label / Negative class labelFor binary classification models, specify the value to be used as the positive class label and the value to be used as the negative class label.For a multiclass classification model, these fields are replaced by a field to enter or upload the target classes in.csvor.txtformat. Target type support for proxy modelsIf you select theProxymodel type, you can't select theUnstructuredtarget type.
3. ClickShow Optional Fieldsand, if necessary, enter aPrediction threshold, theLanguageused to build the model, and aDescription.
4. After completing the fields, clickAdd Custom Model.
5. In theAssembletab, underModel Environmenton the right, select a model environment by clicking theBase Environmentdropdown menu on the right and selecting an environment. The model environment is used fortestinganddeployingthe custom model. NoteTheBase Environmentpulldown menu includesdrop-in model environments, if any exist, as well ascustom environmentsthat you can create.
6. UnderModelon the left, add content by dragging and dropping files or browsing. Alternatively, select aremote integrated repository. If you clickBrowse local file, you have the option of adding aLocal Folder. The local folder is for dependent files and additional assets required by your model, not the model itself. Even if the model file is included in the folder, it will not be accessible to DataRobot unless the file exists at the root level. The root file can then point to the dependencies in the folder. NoteYou must also upload the model requirements and astart_server.shfile to your model's folder unless you are pairing the model with adrop-in environment.

### View and edit runtime parameters

When you add a `model-metadata.yaml` file with `runtimeParameterDefinitions` to DataRobot while creating a custom model, the Runtime Parameters section appears on the Assemble tab for that custom model. After you build the environment and create a new version, you can click View and Edit to configure the parameters:

> [!NOTE] Note
> Each change to a runtime parameter creates a new minor version of the custom model.

After you [test a model](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-test.html) with runtime parameters in the Custom Model Workshop, you can navigate to the Test > Runtime Parameters to view the model's parameters:

If any runtime parameters have `allowEmpty: false` in the definition without a `defaultValue`, you must set a value before registering the custom model.

For more information on how to define runtime parameters and use them in your custom model code, see the [Define custom mode runtime parameters](https://docs.datarobot.com/en/docs/api/code-first-tools/drum/custom-model-runtime-parameters.html) documentation.

### Anomaly detection

You can create custom inference models that support anomaly detection problems. If you choose to build one, reference the [DRUM template](https://github.com/datarobot/datarobot-user-models/tree/master/model_templates/python3_sklearn_anomaly). (Log in to GitHub before clicking this link.) When deploying custom inference anomaly detection models, note that the following functionality is not supported:

- Data drift
- Accuracy and association IDs
- Challenger models
- Humility rules
- Prediction intervals

---
