Factordocs

Images

Pick a published image, or bring your own.

Every machine starts from a container image. You do not have to build one: Factor publishes a small set, and naming one is a single flag.

The published images

Each one has a short name. That name is the whole reference: you never type a registry path to use a published image.

factor images
NameSizeWhat is in it
python103 MBPython 3.12, pip, uv. Start here.
server119 MBThe above, plus FastAPI and uvicorn.
python-cuda1.6 GBPython plus the CUDA runtime libraries.
server-cuda1.6 GBpython-cuda, plus FastAPI and uvicorn.
pytorch4.8 GBPyTorch already installed.
cuda~9 GBThe CUDA toolkit and nvcc, for compiling kernels.

All public, no login, and every one of them can run on a GPU.

The size column is the thing to look at. It is paid before your code starts, on a machine you are already being billed for, every time a machine comes up cold — so the difference between the first row and the last is minutes of paid waiting.

Naming one

The same name works in both places. On the command line, -i or --image:

factor sandbox train.py -i python --gpu 24gb-classfactor deploy -i server-cuda

Or in a manifest:

factory.yaml
version: 1hardware: 24gb-class:1image: pythonrun: python train.py

A flag beats the file, so trying a different image does not mean editing a manifest that is checked in.

Which one

Installing PyTorch, JAX or anything from pip?

python, and install it in setup. The image is 103 MB and the install is a minute — usually faster overall than pulling the 4.8 GB image that has it built in.

pytorch wins when you start machines constantly and the provider has the image cached on the host, so the pull is free and the install is not.

Serving requests?

server, or server-cuda. FastAPI and uvicorn are already there; you write the endpoint.

Compiling CUDA yourself?

cuda. nvcc and the headers.

Something wants system CUDA libraries?

python-cuda. Rare, and worth checking you actually need it: try python first and see whether it works.

A first run, start to finish

No Dockerfile anywhere.

train.py
import torchprint("device:", torch.cuda.get_device_name(0))with open("/factory/out/ok.txt", "w") as f:  f.write("done")
factor sandbox train.py -i python --setup "uv pip install --system torch" --gpu 24gb-class --stream

uv is preinstalled and resolves far faster than pip, which matters when the install happens on a rented GPU every run. Plain pip install works too.

Serving, start to finish

app.py
from fastapi import FastAPI app = FastAPI() @app.get("/health")def health():  return {"ok": True}
factory.yaml
version: 1hardware: 24gb-class:1image: serversetup:- uv pip install --system -r requirements.txtrun: uvicorn app:app --host 0.0.0.0 --port 8000idle_timeout: 0
factor deploy

Pinning a version

A short name resolves to latest, which moves when the images are rebuilt — that is how security fixes arrive without anybody editing a manifest. For anything that must behave the same in six months, give the full reference with a version or a digest instead:

-i ghcr.io/feweir/factory-python:v0.4.0

Any other public image

Nothing is special about ours. Any public image from any registry works, as long as it is linux/amd64 and has a shell at /bin/sh:

factor sandbox train.py -i pytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtime

You do not need to install an agent, expose a port or set an entrypoint — that is handled, and an ENTRYPOINT of your own is ignored.

Building your own

Worth it when your dependencies take minutes to install and you run often. Not worth it for a one-off — --setup is faster to write and faster to change.

Build it yourself, then name it

Build the image, push it somewhere public, and pass the reference. There is no step in between:

Dockerfile
FROM ghcr.io/feweir/factory-python:latest RUN uv pip install --system torch transformers
docker build --platform linux/amd64 -t ghcr.io/you/your-image:v1 .docker push ghcr.io/you/your-image:v1 factor sandbox train.py -i ghcr.io/you/your-image:v1

--platform linux/amd64 is not optional. Every GPU host is x86, and an image built on an Apple Silicon machine without that flag is ARM and will not start.

Starting FROM one of ours is the easy path, but nothing requires it — see what an image has to provide.

What an image has to provide

  • Linux, x86-64. ARM images will not start.
  • A shell at /bin/sh. Setup commands and your workload run through it.

That is all. In particular it does not need the CUDA runtime — a wheel that carries its own works on a plain image, and the driver comes from the machine.

You do not need to install an agent, expose a port, or set an entrypoint — that is handled for you, and an ENTRYPOINT of your own is ignored.

Setup, instead of an image

For anything that installs in seconds, skip the image entirely:

factor sandbox train.py --setup "uv pip install --system -r requirements.txt"

Runs once per machine, as root, before your workload.

Building a CUDA image well is its own subject, and these are the references worth having open.