Adding a GPU to a function

Beam offers a fast way to spin up GPU runtimes for development.

You can add a GPU to your runtime by passing a gpu argument to your Runtime. Currently, available GPU options are A10G (24GB), T4 (16GB), or A100-80 (80GB).

You can also pass in an any argument, which will use whichever GPU is available when you run your app.

Due to ongoing capacity limitations, certain machines may not be available on-demand.

from beam import App, Runtime

app = App(name="gpu-app", runtime=Runtime(gpu="T4"))
def inference():
    print("📡 This is running on a GPU!")

GPU Examples