← All examples

Notebooks

Open a JupyterLab notebook on a GPU

A JupyterLab box on the cluster with your volumes and secrets mounted and, if you ask, a GPU. The dashboard's notebook editor runs the cells, shows live CPU, memory and GPU meters from inside the pod, and keeps the files on a volume that outlives the pod.

Any CPU or GPU profile; change it later and the box relaunches with the new resources.

How it works

  1. 1New notebook: name, CPU, memory, GPU, extra pip packages, secrets to attach, volumes to mount, an idle timeout.
  2. 2The box starts JupyterLab; the dashboard talks to it through the API's proxy, so the editor, the file browser and the resource meters are native pages.
  3. 3Inside a cell, import levers9 works and the workspace token is already there: @job(...).remote() runs from the notebook.
  4. 4Stop and start keep the files; leaving the page keeps the kernel and the running cells.

The code

notebook cell
# in a cell: the same functions you would run from a laptop, now from the box
from levers9 import job

@job(gpu="T4", cpu=2, memory="8Gi")
def bench(n: int) -> dict:
    import torch
    ...

bench.remote(4096)
run it
# Notebooks → New notebook → pick a GPU → Open

Where to go next

Related