Metadata-Version: 2.5
Name: workbox
Version: 0.2.2
Summary: Workbox: SSH into your GPU boxes, and log metrics and samples from training jobs.
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# workbox

The Python package for Workbox: GPU boxes with Jupyter, VS Code, a terminal
and SSH, and training jobs that keep everything they make.

```bash
pip install workbox        # or: uv tool install workbox
```

It has no dependencies, and works on Python 3.10 and later.

## SSH into your boxes

Sign in once on each computer. It opens your browser to approve the computer, makes a key for Workbox and adds
`Host *.workbox` to `~/.ssh/config`:

```bash
workbox login --url https://your-workbox
```

Then connect to a running box by its name, from the terminal or from your editor:

```bash
workbox boxes                # your boxes and their names
workbox ssh tinystories      # or: ssh tinystories.workbox
scp data.csv tinystories.workbox:~/work/
```

In VS Code or Cursor, use Remote-SSH and connect to `tinystories.workbox`. A running job's machine is
`<project>-job-<number>.workbox`, for example `workbox ssh tinystories-job-42`.

Each connection gets a certificate for that one box, valid for 12 hours, and a one-use pass through the box's HTTPS
port. No port is left open and no key stays on the box. `workbox logout` signs the computer out; you can also sign
computers out from your account in Workbox. You need OpenSSH (`ssh` and `ssh-keygen`), which macOS, Linux and
Windows 10 or later have.

## Metrics and samples from your training code

```python
import workbox

workbox.log(step=step, loss=loss, lr=lr)       # live charts on the job's page
workbox.sample(step=step, text=story)          # or image="plot.png", or a PIL image
```

Inside a Workbox job these are reported as the job runs. Anywhere else (your laptop, Colab) they do nothing, so the
same code runs everywhere. They never raise: a training run never fails over a chart.

## What else is in it

The same package runs inside every Workbox image: `workbox-runner` runs a job and reports to Workbox, and
`workbox-box` runs a box (its gateway, tools and SSH). You don't run those yourself.
