Per-Model Bring Up / Tear Down Hooks #724
dinerburger
started this conversation in
Ideas
Replies: 1 comment 4 replies
|
Any news on this topic? I think it would be awesome to have the possibility to save KV cache between swaps. 👍 |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Llama.cpp's llama-server allows users to save, and then restore, slot data at run-time. We can use this feature to persist the KV cache state on teardown, and then seamlessly reload it on bringup, allowing KV cache state to be persisted while another model (think RAG stack) does some work, and then recover for processing my the "master" LLM on the way back in.
I'm proposing allowing lifecycle hooks per-model, similar to that of the application lifecycle hooks. Right now the only lifecycle hook exposed at the application level is
on_startup, but I'm proposing models have a broader spread. Probably:[
on_will_start(before application invocation),on_startup(after health check is passed),on_will_stop(before the termination is sent),on_stopped(after application is verified as being stopped)]. The content is up for debate; I could see something like:or arbitrary commands:
But I'm open for debate on all this. Thanks for making this killer tool!!
All reactions