You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serving image: startup self-warmup gets HTTP 401 when DGEM_SERVER_KEY is set #57
When DGEM_SERVER_KEY is configured on the serving container, structured_server.py requires a matching X-DGem-Key header on every POST request (401 otherwise).
In deploy/cloudrun/entrypoint.sh, the startup self-warmup loop (SELF_WARMUP=1) posts samples=1, vision, and samples=4 warmup requests to http://127.0.0.1:${PORT}/v1/chat/completions with only content-type: application/json (no X-DGem-Key header, no Authorization: Bearer header when API_KEY is set, and targeting $PORT rather than $SS_PORT when ROLE=decision-index).
As a result, when DGEM_SERVER_KEY is set:
Every self-warmup request fails with [warmup] failed samples=1: <HTTPError 401: Unauthorized>.
warmup_state.json still writes "warmed": true, even though no request reached vLLM and the first live decision request pays the full cold kernel/JIT warmup penalty.
Suggested fix
In deploy/cloudrun/entrypoint.sh, send the first non-empty entry of DGEM_SERVER_KEY in the X-DGem-Key header (and API_KEY as Authorization: Bearer when set) to SS_PORT on startup self-warmup requests.
Record "warmed": false in warmup_state.json if any self-warmup request fails.
Add a unit test in deploy/cloudrun/server/test_server_key.py verifying that entrypoint.sh's self-warmup succeeds with DGEM_SERVER_KEY rotation lists and records "warmed": false on 401.
Activity
fix(serving): send X-DGem-Key on entrypoint self-warmup requests