• Stefy Lanza (nextime / spora )'s avatar
    resolve (and load) the chat model off the event loop (v0.4.52) · 68af3450
    Stefy Lanza (nextime / spora ) authored
    The v0.4.51 stack dump named the OCR pod freeze. chat_completions called
    multi_model_manager.get_model_for_request() on the loop. For a model not
    loaded yet that goes _load_default_model -> load_model ->
    vllm_worker.ensure_service(), which waits for vLLM in a time.sleep(2) loop.
    On a pod it froze the whole process for 324 s at boot, /healthz included,
    and for minutes whenever it decided to (re)start vLLM, so the orchestrator
    took busy pods for dead ones.
    
    chat_completions and completions now resolve the model in a thread. The
    manager's load lock already prevents duplicate loads. The no-blocking-calls
    AST guard now also forbids get_model_for_request, _load_default_model and
    ensure_service in a coroutine; it fails on the old code and passes on the new.
    Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01KnfkxBpcZ1v6ypRFFyhrVM
    68af3450
text.py 166 KB