Skip to content

Introduction

Surfra is a serverless GPU platform. Your code is a Python file with a handler. Surfra places that file on a machine, queues requests, and scales replicas.

import surfra
@surfra.handler
def predict(request: surfra.Request):
return {"text": request.input["prompt"]}

A handler file has one @surfra.handler. Deploy that file inside a container, then call App.deploy with the image name. The same app name updates the endpoint in place.

Piece Where it lives
Handler and warmup Your container image
App.deploy Your laptop, or CI, with an API key
Worker process Started by Surfra inside the replica

The worker process receives SURFRA_REPLICA_TOKEN, SURFRA_MASTER, and SURFRA_ENTRYPOINT from the autoscaler. You do not put database credentials or provider keys in the image.