---
title: Scoring Code in an external environment
description: How to deploy an exported DataRobot model's Scoring Code in an external environment.

---

# Deploy Scoring Code in an external environment {: #deploy-scoring-code-in-an-external-environment }

With DataRobot MLOps you can register a DataRobot model, create a prediction environment, and deploy that model's Scoring Code package to an external prediction environment, establishing a deployment scenario for that model outside DataRobot.

You can download the monitoring agent packaged with [Scoring Code](scoring-code/index) from a deployment's Portable Predictions tab or the Deployments inventory.

!!! note
    To access the Scoring Code package, make sure you train your model with Scoring Code enabled. Additionally, this package is only compatible with models running at the command line; it doesn't support models running on the [Portable Prediction Server](portable-pps).

The monitoring agent packaged with the Scoring Code JAR file is configured for the deployment, allowing you to quickly integrate the agent to report model monitoring statistics back to DataRobot MLOps.

To create and deploy a Scoring Code enabled AutoML model in an external environment, follow the workflow outlined below:

``` mermaid
graph TB
  A[Select a Scoring Code enabled model] --> B[Register the model]
  B --> C{Create an external prediction environment?}
  C --> |No|D[Deploy the model to an external prediction environment]
  C --> |Yes|E[Add an external prediction environment]
  E --> D 
  D --> F[Download the Java Scoring Code and monitoring agent package]
```

## Select a Scoring Code enabled model {: #select-a-scoring-code-enabled-model }

Only models compatible with scoring code (and trained with Scoring Code enabled) provide Scoring Code download as a Portable Prediction option. Scoring Code allows you to export DataRobot's AutoML-generated models as JAR files that you can use outside the platform. DataRobot automatically runs code generation for qualifying models and indicates Scoring Code availability with an [indicator badge](leaderboard-ref#tags-and-indicators) on the Leaderboard.

[Select a Scoring Code enabled model <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](sc-overview){ .md-button }

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

DataRobot AutoML automatically generates models and displays them on the Leaderboard. The [model recommended for deployment](model-rec-process) appears at the top of the page. To obtain the Scoring Code you need for this process, you can register this or any other model from the Leaderboard as long as the model has the Scoring Code indicator.

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

## Deploy the model's Scoring Code externally {: #deploy-the-models-scoring-code-externally }

To download a model's scoring code with the monitoring agent included and preconfigured, you must create an external MLOps deployment. 

### Add an external prediction environment {: #add-an-external-prediction-environment }

To create an external deployment, you need an external prediction environment. Create an external prediction environment if you don't already have one in DataRobot.

[Add an external prediction environment <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](pred-env){ .md-button }

### Deploy the model to an external prediction environment {: #deploy-the-model-to-an-external-prediction-environment }

Once you've added an external prediction environment, deploy your Scoring Code enabled model to that external prediction environment.

[Deploy a model to an external prediction environment <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](deploy-model#deploy-from-the-model-registry){ .md-button }

### Download the Java Scoring Code and monitoring agent package {: #download-the-java-scoring-code-and-mlops-agent-package }

You can download the monitoring agent packaged with [Scoring Code](scoring-code/index) from a deployment's Portable Predictions tab or the Deployments inventory. The monitoring agent that comes packaged with the Scoring Code JAR file is already configured for the deployment, allowing you to quickly integrate the agent from the command line using a snippet provided on the Scoring Code download page. 

[Download the Scoring Code package <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](agent-sc){ .md-button }