feat(ai-runtime): complete ai runtime policy refactor (ADR-035)
CI / CD Pipeline / build (push) Successful in 4m16s
CI / CD Pipeline / deploy (push) Successful in 11m51s

This commit is contained in:
2026-06-12 08:07:15 +07:00
parent 71c5e88181
commit 0227b7b982
63 changed files with 3566 additions and 451 deletions
@@ -13,6 +13,7 @@
# - 2026-06-04: ADR-034 — เปลี่ยน TYPHOON_OCR_MODEL เป็น typhoon-np-dms-ocr:latest; OLLAMA_API_URL ชี้ตรงไป Ollama (ไม่ผ่าน metrics proxy) เพื่อป้องกัน empty response
# - 2026-06-02: เพิ่ม ollama-metrics (NorskHelsenett) — Prometheus sidecar สำหรับ Ollama metrics
# expose /metrics บน port 9924; Prometheus (ASUSTOR) scrape จาก 192.168.10.100:9924
# - 2026-06-11: US2 & US3 - เพิ่ม VRAM headroom, residency window, pressure threshold, retrieval timeout env variables
#
# วิธีรัน:
# docker compose up -d --build
@@ -45,6 +46,12 @@ services:
TYPHOON_OCR_MODEL: "typhoon-np-dms-ocr:latest"
# Timeout 360 วินาที/หน้า — รองรับ cold-start โหลด model (~70s) + inference (10GB model, CPU offload)
TYPHOON_OCR_TIMEOUT: "360"
# ─── VRAM, Residency & Timeout Configurations (Feature-235) ──────────────
VRAM_HEADROOM_THRESHOLD_MB: "3000.0"
OCR_RESIDENCY_WINDOW_SECONDS: "120"
GPU_TOTAL_VRAM_MB: "16384.0"
GPU_MAIN_MODEL_PRESSURE_THRESHOLD_MB: "12000.0"
RETRIEVAL_TIMEOUT_SECONDS: "30.0"
logging:
driver: "json-file"
options: