Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
48 lines (48 loc) · 1.82 KB
/
Copy pathrender.yaml
File metadata and controls
48 lines (48 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Render blueprint for the NOVA FastAPI backend.
#
# Deploy: push to GitHub, then on Render choose New + > Blueprint and point it
# at this repository.
#
# WHY DOCKER RATHER THAN runtime: python
# requirements.txt pins torch==2.5.1, and installing that from PyPI pulls the
# CUDA build, roughly 2.5GB of libraries this CPU-only service never uses. That
# alone exceeds the free tier's build and image budget. The Dockerfile installs
# CPU-only torch from download.pytorch.org first, so the rest of the file
# resolves against a wheel that is already satisfied. Building through Docker
# is what makes the free plan possible at all here.
#
# WHY MAX_ROWS IS 6000
# The free instance has 512MB. Measured on 2026-09-04 with
# scripts/measure_memory.py, resident set size:
#
# torch imported 197 MB
# + sklearn, pandas, scipy 292 MB
# + fastapi, uvicorn 306 MB
# model loaded, idle 334 MB
# peak during 1000 rows 388 MB
# peak during 3000 rows 400 MB
# peak during 6000 rows 446 MB <- the cap, 66 MB under the limit
#
# So 6000 fits and is not a guess, but the margin is thin: torch alone is more
# than half the budget before a single row is generated. Raising the cap needs
# a larger instance, not a smaller batch.
#
# COLD STARTS
# Free instances sleep after inactivity and take roughly 50 seconds to wake.
# The frontend has to tolerate a slow first request rather than treat it as a
# failure.
services:
- type: web
name: nova-backend
runtime: docker
plan: free
rootDir: backend
dockerfilePath: ./Dockerfile
healthCheckPath: /api/health
envVars:
# Tighten to the Vercel origin once the URL is settled. Left open here so
# the first deploy is not blocked by a CORS mismatch.
- key: CORS_ORIGINS
value: "*"
- key: MAX_ROWS
value: "6000"