Skip to main content

Module health

Module health 

Source
Expand description

GET /health and GET /health/deep handlers.

/health returns lightweight readiness status from in-memory atomics. /health/deep runs a tiny canary inference (batch=1, seq≈8 tokens) and returns 503 if the actual embedding pipeline is broken.

Constants§

DEEP_HEALTH_CANARY 🔒
Fixed canary text for /health/deep. Tokenises to ~8 tokens with the BGE-M3 SentencePiece vocabulary, meeting the “batch=1, seq=8” goal.
DEEP_HEALTH_TIMEOUT 🔒
Timeout for the canary embed call in /health/deep.

Functions§

health
Handles GET /health — returns readiness status, worker counts, and tuning diagnostics.
health_deep
Handles GET /health/deep — runs a tiny canary inference and returns 503 if the actual embedding pipeline is broken.