temperwork Blog Documentation
Guides

Running on AWS

How to run temperwork's work in your own AWS account, with your data in your own bucket. temperwork/self-hosted-aws-env is a Terraform module that sets it up; this guide says what it makes and how the pieces fit, and its README walks through each step.

The Terraform module is the one supported way to set up your own environment; there is no CloudFormation stack.

How the pieces fit

temperwork is split in two:

  • The control plane is temperwork itself. It plans a run, records it, writes its record to your control bucket and sends one message to the queue of the model it runs on. It never runs anything, and never receives queue messages.

  • The data plane is in your account: your queues, your buckets and your workers. A worker takes the message, reads its inputs from your data bucket, runs the steps on the model on its own GPU, writes the outputs back and updates the record. temperwork follows the run by reading that record.

The page shows files from signed S3 links that your browser opens itself, inside your network, so your files never pass through temperwork.

What the module makes

A queue per modelOne SQS FIFO queue for each model and kind of work you list in workers (model:<model> for a model's runs, training:<model> for its trainings), one per judge model you host (judge_worker.models), and the judges queue. temperwork sends a model's work only to its queue, so it sends nothing for a model you don't run.
A data bucketYour datasets, anywhere in it. Your workers write outputs under <prefix>datasets/ and trained LoRAs under <prefix>loras/. temperwork can't write to it, and can read it only through links that work from your network.
A control bucketA separate bucket for the records temperwork and your workers share: runs, pipelines, worker heartbeats, dataset file lists. The only place in your account temperwork can write.
The control-plane roletemperwork-cp-<name>: what temperwork assumes, with an external id you choose. It can send to your queues, use the control bucket and sign links to your data. A bucket policy denies it any read that doesn't come through your S3 VPC endpoint, so it can sign a link but can't fetch the file itself.
The workers' role<name>-tw-worker, for your EC2 workers: your queues, both buckets, and Bedrock for judges' LLM steps.

The module's security model lists every permission, with links to the policies.

Setting it up

  1. On temperwork, open Settings → Environments → Add environment. The form shows the role ARN your account will trust and a random external id.

  2. Apply the module: examples/complete if your account has no network for this yet (it builds a VPC, S3 endpoints and, optionally, a Client VPN), or examples/existing-network with your own S3 VPC endpoint.

  3. Run terraform output -json environment and copy its values into the form: pick the region, add each queue with Add a queue and give its URL, then the data root, control prefix and role ARN. Check the external id, save, and click Test on the environment's card.

For judges with LLM steps, enable the Anthropic models in Bedrock yourself (Bedrock console, Model access), in your region and in the regions of the US or global inference profiles you use. The workers can call the models (bedrock_models) but can't enable them.

Workers

Each worker image serves one model and does one kind of work, on that model's queue. List them in the module:

workers = {
  edit    = { model = "qwen-image-edit-2511", work = "inference", image = "<image>", instances = 1 }
  trainer = { model = "qwen-image-edit-2511", work = "training",  image = "<image>" }
}
judge_worker = { image = "<image>", instances = 1 }

Use the images' customer-prod-latest tags from ghcr.io/temperwork (public, no sign-in), each named after its model: qwen-image-edit-2511 and qwen-image-edit-2511-trainer (its trainings), ltx-2.5 and ltx-2.5-trainer, qwen-vl (the self-hosted judge models) and, for judge_worker, judge-worker, as in ghcr.io/temperwork/qwen-image-edit-2511:customer-prod-latest. They hold the compiled worker, temperwork-worker, which trusts only temperwork.com. Each worker joins your environment once with an enrollment token (Environments and enrollment tokens).

There are three ways to run them, and each entry decides for itself:

  • From the module: instances > 0 keeps that many always-on EC2 instances running it. They bill while they run, whether or not there's work.

  • Your own EC2 instances: launch them with the module's ec2-user-data.sh and its instance profile. Each powers off once its queue has been empty for a while, so you pay only while there's work. temperwork doesn't start workers in your account: start them by hand or with your own scaling, by queue depth.

  • Anything else: ECS, Kubernetes or GPUs outside AWS (Running outside AWS). The module's outputs have everything a worker needs: worker_env, each entry's settings in workers, and worker_policy_json.

The module's workers guide covers each, with every setting.

Seeing the files

The page opens files and folder listings from signed S3 links, so your browser must reach the data bucket through your S3 VPC endpoint: in your VPC, or on a VPN into it with the bucket's name resolving to an S3 interface endpoint. The module's browser access guide says how. Off your network the page still shows runs and their status, but not their files.

On this page