跳转到内容

Compute

模板

模板就是实例启动后进入的软件环境。你在部署向导的第 2 步选择它,它决定机器起来之后你拿到什么:一个浏览器 UI、一个 notebook 服务,或者一个带 CUDA 的裸 shell。

模板是一个容器镜像加一条可选的启动命令。你启动实例时,Grafilab 在你选定的节点上运行这个镜像,并把 GPU 交给容器。

有三件事对每个模板都成立,因为它们由平台附加,而不是来自镜像:

  • 你是 root。 容器以 root 身份运行并挂载了 TTY,所以你可以装包、改配置,运行镜像里缺的任何东西。
  • SSH 始终可用。 平台层在容器里放了一个 SSH 服务,密码自动生成,所以即使没有 Web UI 的模板也连得上。Connect 对话框参见管理实例。
  • GPU 直通。 在 GPU 节点上,容器内的 nvidia-smi 可用,包括 code-server 这类你不会当成 GPU 工具的模板。

带 Web UI 的模板会在 80 端口声明一个服务,Grafilab 的代理把它发布在 https://<your-slug>.instance.grafilab.ai —— slug 就是实例卡片上那个三词名字。这层映射是模板的一部分。你自己启动的其他端口需要一条 Web Access 映射,见管理实例。

模板镜像界面何时选它
Open WebUI + Ollamagrafilab/openwebui:0.10.2Web UI + SSH你想要一个 ChatGPT 风格的聊天窗口,在自己的 GPU 上私有地跑开源模型。
JupyterLabgrafilab/jupyterlab:2026-06-09Web UI + SSH你在 notebook 里工作 —— 探索、微调实验、数据处理,CUDA 和 PyTorch 已就绪。
ComfyUIgrafilab/comfyui:2026-06-09Web UI + SSH你用基于节点的 Stable Diffusion / Flux 工作流生成图像或视频。模型自备。
code-servergrafilab/code-server:4.123.0Web UI + SSH你想在浏览器里用 VS Code,并在 GPU 机器上有一个集成终端。
PyTorch + CUDApytorch/pytorch:*(四个 tag)仅 SSH你跑脚本和训练任务,想要一个干净、不加预设的 PyTorch 镜像。

列表里还留着两个历史遗留的 llamafile 模板 llama:3.2.3b 和 llama:3.3,供老用户使用。它们不再维护,本文档也不涵盖 —— 请改用 Open WebUI + Ollama。

模板目录是实时下发的,所以当前有哪些模板以向导为准。tag 都固定到某个版本或构建日期,而不是 latest,因此模板下个月的行为不会变。

如果内置模板都不合适,就用你自己的镜像:在向导第 2 步点 + → Create New Template,或者在 Docker Templates 页面管理完整列表。你保存的模板会出现在网格里,带 My Template 徽章。镜像必须以 root 运行、必须能自行启动,并且应该带一个固定的 tag;私有镜像需要 Registry Credentials。

自定义模板会带你走一遍表单、凭据子弹窗和管理页面。

  • 一个通过 SSH 使用的 root shell,镜像自身的环境变量会加载到交互式 bash 会话中。busybox ash 这类非 bash shell 读不到它们。
  • GPU 节点上可用的 nvidia-smi,用来确认显卡和你租的一致。
  • 2 GB 的 /dev/shm,这对 PyTorch 的 DataLoader worker 很关键。如果遇到共享内存报错,调低 num_workers。
  • 没有持久化卷。

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.

Anyone 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.