Products

Serverless Functions

2 days

Run a Python function on a GPU by calling it.

how it will work

How it fits into GPU.ai

Serverless Functions will run your own Python code on GPU.ai without renting a machine or building a container. You add one decorator to a function and call it. GPU.ai starts a GPU machine for the call, runs the function on it, and sends the result back.

from gpuai_functions import function

@function(gpu="a100_80gb")
def gpu_name():
    import torch
    return torch.cuda.get_device_name()

gpu_name.remote()  # wait for result
gpu_name.spawn()   # run in background
The planned interface. Names may change before release.
  • One decorator

    Mark a function with @function and name a GPU type, or leave it out and take the cheapest GPU that fits.

  • Wait for it, or run it in the background

    .remote() returns the function's result. .spawn() returns at once with a handle you can check later.

  • Warm between calls

    A machine stays ready for an idle timeout you choose, so the next call skips start up. Then it is released.

  • Billed for machine time

    You will pay for the time the machine exists, on the same GPU.ai account you use for instances.

Start on GPU.ai today

Serverless Functions is not available yet. GPU instances, serverless inference, and reserved capacity are.