beam-logo
← All use cases
Training & Fine-tuning

Run GPU training jobs on-demand

Start a training run on cloud GPUs with a decorator and a function call. No cluster to set up, no instances to monitor. Beam provisions containers, streams logs to your shell, and stops billing the second the job ends.

Why Beam

Cloud GPU training that feels local

Keep your training loop, drop the infrastructure. Beam runs the compute and gets out of the way.

How it works

Start training in three steps

01

Decorate your function

Add @function with the GPU, CPU, memory, and image you need. Your code stays plain Python.

02

Run the file

Calling .remote() ships your working directory to a fresh container and streams logs back to your terminal.

03

Serve what you trained

Checkpoints written to a volume persist after the container exits. Deploy an endpoint that mounts the same volume and your model is serving traffic — no artifact export, no second platform.

terminal
$ python train.py

=> Building image
=> Syncing files
=> Running function: <train:train>
epoch 0: loss=2.113
epoch 1: loss=1.874
...
=> Function complete

# Checkpoints persist after the run
$ beam ls checkpoints
epoch-0.pt
epoch-1.pt
FAQ

Frequently asked questions

How long can a training job run?

As long as you need. Timeouts are configurable in seconds, and setting timeout=-1 disables them entirely for multi-day runs.

Can jobs keep running after I close my laptop?

Yes. Set headless=True on the function and the task keeps running in the background on Beam after your local process exits.

Where do datasets and checkpoints live?

On persistent storage volumes mounted into the container. They survive across runs and are readable from any other Beam function or endpoint.

Do I pay for provisioning time?

No. Beam only charges for the time your application code is running — never for server spin-up or container image pulls.

Can I run many experiments at once?

Yes. Use .map() to fan a training function out over a list of configs — each run gets its own container and GPU.

How do I serve the model once training finishes?

Deploy an endpoint that mounts the same volume your checkpoints were written to — training and serving run on one platform, with no artifact export step in between. The fine-tuning guide walks through the full loop.

Does it work with Weights & Biases and Hugging Face?

Yes. Add wandb or huggingface_hub to your image, store API keys with Beam's secrets manager, and log runs as usual — Beam's fine-tuning examples track training in W&B out of the box.

Can I train on multiple GPUs?

Yes. The gpu_count parameter runs your job across multiple GPUs on the same machine — message us in Slack and we'll enable it on your account.

$30 free creditrefreshed monthly

Start shipping on infra
you won’t outgrow.

Run sandboxes and GPU workloads on your cloud, and scale out to ours when you need to. No infra to manage.