---
title: Replace deployed models
description: How to replace deployment model packages, to keep models currrent and accurate. DataRobot uses training data to verify that the two models have the same target.

---

# Replace deployed models {: #replace-deployed-models }

Because model predictions tend to degrade in accuracy over time, DataRobot provides an easy way to switch models and model packages for deployments. This ensures that models are up-to-date and accurate. Using the model management capability to switch model packages for deployments allows model creators to keep models current without disrupting downstream consumers. It helps model validators and data science teams to track model history. And, it provides model *consumers* with confidence in their predictions without needing to know the details of the changeover.

## Replace a model package {: #replace-a-model-package }

Use the **Replace model** functionality found in the [**Actions**](actions-menu) (![](images/icon-menu.png)) menu. The menu is available from the **Deployments** area of either the [**Inventory**](deploy-inventory) or the [**Overview**](dep-overview) pages.

![](images/mmm-replace-1.png)

You are redirected to the **Overview** tab of the deployment. Click **Import from** to choose your method of model replacement.

* **Local File**: Upload a model package exported from DataRobot AutoML to replace an existing model package (standalone MLOps users only).

* **Model Registry**: Select a model package from the [**Model Registry**](registry/index) to replace an existing model package.

* **Paste AutoML URL**: Copy the URL of the model from the Leaderboard and paste it into the **Replacement Model** field.

![](images/replace-m-2.png)

When you have confirmed the model package for replacement, select the replacement reason and click **Accept and replace**.

![](images/replace-m-3.png)

## Model replacement considerations {: #model-replacement-considerations }

When replacing a deployed model, note the following:

* Model replacement is available for all deployments. Each deployment's model is provided as a model package, which can be replaced with another model package, provided it is [compatible](#model-package-replacement-compatibility).

    !!! note
        The new model package *cannot* be the same leaderboad model as an existing champion or challenger; each challenger *must* be a unique model. If you create multiple model packages from the same leaderboard model, you can't use those models as challengers in the same deployment.

* While only the most current model is deployed, model history is maintained and can be used as a baseline for data drift.


### Model replacement validation {: #model-replacement-validation }

DataRobot validates whether the new model is an appropriate replacement for the existing model and provides warning messages if issues are found. DataRobot compares the models to ensure that:

* The target names and types match. For classification targets, the class names must match.
* The feature types match.
* There are no new features. If the new model has more features, the warning identifies the additional features. This is intended to help prevent prediction errors if the new model requires features not available in the old model. If the new model has fewer or the same number of features, there is no warning.
* The replacement model supports all humility rules.
* If the existing model is a time series model, the replacement model must also be a time series model and the series types must match (single series/multiseries).
* If the model is a custom inference model, it must pass custom model tests.
* Prediction intervals must be compatible if enabled for the deployment.
* Segments must be compatible if segment analysis is enabled for the deployment.

!!! note
    DataRobot is only able to validate your model’s input features if you have assigned training data to both model packages (the existing model package for your deployment, and the one you selected to replace it with). Otherwise, DataRobot is unable to validate that the two model packages have the same target type and target name. A warning message informs you that model replacement is not allowed if the model, target type, and target name are not the same:

    ![](images/replace-m-4.png)


###  Model package replacement compatibility {: #model-package-replacement-compatibility }

Consider the compatibility of each model package type (external and DataRobot) before proceeding with model package replacement for a deployment:

=== "SaaS"

    * [External model packages](reg-create#register-external-model-packages) (monitored by the [MLOps agent](mlops-agent/index)) can only replace other external model packages. They cannot be replaced by DataRobot model packages. 

	* [Custom model packages](reg-create#add-a-custom-inference-model) are DataRobot model packages. DataRobot model packages can only replace other DataRobot model packages. They cannot be replaced by external model packages.

=== "Self-Managed"

    * [External model packages](reg-create#register-external-model-packages) (monitored by the [MLOps agent](mlops-agent/index)) can only replace other external model packages. They cannot be replaced by DataRobot model packages. 

	* [Custom model packages](reg-create#add-a-custom-inference-model) and [imported .mlpkg files](reg-transfer) are both DataRobot model package types. DataRobot model packages can only replace other DataRobot model packages. They cannot be replaced by external model packages.