# Managing Models

{% hint style="info" %}
View the full CLI/SDK Docs for **Models** here [https://paperspace.github.io/gradient-cli/gradient.cli.html#gradient-models](https://paperspace.github.io/gradient-cli/gradient.cli.html#gradient-models)
{% endhint %}

## Create a Model

There are two ways to create a Model in Gradient, and both can be done via the web UI or CLI:

### 1. Run an Experiment that generates a Model

You can do this via the UI or via the CLI by [using one of the sample Experiment commands](create-a-model/model-path); be sure to set both `--modelPath` and `--modelType` according to those instructions. This will place your Model in your Project's [Model Repository](../about#model-repository).

View an [example](create-a-model/preparing-model-for-deployment) using TensorFlow.

### 2. Upload a Model

{% tabs %}
{% tab title="Web UI" %}
To upload a Model via the Web UI, first navigate to the **Models** page.

From there, click **Upload a Model +**

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LxSuM4ogzKfBZMsxZZS%2F-LxTANHxJpLUyli4oZbL%2Fclick%20upload.png?alt=media\&token=acad7c02-e8ec-41df-aecb-791514654803)

This will open up a modal to **Upload a Model**, where you can drag 'n drop a Model file from your local machine (or click to find it locally), as well as select the model **Type** and provide a **Name**, custom **Summary**, and any **Additional Notes** as metadata.  Additionally, you can click "Or Upload a directory" to select a local folder.

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-M9-IgkOl-7wdKf1jRgo%2F-M9-K7ocXj7Tof5Yvc_Z%2FScreen%20Shot%202020-06-04%20at%201.15.11%20PM.png?alt=media\&token=ae3cedfb-8e86-49f3-b40e-11ed336d0488)

Then click **Upload Model**. This will upload and register the Model in Gradient.
{% endtab %}

{% tab title="CLI" %}
You can upload a Model via the CLI with the `gradient models upload` subcommand:

```
gradient models upload downloads/squeezenet1.1.onnx --name squeezenet --modelType ONNX
```

Whether you use the Web UI or CLI, you've now successfully uploaded a Model into Gradient!

_Note: Uploaded Models will not be associated with an Experiment._&#x20;

Now that you have a Model, whether uploaded or generated by running an Experiment, read on to learn how you can use it to create a Deployment.
{% endtab %}
{% endtabs %}



## View Models in Your Model Repository

You can view your team's Models in your Model Repository via the Web UI or CLI, as seen below.

{% tabs %}
{% tab title="Web UI" %}
Navigate to **Models** in the side nav to see your list of trained Models:

![Models are available within projects](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MROCMJIcyoyXw4eBnwX%2F-MROGoWfu1U0GTUplm_x%2FScreen%20Shot%202021-01-18%20at%2010.12.57%20PM.png?alt=media\&token=36e2a6fe-5975-426d-829a-0972a94a6b32)

![A single Model card in your Models list](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LiCP3R3Bc82nHuIx-1l%2F-LiCK-FFx6PK9Cnd3_Oy%2FScreen%20Shot%202019-06-25%20at%202.30.08%20AM.png?alt=media\&token=9a5a067b-2fe8-460e-bde5-8f94441cf6ce)

As you can see, the Web UI view shows your Model ID, when the model was created, the S3 bucket location of your model, your metrics summary data, the Experiment ID, the model type, and whether it is currently deployed on Paperspace.

You can click **Deploy Model** to [Create a Deployment](create-a-model) with your Model. And you can click **Open Detail** to see a more detailed view of the Model's performance metrics. This will also show a list of all of the checkpoint files (artifacts) generated by the Experiment, as well as the final Model at hand, and you can download any of those files.

![Expanded Model Details showing performance metrics](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LiF-dcstyj2mY9jT8XT%2F-LiF-uCALK0e_PS8n3Qs%2FScreen%20Shot%202019-06-25%20at%203.00.52%20PM.png?alt=media\&token=d0ce4b64-89fb-499d-91b1-0777d6ba80fc)

![Expanded Model Details showing model and checkpoint files](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LiF-w_oLc9-SDCqCHTb%2F-LiF04evdZaYAwOrR5RP%2FScreen%20Shot%202019-06-25%20at%203.01.13%20PM.png?alt=media\&token=784562b1-45e2-46a6-9738-9c709c4d8168)
{% endtab %}

{% tab title="CLI" %}
Alternately, you can view your Models (currently with less detailed info) via the CLI by running `gradient models list`.

```
$ gradient models list

+------+-----------------+------------+------------+----------------+
| Name | ID              | Model Type | Project ID | Experiment ID  |
+------+-----------------+------------+------------+----------------+
| None | moilact08jpaok  | Tensorflow | prcl68pnk  | eshq20m4egwl8i |
| None | mos2uhkg4yvga0p | Tensorflow | prcl68pnk  | ejuxcxp2zbv0a  |
| None | moc7i8v6bsrhzk  | Custom     | prddziv0z  | e5rxj0aqtgt2   |
```

#### Parameters

The following parameters can be used with the `list` subcommand:

| Argument         | Description                         |
| ---------------- | ----------------------------------- |
| `--experimentId` | Filter models list by Experiment ID |
| `--projectId`    | Filter models list by Project ID    |
{% endtab %}
{% endtabs %}

## Renaming a Model

Just click on the name to rename your model.

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LygOb2w0NtHWbOVkS4J%2F-LybEibfJhiDbdA2kDal%2Fimage.png?generation=1579145399060529\&alt=media)

## Delete a Model

### Delete models in your Model Repository

{% tabs %}
{% tab title="Web UI" %}
Navigate to **Models** in the side nav to see your list of trained Models.  From here you can delete models by clicking the delete button. &#x20;

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-LxxbR-6LbsZOCHDWkP7%2F-LxxdM0SPCudhKSb1aoE%2Fimage.png?alt=media\&token=9a219e16-b00b-4f64-90ff-e18e82922ad3)

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-Lxx3XhBFI21yHkthoKm%2F-Lxx4PLYpUu7mkUEVpuf%2FScreen%20Shot%202020-01-06%20at%205.59.03%20PM.png?alt=media\&token=8354ca07-6fa1-4974-8882-a0366d2cebcd)
{% endtab %}

{% tab title="CLI" %}
You can delete model using the CLI with the following command:

```bash
gradient models delete --id <your model id>
```
{% endtab %}
{% endtabs %}

