Factordocs

The manifest

factory.yaml — what a factory is, written down.

factor deploy reads a manifest. It is the same machine you could describe with flags, kept in a file so it is reviewable, repeatable and can live in the repository it deploys.

factory.yaml
version: 1 # What to rent.hardware: 24gb-class:1zone: eudisk_gb: 100 # What to run it on. A published name, or your own reference.image: python # Once, when the machine comes up.setup:- pip install -r requirements.txt # The workload itself.run: python serve.py # Injected as environment variables.env:MODEL: llama-3.1-8bBATCH_SIZE: "8" # Encrypted, and injected by name. The values live in Factor, not here.secrets:- HF_TOKEN # Results, and where to mirror them.volume:out: /factory/outlocal: ./results # Suspend after this long with nothing running. 0 never suspends.idle_timeout: 30m

Every field

FieldMeaning
versionAlways 1 today. Present so a future change can be made without breaking your file.
hardwareWhat to rent — 24gb-class:1, a6000:1, 80gb-class:2. factor hardware lists it.
zoneWhere to run: a zone, region, country or city. factor zones lists them.
disk_gbKept for compatibility; machines have a fixed 100 GB system disk plus a fast scratch disk at /scratch. See disk.
workspace_gbFactories only. Kept for compatibility: /workspace lives on the machine's 100 GB system disk, the one place files survive a stop.
imageBase image: a published name such as python, or the full reference of your own. factor images lists them. Defaults to python.
setupShell command lines run as root before the workload, on every start. &&, quotes and pipes work.
runThe workload. Runs as an unprivileged user.
portsFactories only. HTTP ports to give a public HTTPS address, 1024–65535, at most five. See reaching it over the network.
envEnvironment variables. Plain text — for anything secret use secrets.
secretsNames of stored secrets to inject. The values are never in this file.
volume.outThe directory whose contents are collected. Defaults to /factory/out.
volume.localA local directory to mirror results into as they are written.
idle_timeoutSuspend after this long idle. 0 never suspends.
modefactory or sandbox. factor deploy implies factory.
delete_on_finishSandboxes only. true deletes the machine when the run ends instead of suspending it. --delete-on-finish beats it; it beats factor config.

Where it is found

factor deploy                       # ./factory.yamlfactor deploy ./infra/serve.yaml    # a named filefactor deploy --manifest ./infra    # a directory holding factory.yaml

Environment files

For values that change per person or per machine, keep them out of the manifest:

factor deploy --env .env.local

Values from a .env file are encrypted and injected into that machine only. They are not stored as team secrets and are not visible to anything else.