From 4c2ecdc8ac66339939fb9042e135bdc47fda682f Mon Sep 17 00:00:00 2001 From: autocommit Date: Tue, 9 Jun 2026 02:37:56 -0700 Subject: [PATCH] =?UTF-8?q?chore(config):=20=F0=9F=94=A7=20Add=20configura?= =?UTF-8?q?tion=20settings=20for=20video=20classification=20limits=20(max?= =?UTF-8?q?=20file=20size,=20timeout,=20concurrency)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../service/src/config/settings.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/services/imajin-video/service/src/config/settings.py b/services/imajin-video/service/src/config/settings.py index dcf095fb..f984746c 100644 --- a/services/imajin-video/service/src/config/settings.py +++ b/services/imajin-video/service/src/config/settings.py @@ -49,6 +49,11 @@ class Settings(BaseSettings): model_boss_timeout_s: float = 60.0 # Max concurrent per-frame scoring calls to model-boss (bounds GPU fan-out). classify_concurrency: int = 4 + # Priority sent to model-boss for frame scoring. "high" (≤5) lets the coordinator + # spawn a SECOND vision slot on the idle GPU (parallel scoring); "normal" keeps it + # to one serialized slot. High preempts normal-priority interactive vision during + # peak — deliberate: video classification is bounded, high-value work. + classify_vision_priority: str = "high" # Content-aware (scene-change) keyframe sampling — clamp band is the GPU-cost lever. classify_scene_min_keyframes: int = 3 @@ -58,6 +63,24 @@ class Settings(BaseSettings): # Sync /classify-video/sync only accepts clips up to this duration. classify_sync_max_seconds: float = 20.0 + # ---- /classify-video object-store source (decision 5 reversed for large videos) ---- + # imajin pulls video bytes from MinIO by storage_key (streamed to disk), so the + # platform never holds the full file in memory and there is no base64 size cap. + # Same MinIO the platform's image path reads (mac-sync bucket on black:9000). + minio_endpoint: str = "black.lan:9000" + minio_access_key: str = "" + minio_secret_key: str = "" + minio_bucket: str = "mac-sync" + minio_secure: bool = False + + # Server-capability bound on CONCURRENT video decodes. The throttle lives HERE, + # on the server — never on the client. This is the ceiling; it is clamped down to + # available RAM at startup (see pipeline.capability.derive_video_concurrency). + classify_video_concurrency: int = 4 + # Approx RAM headroom to reserve per concurrent decode (4K decoder + frame buffers + # + slack). The RAM clamp keeps concurrency × budget under available memory. + classify_video_ram_budget_bytes: int = 1_500_000_000 + model_config = SettingsConfigDict(env_prefix="IMAJIN_VIDEO_", case_sensitive=False)