Examples

Develop in JupyterLab

Develop in notebooks on a dedicated GPU, with work that survives restarts.

This example deploys a GPU instance from the PyTorch template with JupyterLab turned on, opens it in your browser, and keeps your notebooks on a network volume so they survive a stop.

What you need

  • A token to protect JupyterLab, for example from openssl rand -hex 24.

Step 1: Create a network volume

Open the Storage page, click Create volume, name it notebooks, set Capacity to 50, and click Create volume.

Step 2: Deploy the instance

Open the deploy page

Open the Instances page and click Deploy instance. Name the instance jupyter. Keep the PyTorch (ROCm) template.

Choose compute

Under Compute, choose a GPU model and 1 GPU.

Mount the volume

Under Network volumes, click Add network volume, choose notebooks, and keep the mount path /workspace. JupyterLab opens in /workspace.

Expose JupyterLab's port

Under Public ports, enter 8888.

Turn on JupyterLab

Under Environment variables, add:

NameValue
ENABLE_JUPYTERtrue
JUPYTER_TOKENYour token

Launch

Click Review launch, then Launch instance.

Use an environment variable for JUPYTER_TOKEN, not a secret variable: JupyterLab reads it from the environment. Members of your organization can see it on the instance's Details tab. Without a token, anyone with the address can run code on your instance.

Step 3: Open JupyterLab

Once the instance is running, open its Connect tab and click the address listed for port 8888. Enter your token on the login page.

To skip the login page, add the token to the address: <address>/lab?token=<your-token>.

The file browser shows the contents of notebooks. Check the GPU from a notebook cell; it prints True and the GPU's name:

import torch
torch.cuda.is_available(), torch.cuda.get_device_name(0)

Step 4: Stop when you're done

Stopping ends compute billing. Notebooks in /workspace stay on the volume; packages you installed with pip are on the container disk and are erased.

Open the instance, click Stop, and confirm with Stop instance. Click Start to continue later.

To get your packages back after a stop, keep a requirements.txt on the volume and run pip install -r /workspace/requirements.txt after each start.

Clean up

Delete the instance, then the volume if you no longer need its files:

featherless-cloud instance delete jupyter
featherless-cloud volume delete notebooks

Next steps

Expose ports

How public ports work.

Transfer files

Upload datasets to the volume.