Skip to content

Examples

Each example is complete: the code, the image, the deploy call, and a call. Python examples use this Dockerfile, with the file name changed:

Dockerfile
FROM python:3.12-slim
RUN pip install surfra
WORKDIR /app
COPY app.py .
CMD ["surfra", "worker"]
Example What it shows
Hello Warmup once, return JSON, run on CPU
Batch Several requests through one loaded model on a GPU
Progress Report progress from inside a generation loop
vLLM over HTTP An OpenAI-compatible server with no handler
Your machine Your own GPU first, the cloud as backup