Want to run your own instance? One command after Modal setup.
pip install modal
modal token newgit clone https://github.com/useknockout/api.git
cd api
# create your bearer-token secret
modal secret create knockout-secrets API_TOKEN=$(openssl rand -hex 32)
# deploy
modal deploy main.pyModal prints your live HTTPS URL. First deploy takes ~5 min (image build + weight bake). Subsequent deploys take seconds.
Edit main.py:
@app.cls(
gpu="L4", # or "A10", "A100", "H100"
scaledown_window=60, # seconds of idle before scale-to-zero
max_containers=10, # max concurrent containers
)- Latency-critical? Keep one warm:
min_containers=1(costs ~$0.80/hr 24/7). - Throughput-critical? Bump
max_containersand use@modal.concurrent(max_inputs=4)to batch. - Higher quality? Change
MODEL_INPUT_SIZEto(2048, 2048)— 4x slower, sharper edges.