Skip to content

vLLM over HTTP

Dockerfile
FROM vllm/vllm-openai:latest
RUN curl -fsSL https://surfra.io/install.sh | sh
ENTRYPOINT ["surfra", "worker"]
deploy.py
import surfra
surfra.App("qwen").deploy(
image="ghcr.io/you/vllm-surfra:1",
entrypoint="vllm serve Qwen/Qwen3-0.6B --host 127.0.0.1 --port 8000",
runtime={
"engine": "http",
"port": 8000,
"path": "/v1/chat/completions",
"ready_path": "/health",
"ready_timeout": 1800,
},
autoscale={
"max_replicas": 3,
"idle_timeout_sec": 600,
"execution_timeout_sec": 600,
"providers": [
{"provider": "salad", "gpu": "rtx4090", "priority": 1},
{"provider": "runpod", "gpu": "rtx4090", "priority": 2},
],
},
)
chat.py
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.surfra.io/openai/qwen/v1", api_key=os.environ["SURFRA_API_KEY"])
reply = client.chat.completions.create(
model="Qwen/Qwen3-0.6B",
messages=[{"role": "user", "content": "Say hi"}],
)
print(reply.choices[0].message.content)

The first call waits for the image pull and model download. Raise ready_timeout for larger models. The same pattern works for SGLang, TGI, and Ollama. See HTTP servers.