/** * media-capability.ts — single hardware-capability probe that selects the AV * model stack (edge | baseline | forensic, spec §6) and per-adapter device + * precision hints (spec §22), so the entity-comprehension system autodetects * what it can run instead of hard-coding a deployment. * * This generalizes the existing per-tool video-scan tier ladder * (`~/.omnius/video-scan.json`, tiers extended|standard|reduced|forced_cpu) * into ONE selector shared by every AV adapter. Result is cached to * `~/.omnius/av-capability.json` (capability metadata stays in the omnius home, * NOT the relocatable media store) and re-probed when stale. */ export type AVStack = "edge" | "baseline" | "forensic"; export type AVDevice = "cuda" | "cpu"; export type AVPrecision = "bf16" | "fp16" | "fp32"; export interface GpuInfo { name: string; memTotalMiB: number; memFreeMiB: number; index: number; /** Compute capability like "8.0" (A100) or "6.1" (GT 1030); "" if unknown. */ computeCap?: string; } /** Whether a GPU's compute capability is usable by the modern torch build. */ export declare function gpuComputeUsable(computeCap?: string): boolean; export interface MediaCapability { /** Selected model stack per spec §6. */ stack: AVStack; /** Primary accelerator. */ accelerator: AVDevice; /** Default precision for heavy adapters on the primary accelerator. */ precision: AVPrecision; /** Largest single-GPU VRAM in GiB (0 when CPU-only). */ vramGiB: number; /** Count of usable CUDA GPUs (>= ~8 GiB). */ gpuCount: number; /** All detected GPUs (including small/unusable ones). */ gpus: GpuInfo[]; /** Logical CPU cores. */ cpuCores: number; /** Total system RAM in GiB. */ ramGiB: number; /** Free disk (GiB) on the omnius home volume. */ diskFreeGiB: number; /** ffmpeg available on PATH (required for ingest). */ hasFfmpeg: boolean; /** Auto-selected CUDA_VISIBLE_DEVICES — only torch-compatible, ≥8 GiB GPUs * (excludes pre-Volta cards like a GT 1030 that hang CUDA init). "" = CPU. */ cudaVisibleDevices: string; /** Human-readable reason for the stack choice. */ reason: string; /** ISO timestamp the probe ran. */ probedAt: string; } /** Probe NVIDIA GPUs via nvidia-smi; returns [] when unavailable. */ export declare function probeGpus(): GpuInfo[]; /** * Select the stack + precision from raw hardware facts. Pure (no I/O) so it is * directly unit-testable with synthetic hardware. * * §6 mapping: * - forensic : multi-GPU (>=2 usable) OR a single >=48 GiB GPU — multi-pass, * thinking-variant LALM, high-res reinspection. * - baseline : one usable GPU (>= ~16 GiB) — V-JEPA2-L/VideoPrism, YOLOE+SAM2, * event-triggered 7B VLM/LALM. * - edge : small/no GPU — keyframe detectors, lite encoders, CPU fallbacks. */ export declare function selectStack(facts: { gpus: GpuInfo[]; cpuCores: number; ramGiB: number; }): { stack: AVStack; accelerator: AVDevice; precision: AVPrecision; vramGiB: number; gpuCount: number; cudaVisibleDevices: string; reason: string; }; /** Per-adapter device/precision hints derived from the capability (spec §22). */ export interface AdapterPlacement { device: AVDevice; precision: AVPrecision; /** Whether the adapter should only run on event windows (cost control). */ eventTriggered: boolean; } export declare function adapterPlacement(cap: MediaCapability, role: "video_temporal" | "grounding" | "tracking" | "audio_event" | "audio_lalm" | "video_llm" | "cross_modal" | "asr"): AdapterPlacement; /** Full hardware probe (does I/O). */ export declare function probeCapability(): MediaCapability; /** Probe with a cached result (re-probes when older than the TTL or forced). */ export declare function getMediaCapability(opts?: { force?: boolean; }): MediaCapability;