Compute
JupyterLab
启动这个模板,实例 URL 上就已经有一个 JupyterLab 服务在等你,CUDA 和 PyTorch 都已装好,GPU 从第一个 cell 起就可见。
你会得到什么
Section titled “你会得到什么”镜像是 grafilab/jupyterlab:2026-06-09,基于 Jupyter 官方的 quay.io/jupyter/pytorch-notebook:cuda12-latest 构建,并改成以 root 运行,好让平台的 SSH 配置生效。
- 80 端口上的 JupyterLab,发布在
https://<your-slug>.instance.grafilab.ai。 - 带 CUDA 的 PyTorch,以及上游 notebook 镜像里那套常规科学计算 Python 环境。
- 同一容器上通过 SSH 使用的 root shell,用来做 notebook 界面里不顺手的事。
适合探索性工作:试一个模型、清洗一份数据集、跑一次想逐个 cell 盯着的微调。对于长时间无人值守的训练,PyTorch + CUDA 配 tmux 更合适。
部署实例,在第 2 步 Template Selection 里选 JupyterLab。任何 GPU 卡都能用;按你打算加载的模型来匹配显存。完整流程见部署 GPU 实例。
打开 notebook
Section titled “打开 notebook”-
在控制台打开 My Instance,等卡片显示 Active。
-
打开
https://<your-slug>.instance.grafilab.ai。slug 就是实例卡片上那个三词名字。 -
在启动器里点 Python 3 notebook 磁贴,会打开一个空 notebook。
验证 GPU
Section titled “验证 GPU”在第一个 cell 里运行:
import torch
print(torch.__version__)print(torch.cuda.is_available())print(torch.cuda.get_device_name(0))你应该看到 True 和你租的那块卡的名字。要看驱动自己的视角,从 cell 里跑一条 shell 命令:
!nvidia-smi如果 torch.cuda.is_available() 输出 False,确认你租的是 GPU 节点而不是纯 CPU 节点,并检查实例卡片上是否显示了 GPU 和 VRAM。
装包和搬数据
Section titled “装包和搬数据”在 cell 里用 !pip install,或者在 SSH shell 里用普通的 pip install:
!pip install transformers accelerate装完重启内核(Kernel → Restart Kernel),新包才能被 import。你装的一切都在容器里,随租期一起消失,所以在项目里留一个 requirements.txt,别指望下次靠记忆重建环境。
把文件拖到左侧文件浏览器面板即可上传,右键 → Download 把结果取回来。对 notebook 和小数据文件够用;超过几百 MB 就很难受了。
用 SSH 拷贝。主机和端口取自 Connect 对话框里的 SSH Connect 命令:
scp -P <port> ./dataset.zip <your-slug>@<ssh-proxy-host>:/root/rsync -avP -e "ssh -p <port>" ./project/ <your-slug>@<ssh-proxy-host>:/root/project/大的公开数据集直接拉到机器上 —— 实例的网络比你的上行快得多:
wget https://example.com/dataset.tar.gzhuggingface-cli download <repo-id> --local-dir ./dataAnyone with the URL can reach your web UI
The Grafilab proxy does not add a login in front of your instance. Your random three-word slug (https://<your-slug>.instance.grafilab.ai) is the only barrier, and the shipped web templates have no application login of their own (Open WebUI is the exception). Treat the URL like a password: don’t paste it in public places, and if you need a lock, add one inside the app over SSH.
务实的做法是把实例 URL 当成密钥:不要发出去、不要放进共享文档,用完就结束租期。
如果需要真正的锁,JupyterLab 会从 JUPYTER_TOKEN 环境变量读取 token —— 设了之后,URL 只有在附上或输入 token 时才可用。设置它意味着带着这个变量重启服务,这要通过 SSH 来做。
Nothing persists past the rental
Instances have no persistent volume. Anything you write at runtime — downloaded models, installed packages, notebooks, outputs — lives in the container for the lifetime of the rental and is gone when it expires. Before Expire at, back up the folders you care about to Grafilab storage and download the archive.
只有当 notebook 还存在别处时,丢掉它才不心疼。边做边推到 git,或者在 Expire at 之前用实例卡片上的 Backup 归档你的工作目录。

