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.
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: 30mEvery field
| Field | Meaning |
|---|---|
version | Always 1 today. Present so a future change can be made without breaking your file. |
hardware | What to rent — 24gb-class:1, a6000:1, 80gb-class:2. factor hardware lists it. |
zone | Where to run: a zone, region, country or city. factor zones lists them. |
disk_gb | Kept for compatibility; machines have a fixed 100 GB system disk plus a fast scratch disk at /scratch. See disk. |
workspace_gb | Factories only. Kept for compatibility: /workspace lives on the machine's 100 GB system disk, the one place files survive a stop. |
image | Base image: a published name such as python, or the full reference of your own. factor images lists them. Defaults to python. |
setup | Shell command lines run as root before the workload, on every start. &&, quotes and pipes work. |
run | The workload. Runs as an unprivileged user. |
ports | Factories only. HTTP ports to give a public HTTPS address, 1024–65535, at most five. See reaching it over the network. |
env | Environment variables. Plain text — for anything secret use secrets. |
secrets | Names of stored secrets to inject. The values are never in this file. |
volume.out | The directory whose contents are collected. Defaults to /factory/out. |
volume.local | A local directory to mirror results into as they are written. |
idle_timeout | Suspend after this long idle. 0 never suspends. |
mode | factory or sandbox. factor deploy implies factory. |
delete_on_finish | Sandboxes 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.yamlEnvironment files
For values that change per person or per machine, keep them out of the manifest:
factor deploy --env .env.localValues 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.