• Stefy Lanza (nextime / spora )'s avatar
    an out-of-band engine is a model: card it, track it, and queue behind it · 124941a4
    Stefy Lanza (nextime / spora ) authored
    The lip-sync engines were outside the ledger entirely. A render is gigabytes on
    the card for minutes, in a process the manager did not start, so the next model
    to load read the card as emptier than it is, took what it found, and one of the
    two died. They are models.json rows now -- video_models, backend "lipsync",
    capabilities lip_sync -- configurable on the models page like anything else,
    and a run goes through acquire_stt_backend, the same door LongCat and the STT
    workers use. The footprint is sampled during the run (these are third-party
    scripts that report nothing about themselves) and kept as a high-water mark, so
    the next reservation is measured. The registration is dropped when the process
    exits: one-shot work that stayed in the ledger would claim VRAM nobody holds.
    
    The bigger half is a defect that was never about lip sync. acquire_stt_backend
    POPS the instance pool, and _is_key_busy looks only at that pool -- so every
    model registered through it reads as permanently idle. LongCat mid-generation,
    a CrisperWhisper transcription, a lip-sync render: eviction was not choosing to
    take the card from busy work, it could not see the work was there. LongCat's own
    source notes this and works around it inside its releaser; nothing else did.
    
    So multi_model_manager grows external_busy(key), and _is_key_busy consults it.
    The existing eviction logic then does the right thing with no further change:
    the first pass skips a busy model, the second waits for the active one. An
    in-flight render is something to queue behind, not a candidate -- cleanup()
    waits for the process and never terminates it, because a half-finished render
    is worth nothing and the request that triggered the eviction is not more
    important than the one already running.
    
    Also: the Civitai redirect fix moved the seam two tests patched, so they stopped
    intercepting and started reaching the real site -- which is why they failed on
    HTTP 404 rather than on the 401/403 pages they assert about. Every request now
    leaves through one function, which is the thing to patch.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZnLhydX9QqUcfBbqLu
    124941a4
test_lipsync_engines.py 27.3 KB