Skip to main content

notebooks

Paperspace Gradient CLI reference guide for notebooks.

create​

Create new notebook

Examples​

gradient notebooks create \
--machineType "P4000" \
--container "paperspace/nb-pytorch:22.02-py3" \
--projectId "prjpkflqz" \
--name "New Notebook"

Options​

NameTypeAttributesDescription
--machineTypestringrequiredVirtual machine type label e.g. P5000
--containerstringrequiredContainer name
--projectIdstringrequiredID of a project
--clusterIDstringoptionalID of a cluster
--namestringoptionalNotebook name
--registryUsernamestringoptionalRegistry username
--registryPasswordstringoptionalRegistry password
--commandstringoptionalCommand (executed as /bin/sh -c β€˜YOUR COMMAND’)
--containerUserstringoptionalContainer user
--shutdownTimeoutstringoptionalShutdown timeout in hours
--isPreemptiblestringoptionalIs preemptible
--isPublicstringoptionalIs publically viewable
--environmentstringoptionalEnvironmental variables
--workspacestringoptionalS3 url or git repository. Directory uploads are not yet supported
--workspaceRefstringoptionalGit commit hash, branch name or tag
--workspaceUsernamestringoptionalWorkspace username
--workspacePasswordstringoptionalWorkspace password
--tagstringoptionalOne or many tags that you want to add
--tagsstringoptionalTags separated by comma
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Created new notebook with id: np8pihaie5
https://console.paperspace.com/paperspace-docs-team/notebook/rgvieperm1lipwe

details​

Gradient notebooks details

Examples​

gradient notebooks details \
--id "np8pihaie5"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

+---------+---------------------------------------------+
| Name | New Notebook |
+---------+---------------------------------------------+
| ID | np8pihaie5 |
| Project | prjpkflqz |
| VM Type | P4000 |
| State | Running |
| FQDN | np8pihaie5.clg07azjl.paperspacegradient.com |
| Tags | |
+---------+---------------------------------------------+

list​

List notebooks

Examples​

gradient notebooks list

Options​

NameTypeAttributesDescription
--limitintegeroptionalLimit response
--offsetintegeroptionalOffset response
--tagstringoptionalFilter by tag
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

+--------------+------------+
| Name | ID |
+--------------+------------+
| New Notebook | np8pihaie5 |
+--------------+------------+

logs​

List notebook logs

Examples​

gradient notebooks logs \
--id "np8pihaie5"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--lineintegeroptionalLine of logs output
--limitintegeroptionalLimit response
--followbooleanoptional
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

+Notebook np8pihaie5 logs------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| LINE | MESSAGE |
+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | |
| 2 | ============= |
| 3 | == PyTorch == |
| 4 | ============= |
| 5 | |
| 6 | NVIDIA Release 22.02 (build 32255746) |
| 7 | PyTorch Version 1.11.0a0+17540c5 |
| 8 | |
| 9 | Container image Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 10 | |
| 11 | Copyright (c) 2014-2022 Facebook Inc. |
| 12 | Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) |
| 13 | Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) |
| 14 | Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) |
| 15 | Copyright (c) 2011-2013 NYU (Clement Farabet) |
| 16 | Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) |
| 17 | Copyright (c) 2006 Idiap Research Institute (Samy Bengio) |
| 18 | Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) |
| 19 | Copyright (c) 2015 Google Inc. |
| 20 | Copyright (c) 2015 Yangqing Jia |
| 21 | Copyright (c) 2013-2016 The Caffe contributors |
| 22 | All rights reserved. |
| 23 | |
| 24 | Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 25 | |
| 26 | This container image and its contents are governed by the NVIDIA Deep Learning Container License. |
| 27 | By pulling and using the container, you accept the terms and conditions of this license: |
| 28 | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
...

start​

Start notebook

Examples​

gradient notebooks start \
--id "ncbf3hcmao" \
--machineType "P4000"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--machineTypestringrequiredVirtual machine type label e.g. P5000
--clusterIDstringoptionalID of a cluster
--shutdownTimeoutstringoptionalShutdown timeout in hours
--isPreemptiblestringoptionalIs preemptible
--tagstringoptionalOne or many tags that you want to add
--tagsstringoptionalTags separated by comma
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Started notebook with id: n48rz1nszs
https://console.paperspace.com/paperspace-docs-team/notebook/rgvieperm1lipwe

stop​

