This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Stateless design of the OAI v1 chat endpoints does not play very well with the way llama.cpp works. The current context cache is a nice workaround to make the default case of turn-by-turn chat fast, but a better solution would be to offer a way to address chat sessions explicitly, and add the concept of a (stateful, persistable) thread.
Technically it would be possible to improve the context cache for stateless requests as well (ie, remember the last N states, allow for reuse of context even on larger message-array-differences and editing of messages without having to reingest everything). I'm afraid though that this would add a lot of complexity while still being sub optimal in some cases. Thats why I dont plan to prioritize the stateless chat context cache for now. If we were to add complexity it seems more valuable to put it into adding thread state and into a "native" HTTP API that exposes functionality in a way that is closer modelled after how the internals work, and focus on keeping that as simple and transparent as possible while exposing as much functionality as we can.
What I had in mind for such an API:
/threads?) and stateless (/tasks/chat?) chat endpoints (Some drafts)Everything up for debate. I have no time to work on this yet, but I thought I should post early on the rough direction I'd like it to go.
Contributions welcome :)
Beta Was this translation helpful? Give feedback.
All reactions