LocalAI lets active chats keep running as it reads long prompts
LocalAI, an open-source tool for running artificial intelligence models on a user’s own server, changed how one of its processing components handles concurrent chats. It can now read a long input in chunks while other conversations continue to generate replies. When several requests can run at once, the component shares working memory across them by default.
Artificial Intelligence··Midday
AI image
The server reads a long input in chunks
LocalAI, an open-source tool for running artificial intelligence models on a server an operator controls, changed how it handles long prompts in release 5.1. The developers document the change in the release notes for 5.1. The change concerns llama.cpp, the component that runs language models. It processes a long input in chunks so the server can keep generating replies for conversations that are already under way while reading the new request.[1]
Concurrent requests draw on a common cache
When the server is configured to handle more than one request at a time, the component now uses a shared cache by default. The cache stores intermediate values used during response generation. A request waits if the input and the space reserved for its reply would exceed the memory still available in that cache.[1]
Requests can reuse work already done on the same opening
In setups that allocate the cache in pages, the release can also reuse work across requests that begin with the same text. The shared opening has to cover at least 256 tokens, the units into which the model breaks up text. A new request can then start from intermediate values stored for another active request instead of processing that opening again.[1]