feat(agent): idle-unload GPU models to free VRAM when the queue is idle #233
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The GPU agent kept the SigLIP embedder + YOLO proposers resident for the container's whole lifetime, so a 24/7 agent with an empty queue squatted on ~5GB of VRAM doing nothing (operator-observed: 4900MiB held at GPU-util 8% / P8). Sleep mode only sheds downloaders; even a UI Stop left the models loaded.
Adds a monitor thread that unloads the torch-owned models after
cfg.idle_unload_seconds(envIDLE_UNLOAD_SECONDS, default 300; 0 disables) with the GPU genuinely idle (active==0, buffer drained, no job completed in the window), thentorch.cuda.empty_cache(). They reload lazily on the next job. Covers both sleep-mode idle and a full Stop. Surfaced in/status(models_loaded) + the agent UI pipe line.Residual: imgutils CCIP/person ONNX sessions + the CUDA context stay resident (no clean unload API) — idle VRAM drops substantially, not to zero.
CI green on dev head
57e5243(run #2472). Merging publishesfabledcurator-agent:latestwith idle-unload.Scribe issue #1682.