Spaces:
Paused
Paused
Warm the model in the background so the app listens immediately
Browse files16 unmodified lines171819202122232416 unmodified linessleep 1done# Resident before the first visitor, so nobody pays the load.curl -sf http://127.0.0.1:11434/api/generate \-d '{"model":"granite4:micro","keep_alive":"-1"}' >/dev/null 2>&1 || trueexec node /app/server.mjs16 unmodified lines17181920212223242526272829303116 unmodified linessleep 1done# Resident before the first visitor, so nobody pays the load. In the# background, because loading 2.1 GB is slow on a CPU Space and the app has to# be listening on $PORT before the platform's startup window closes. The# coverage screen needs no model at all, so it should not wait for one.(curl -sf http://127.0.0.1:11434/api/generate \-d '{"model":"granite4:micro","keep_alive":"-1"}' >/dev/null 2>&1 \&& echo "model resident" \|| echo "model warm-up failed; first query will pay the load") &exec node /app/server.mjs
start.sh+10-3