Workbox
  • Who it's for
  • Models
  • How it runs
  • Join an event
  • Docs
Sign inGet started
  • Who it's for
  • Models
  • How it runs
  • Join an event
  • Docs
  • Sign in

Docs

  • Getting started
  • Boxes
  • SSH into a box
  • CLI
  • The job settings
  • Metrics and samples
  • Serve your model
  • Deploy a model
  • The management API
  • Box templates
  • Environments and events
Workbox

The cloud for AI workloads.

Product

  • Who it's for
  • Models
  • How it runs
  • Docs

Events

  • Join an event
  • Run a workshop

© Workbox

The job settings

workbox.yaml, inputs and outputs, sizes and cost.

A job runs a command or a notebook on a machine, keeps what it makes, and lets the machine go. Its settings come from three places, and later ones win: the project's defaults, a workbox.yaml in your code, then the Run job form.

workbox.yaml

run: python train.py --epochs 3   # or: notebook: train.ipynb
image: pytorch                    # pytorch, tensorflow, jax or cpu, or your own image
gpu: medium                       # a size, cpu, or a count and a GPU like 1x H100
inputs:
  - hf://roneneldan/TinyStories   # a Hugging Face dataset or model
  - https://example.com/data.csv  # a file over HTTPS
  - job://41/tokenizer/           # what an earlier job of the project saved
outputs:
  - checkpoints/
  - samples/
env:
  BATCH_SIZE: "64"
secrets: [HF_TOKEN]               # names of your workspace's secrets
minutes: 45                       # at most 60
keep: 15                          # after a failure, keep its own box this long to look around
serve: python serve.py            # how to serve the model it trains: a command, or an engine (Serve your model)
fresh: true                       # a box of its own, not your project's box
on:
  push: [main]                    # branches that start a job on every push
SettingWhat it doesDefault
runThe command, run with bash in ~/work
notebookA notebook to run top to bottom; the run comes back with every cell's output
imageA Workbox image, or a public container image of your ownpytorch
gpusmall (24 GB), medium (48 GB), large (80 GB), xlarge (4 GPUs), cpu, or an exact GPUsmall
inputsDownloaded into ~/inputs/<name> before the command startsnone
outputsPaths under ~/work saved when the job ends, however it endsnone
envEnvironment variables for the commandnone
secretsWorkspace secrets put in the command's environment, hidden in its outputnone
minutesHow long it may run, at most 6030
keepMinutes a box of its own stays after a failure, to look around (at most 60)0
serveHow the model a job trained is served: a command (calling workbox.serve) or a standard engine with its model, format, template, context and size (Serve your model)none
deployA deployment every successful push rolls out to: its name, replicas (min, max), size and idleMinutes (Deploy a model)none
freshRun on a box of its own, which ends with the job, instead of your project's boxfalse; true for pushes
on.pushBranches whose pushes start a job, for a project from GitHubnone
boxThe project's box settings (Box templates)none

Give one of run and notebook. A requirements.txt in your code is installed before the command runs.

Set up a new project

Put a workbox.yaml at the top of your code, next to what it runs. Workbox reads it wherever your code comes from:

Code fromThe workbox.yaml it reads
A GitHub repoThe one at the root of the repo, at the commit the job runs, so changing it is a commit like any other
Uploaded filesThe one at the top of the files or folder you choose in Run job
A box (Run as job, workbox run)~/work/workbox.yaml, as it is when you run the job

A project's Defaults (open the project and press Edit defaults) are written the same way and are the settings every job starts from. workbox.yaml changes only what it sets, and what you choose when you run a job wins over both.

A repo laid out like this runs with no more settings:

my-model/
├── workbox.yaml
├── requirements.txt
├── train.py
└── serve.py           # only if you serve the model

Start with the fewest settings, a command and a size, and add the rest as you need it:

run: python train.py
gpu: small
outputs:
  - checkpoints/

Your code reads inputs from ~/inputs/<name> and saves what it makes under ~/work, at the paths you list in outputs. To see a whole working example, press Try sample on the Tiny Shakespeare sample in Projects: its defaults are a full workbox.yaml, with inputs, outputs and serve:.

Jobs from GitHub

A project can follow a repo, public or private, on your own account or an organization's.

  1. In Settings, under Connections, press Connect GitHub and install the Workbox app on the repos you choose. An organization's owners install it there; if you aren't one, GitHub asks them for you, and you press Add account once they have. Accounts that already have the app are linked straight away.
  2. Make a project from GitHub, pick the repo, and name the branches it follows.
  3. Every push to a followed branch runs a job from that commit, with the project's defaults and the workbox.yaml in the repo at that commit. on.push in workbox.yaml names the branches instead, when you set it.
  4. The job shows on the commit as a check, from queued to how it ended, with a link to it. A push that can't start (settings that don't read, a missing secret, a spending limit) shows as a failed check saying why.

Run job runs any branch, tag or commit of the repo. Every job runs one exact commit, so running it again runs the same code. Removing the app from a repo on GitHub, or disconnecting the account in Settings, stops its projects' pushes and jobs until it is back.

What you get back

  • Logs, live as the job runs, and searchable after.
  • Charts of loss, accuracy and anything else it reports, with GPU use and memory (Metrics and samples).
  • Outputs to browse, preview, download, use in a later job (job://) or push to the Hugging Face Hub.
  • What went wrong, in plain words, when it fails: out of GPU memory, a missing package, a file that isn't there.

A notification, and an email unless you turn it off, tells you when it ends. Each job records its code (the commit, or the files), image, GPU and what it cost.

Sizes and cost

Pick a size, not a GPU: Workbox runs the job on the cheapest machine with enough GPU memory, across providers. The Run job form shows what it is expected to cost; the job shows what it did. Your workspace's owners and admins set spending limits in Settings.

Your project's box

A job runs on your box of the project, of its size: the same GPU machine, with everything earlier runs left in ~/work (checkpoints, data, installed packages), so each run picks up where the last one stopped. A box that paused because nobody used it is resumed for the job, the next day too. A box you're using (open in the browser, or over SSH, in the last 5 minutes), one you paused yourself, or one busy with another job is left alone, and a new one starts. Open box on the job's page opens it with Jupyter, VS Code and the terminal.

When the job ends, the box stays on: with serve: set, the model it trained starts on the same GPU (when its serve: runs on that box), and Chat answers at once. After 15 minutes with no job, chat or open tool, the box pauses, keeping its files, and costs nothing until the next run.

For a clean run on a box of its own, which ends with the job, tick Fresh machine under Advanced in Run job, or set fresh: true. Jobs started by a push always run fresh.

Look around a running job

Every job runs on a box, and its page has Open box: its terminal, Jupyter and VS Code in the browser, with workbox logs <number> -f following the job's output (CLI). SSH into it by its name, as for any box (SSH into a box).

Next: Metrics and samples

Sign inGet started