# Download Scoring Code from a deployment
URL: https://docs.datarobot.com/en/docs/classic-ui/predictions/port-pred/scoring-code/sc-download-deployment.html

> Download a Scoring Code JAR file directly from a DataRobot deployment.

# Download Scoring Code from a deployment

> [!NOTE] Availability information
> The behavior of deployments from which you download Scoring Code depends on the MLOps configuration for your organization.

You can download [Scoring Code](https://docs.datarobot.com/en/docs/classic-ui/predictions/port-pred/scoring-code/index.html) for models as pre-compiled JAR files (with all dependencies included) to be used outside of the DataRobot platform. This topic describes how to download Scoring Code from a deployment. Alternatively, you can download it from the [Leaderboard](https://docs.datarobot.com/en/docs/classic-ui/predictions/port-pred/scoring-code/sc-download-leaderboard.html).

## Deployment download

For Scoring Code-enabled models deployed to an [external prediction server](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/prediction-env/pred-env.html#add-an-external-prediction-environment), you can download Scoring Code from a deployment's [Actions menu](https://docs.datarobot.com/en/docs/classic-ui/mlops/manage-mlops/actions-menu.html) in the Deployments inventory or from a deployment's Predictions > Portable Predictions tab. For Scoring Code-enabled models deployed to a DataRobot prediction environment, you can only download Scoring Code from the Deployments inventory.

1. Navigate to theDeploymentsinventory, and then take either of the following steps:
2. Complete the fields described below in thePortable Predictionstab (or theDownload Scoring Codedialog). ElementDescription1Scoring CodeProvides a Java package containing your DataRobot model. UnderPortable Prediction Method, selectScoring Code. You can alternatively selectPortable Prediction Serverto set up a REST API-based prediction server.2Coding languageSelect the location from which you want to call the Scoring Code:Python API,Java API, or thecommand line interface (CLI). Selecting a location updates the example snippet displayed below to the corresponding language.3Include Monitoring AgentDownloads theMLOps Agentwith your Scoring Code.4Include Prediction Explanations / Include Prediction Intervals (for time series)Depending on the model type, enable either of the following prediction options:Includes code to calculatePrediction Explanationswith your Scoring Code. This allows you to get Prediction Explanations from your Scoring Code by adding the command line option:--with-explanations. SeeScoring at the command linefor more information.For time series deployments, Includes code to calculatePrediction Intervalswith your Scoring Code. This allows you to get Prediction Intervals (from 1 to 99) from your Scoring Code by adding the command line option:--interval_length=<integer value from 1 to 99>. SeeScoring at the command linefor more information.5Show secretsDisplays any secrets hidden by*in the code snippet. Revealing the secrets in a code snippet can provide a convenient way to retrieve your API key or datarobot-key; however, these secrets are hidden by default for security reasons, so ensure that you handle them carefully.6Prepare and download / Prepare and download as source codeDepending on the options selected above, select either of the following download methods:Prepare and download: Downloads the Scoring Code as a Java package. The package contains compiled Java executables, which include all dependencies and can be used to make predictions.Prepare and download as source code: Downloads Java source code files. These are a non-obfuscated version of the model; they cannot be used to score the model since they are not compiled and dependency packages are not included. Use the source files to explore the model’s decision-making process. This option is only available if you don't have the monitoring agent and prediction explanations enabled.7ExampleProvides a code example that calls the Scoring Code using the selected coding language.8Copy to clipboardCopies the Scoring Code example to your clipboard so that you can paste it in your IDE or on the command line. TipAccess theDataRobot Prediction Libraryto make predictions using various prediction methods supported by DataRobot via a Python API. The library provides a common interface for making predictions, making it easy to swap out any underlying implementation. Note that the library requires a Scoring Code JAR file.
3. Once the settings are configured, clickPrepare and downloadto download a Java package orPrepare and download as source codeto download source code files. WarningFor users on pricing plans from before March 2020, downloading Scoring Code makes the deployment permanent, meaning that it cannot be deleted. A warning message prompts you to accept this condition. Use the toggle to indicate your understanding, then clickPrepare and downloadto download a Java package orPrepare and download as source codeto download source code files.
4. When the Scoring Code download completes, use the snippet provided on the tab to call the Scoring Code. For implementation examples, reference the MLOps agent tarball documentation, which you can download from theAPI keys and toolspage. You can also use themonitoring snippetto integrate with the MLOps Agent.

---
