Factordocs
You’re seeing Factory documentation.Machines that stay up between runs. Sandboxes instead

Factories

A machine that stays up between runs, and keeps its disk.

A factory is a machine that outlives the thing it is running. Deploy one and it stays there: you can shell into it, redeploy to it, suspend it and bring it back with its /workspace disk intact.

Use one for anything without a natural end — an inference endpoint, a long-lived development box, a service you redeploy from a repository on every push.

factor deploy

Sandbox or factory?

SandboxFactory
Ends whenyour script exits, then waits suspendedyou stop it
Filesnot kept between runs/workspace kept across suspends
Billedwhile the script runswhile running; only the /workspace disk while suspended
Shell into itnoyes
Redeploy on a pushnoyes
Good fortraining, batch, experimentsserving, dev boxes, anything long-lived

If the work has an end, you want a sandbox. It costs less and there is nothing to forget about.

Deploying one

A factory is described by a manifest:

factory.yaml
version: 1hardware: 24gb-class:1zone: eusetup:- pip install -r requirements.txtrun: python serve.pyidle_timeout: 30m
factor deploy

Each factor deploy creates a new factory, with its own machine and disk. To update one in place, connect it to a repository: a push redeploys it on the same machine, keeping the disk.

The lifecycle

factor list                    # what you havefactor shell fac_01M0AM…       # get on itfactor logs fac_01M0AM… -f     # what it is printingfactor stop fac_01M0AM…        # suspend: /workspace kept, compute billing stopsfactor start fac_01M0AM…       # resume, /workspace intactfactor rm fac_01M0AM…          # terminate permanently, disk included

Stopping releases the GPU so it stops billing — which also means the card is not held for you. start needs a card of the same kind free in the factory's zone; if none is, it says so (no capacity to resume) and you try again a little later. Suspending takes several minutes and waking takes a few more, so stop a factory you are done with for the day, not for a coffee. For something that must always answer, leave it running with idle_timeout: 0.

What survives a stop

Only /workspace. Everything else in the container is reset when it starts again, and your setup steps run again; /scratch is wiped. Keep models, caches and data in /workspace:

factory.yaml
env:HF_HOME: /workspace/huggingface

/workspace lives on the machine's own 100 GB system disk, which is kept whole while the factory is stopped. While stopped, that disk costs $0.07 per GB per month at the provider, plus your plan's margin; while running it is included in the machine's price.

Idle timeout

idle_timeout: 30m

The factory suspends itself after that long with nothing running, and you stop paying for compute. Set 0 to never suspend — appropriate for something serving traffic, expensive for a dev box you forget about on a Friday.

The shell

factor shell fac_01M0AM…

A real interactive shell on the running machine. There is no inbound port open on it: the machine dialled out to us, and your keystrokes travel back down that connection. Nothing is listening on the pod for anyone to find.

You are the same unprivileged user your workload runs as.

Deploying from GitHub

Connect a repository to a factory and a push redeploys it. The factory has to exist first — a push never creates a machine, because that would let a commit message allocate billable hardware.

Setting up GitHub deploys

Reaching it over the network

List the ports your server listens on under ports:, and each gets a public HTTPS address — no tunnel, no extra account:

factory.yaml
version: 1hardware: 24gb-class:1setup:- pip install -q fastapi uvicornrun: uvicorn app:app --host 0.0.0.0 --port 8000ports:- 8000

factor deploy prints the address, factor info <id> prints it again, and the machine's page in the dashboard links it:

$ factor info fac_01K7QW3M8N2P5RTV9XZ4B6CDEFPort 8000      https://p8000.38-80-123-24.sslip.io

The address is assigned once the machine is up, a minute or two after factor deploy returns; until then factor info says so. It is the machine's own public IP, served over HTTPS with a certificate obtained automatically.

  • Listen on 0.0.0.0. A server bound to 127.0.0.1 — the default of many frameworks — cannot be reached, and the address answers 502.
  • Ports 1024 to 65535, at most five. Your program runs unprivileged, so it cannot bind 80 or 443; the public address is HTTPS on 443 whatever the port inside.
  • HTTP only, websockets and server-sent events included.
  • The address answers once your server is listening — after setup and model loading — and stays the same across factor stop and factor start.
  • ports is fixed when the factory is created. Factories only: a sandbox stops when its command does.

Costs

Billed per second while running. Stopped, you pay only for the disk it keeps — 100 GB at $0.07 per GB a month, plus the margin of your plan. Terminated, nothing.

factor billing balancefactor stats                   # spend and reliability, per machine