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.handlerdef 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.
InstallAdd the surfra package to a project.
First endpointWarm a model, handle one request, and deploy it.
BatchingReplicas, workers, and batch size.
WorkflowsChain handlers into a DAG.
What you run
Section titled “What you run”| 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.