Stop notebook

Examples​

gradient notebooks stop \
--id "n48rz1nszs"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--apiKeystringoptionalAPI key to use this time only

Response​

Stopping notebook with id: np8pihaie5

fork​

Fork existing notebook

Examples​

gradient notebooks fork \
--id "n4lwwzwf6h" \
--projectId "prjpkflqz"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--projectIdstringrequiredProject ID
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Notebook forked to id: n893mxu6zw

delete​

Delete notebook

Examples​

gradient notebooks delete \
--id "np8pihaie5"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Notebook deleted

artifacts list​

List notebook's artifacts

Examples​

gradient notebooks artifacts list \
--id "n4lwwzwf6h"

Options​

NameTypeAttributesDescription
--idstringrequiredID of the notebook
--sizebooleanoptionalShow file size
--linksbooleanoptionalShow file URL
--filesstringoptionalGet only given file (use * as a wildcard)
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

metrics get​

Get notebook metrics. Shows CPU and RAM usage by default.

Examples​

gradient notebooks metrics get \
--id "n4lwwzwf6h"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--metricstringoptionalOne or more metrics that you want to read. cpuPercentage, memoryUsage, gpuMemoryFree, gpuMemoryUsed, gpuPowerDraw, gpuTemp, gpuUtilization, gpuMemoryUtilization
--intervalstringoptionalInterval
--startstringoptionalTimestamp of first time series metric to collect
--endstringoptionalTimestamp of last time series metric to collect
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

{
"cpuPercentage": {
"n4lwwzwf6h": [
{
"time_stamp": 1647923579,
"value": "0.02326348333333339"
},
{
"time_stamp": 1647923609,
"value": "0.022861235000000146"
},
{
"time_stamp": 1647923639,
"value": "0.023488911666666817"
},
{
"time_stamp": 1647923669,
"value": "0.09286078499999999"
},
{
"time_stamp": 1647923699,
"value": "0.0916106966666665"
},
{
"time_stamp": 1647923729,
"value": "0.023709778333333247"
},
{
"time_stamp": 1647923759,
"value": "0.09410035000000003"
},
{
"time_stamp": 1647923789,
"value": "0.16279980333333333"
}
]
},
"memoryUsage": {
"n4lwwzwf6h": [
{
"time_stamp": 1647923519,
"value": "0"
},
{
"time_stamp": 1647923549,
"value": "126480384"
},
{
"time_stamp": 1647923579,
"value": "126537728"
},
{
"time_stamp": 1647923609,
"value": "126644224"
},
{
"time_stamp": 1647923639,
"value": "126742528"
},
{
"time_stamp": 1647923669,
"value": "125550592"
},
{
"time_stamp": 1647923699,
"value": "125661184"
},
{
"time_stamp": 1647923729,
"value": "125726720"
},
{
"time_stamp": 1647923759,
"value": "124112896"
}
]
}
}

metrics list​

List notebook metrics.

Examples​

gradient notebooks metrics list \
--id "n4lwwzwf6h"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--intervalstringoptionalInterval
--startstringoptionalTimestamp of first time series metric to collect
--endstringoptionalTimestamp of last time series metric to collect
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

metrics stream​

Stream notebook metrics.

Examples​

gradient notebooks metrics stream \
--id "n8zgov68mw"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--metricstringoptionalOne or more metrics that you want to read. cpuPercentage, memoryUsage, gpuMemoryFree, gpuMemoryUsed, gpuPowerDraw, gpuTemp, gpuUtilization, gpuMemoryUtilization
--intervalstringoptionalInterval
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

tags add​

Add tags to notebook

Examples​

gradient notebooks tags add \
--id "n1vswe1grw" \
--tag "PyTorch"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--tagstringrequiredOne or many tags that you want to add
--tagsstringoptionalTags separated by comma
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Tags added to notebook

tags remove​

Remove tags from notebook

Examples​

gradient notebooks tags remove \
--id "n1vswe1grw" \
--tag "PyTorch"

Options​

NameTypeAttributesDescription
--idstringrequiredNotebook ID
--tagstringrequiredOne or many tags that you want to add
--tagsstringoptionalTags separated by comma
--apiKeystringoptionalAPI key to use this time only
--optionsFilestringoptionalPath to YAML with predefined options
--createOptionsFilestringoptionalGenerate template options file

Response​

Tags removed from notebook