feat: add CLIP embedding service sidecar for GPU machine

FastAPI service that loads ViT-L-14 model and exposes /embed,
/similarity, and /batch-similarity endpoints. Runs on RTX 3090
with NVIDIA GPU reservation. Includes 9 cosine similarity tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 17:17:42 -06:00
parent b7c729d331
commit 74e12eca60
6 changed files with 438 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
services:
clip-service:
build: .
container_name: clip-service
restart: unless-stopped
ports:
- "5200:5200"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
mem_limit: 4G
memswap_limit: 4G
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:5200/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"