gateway: POST /captions/batch β N images per request, fanned out to vLLMβ
nxj18+1: Claude Fable 5
6d965d5
Callers were firing one HTTP request per image and hitting 429s; now a
single request carries up to 128 base64 images + one prompt. The gateway
fans out to the local vLLM (continuous batching absorbs the concurrency,
bounded at 16 in-flight) and returns captions aligned with the input.
Mirrors /faces/detect's batched shape; counted in CAPTION_STATS.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Retune for L40S (48GB): CUDA graphs back on, roomier memory splitβ
nxj18
3469a45
--enforce-eager and the 0.78 slice were L4 OOM mitigations; on 48GB they
only cost caption throughput. Both are now env-gated (VLLM_ENFORCE_EAGER,
GPU_MEM_UTIL) and overridable as Space variables without a rebuild β set
VLLM_ENFORCE_EAGER=1 / GPU_MEM_UTIL=0.78 if this ever moves back to a
24GB card.
No CPU fallback for the face model: refuse to serve without CUDAβ
nxj18
9cd1a0d
A CPU fallback 'works' 30-60x slower while everything looks green. If the
CUDA provider doesn't load, face_ready stays false with the reason in
/health and every /faces call 503s β callers fail loudly and immediately.
- GPU_MEM_UTIL 0.82 -> 0.78 and --enforce-eager: the ~19GB vLLM slice plus
CUDA-graph overhead plus the ONNX face session tipped the 24GB L4 into an
OOM container restart after the first concurrent faces+captions run
- vLLM now runs under a supervisor loop: a crash restarts it in-container
(gateway reports vllm_ready=false meanwhile) instead of bouncing the Space
- /model-storage bucket (moss-engine pattern): HF cache restored to local
disk at boot when present (mmap must not touch the network mount), and a
fresh download is persisted back once vLLM reports healthy β next cold
boot skips the 17GB fetch
- all output tee'd to /model-storage/logs/space.log (rotated per boot) so
restarts are post-mortemable
- / is public alongside /health so the Space page shows the service card
instead of a 401
Install onnxruntime-gpu LAST (insightface drags in the CPU wheel)β
nxj18
8c70680
Both ORT packages unpack into the same module directory; installing them
in one pip command let insightface's plain-onnxruntime dependency win.
/health's available-provider list ([Azure, CPU], no CUDA) pinpointed it.
Build now asserts CUDAExecutionProvider is available in the image.
Fix CUDA provider load for onnxruntime-gpuβ
nxj18
d543af1
Torch-family images ship cuDNN/cuBLAS as private pip packages under
site-packages/nvidia/*/lib β invisible to the dynamic loader, so ORT's
CUDA EP silently fell back to CPU (caught by /health's provider report).
start.sh now exports those dirs onto LD_LIBRARY_PATH; the Dockerfile
removes any preexisting CPU onnxruntime before installing -gpu; /health
reports available vs loaded providers to make the next such failure
obvious.
- vllm/vllm-openai base: aligned torch/vllm/CUDA; onnxruntime-gpu rides the same CUDA 12 family
- buffalo_l baked into the image (build-time asserted), loaded on CUDA with provider reporting
- gateway: bearer auth (VALID_API_KEYS, fails closed, /health open), streaming /v1 proxy,
batched /faces/detect with queue_wait/gpu_ms/in-flight instrumentation, /stats percentiles
- uid-1000 user, local-disk HF_HOME with optional /data cache restore (patterns from
huggingface-engines/tts-dialogue-engine-moss)