llama.cpp
09452cde - server: keep the server awake while a request uses its state (#32133)

Commit
1 day ago
server: keep the server awake while a request uses its state (#32133) With --sleep-idle-seconds, a handler passes wait_until_no_sleep() while the server is awake, then keeps using the server state, for example to parse the body and tokenize. If the idle timer expires in that window, the main loop enters sleep and the callbacks destroy the model: the handler reads freed vocab memory, and a task posted after that stays in the queue with nobody awake to process it. Count the requests that passed wait_until_no_sleep() and are not done yet, and do not enter sleep while the count is positive. The response generator releases its count in its destructor, so every return path of a handler gives it back. Co-authored-by: Venkata Vineel <vyalamar@users.noreply.github.com>
Parents
Loading