services: - type: web name: deepfake-detector runtime: python plan: free # NOTE: 512 MB RAM — quantization enabled below to squeeze in buildCommand: pip install --upgrade pip && pip install -r requirements.txt && python download_model.py startCommand: gunicorn app:app --workers 1 --threads 4 --timeout 300 healthCheckPath: /health envVars: - key: PYTHON_VERSION value: "3.11.9" - key: FLASK_SECRET_KEY generateValue: true - key: DEEPFAKE_MAX_FRAMES value: "24" # int8 dynamic quantization: required to fit the ViT in 512 MB free tier - key: DEEPFAKE_QUANTIZE value: "1" # Optional: persist the model + SQLite history across deploys with a # Render persistent disk (requires a plan that supports disks). # - key: DEEPFAKE_MODEL_DIR # value: /var/data/models # disk: # name: model-disk # mountPath: /var/data # sizeGB: 2