mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3891] [Engine] Automatic disk-backed conversation cache with size cap and auto-eviction, for subagent workloads on low-RAM machines #1663
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1663
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @phly95 on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3891
Area
[Engine]
What do you want to do?
Keep conversations alive across turns when several of them alternate on a server that handles one request at a time, without the client calling any API and without the box having RAM to spare for parked snapshots. In short: an opt-in, automatic disk tier under the conversation cache that is configured in the run config and manages itself.
Who needs it: people running agent clients with subagents (e.g. Claude Code with 4 subagents sharing one server) on machines with limited RAM, where one concurrent request is all the memory allows.
Requested behavior
/slots/0?action=save|restorecalls from the client.Why: what the docs say happens today
Reading
docs/DETAILS.mdanddocs/BATCHING.md(0.2.3.1):"parallel": NStrata serves one request at a time; others wait in the queue.The existing options each need something these machines lack:
--conversation-cache-mibparks in RAM only. The docs themselves describe stalls from paging when the budget is large (#2049)."parallel": Nneeds VRAM per slot and a 262144 context is already tight.--slot-save-path,POST /slots/0?action=save|restore) work, but only through explicit calls: single slot 0, no erase action (the caller manages the files), they run between requests while the queue is held, and they return 501 with parallel requests. A client such as Claude Code will never call them, so they cannot help here without a wrapper in front of the server.For scale, the docs measure a 63,025-token conversation on a 12 GB card with NVMe: a 1.20 GB file, save 0.65 s, restore 1.05 s, against 25.5 s for the cold first turn. Single runs, different hardware and model than mine, but it shows why a disk tier is attractive when RAM is short.
My setup
Linux, AMD/HIP (container), about 62 GiB RAM with about 8 GiB available while the model runs, container capped at 57 GiB; Qwen3.8-Flash-Next IQ3_S,
--max-context 262144 --kv int8, noparallel, no conversation-cache budget. Clients: Claude Code and similar agents with several subagents.Related
What do you do today instead?
Nothing automatic. The options are accepting the re-reads, running fewer concurrent subagents, or putting a client-side wrapper in front of Strata that drives the slot API, which means identifying conversations from the outside and blocking the queue while it saves and restores.
@heitor-lassarote commented on GitHub (Oct 26, 2026):
I second this. My setup has 32 GB RAM and a feature like this would help us who have less RAM.
@lyrakat commented on GitHub (Oct 31, 2026):
I'd find this useful too. I run an agent on a single 16 GB GPU with 64 GB of RAM. With the model loaded and a long context, most of the RAM is already in use, so parking a conversation is usually skipped. When a short side request comes in between turns, such as a title or a summary, the next turn reads the whole conversation again. At around 200K tokens that takes about three minutes.
An automatic disk tier like this would help me and others whose RAM fills up the same way. Thanks for considering it.
@steve8697 commented on GitHub (Nov 4, 2026):
A data point from a Windows desktop install, and a request to consider the oMLX placement model rather than only whole-conversation files.
Setup: one RTX 5090, about 94 GB of RAM, engine 0.1.56, one request at a time. The NVFP4 expert arena stays pinned at about 63 GB, so the conversation cache holds roughly two long snapshots. An agent alternates a main chat of about 170k–220k tokens with a second chat that edits its skills. When another snapshot does not fit, the oldest parked conversation is dropped, and coming back re-reads tens of thousands of tokens, about 10–30 seconds of prefill.
--slot-save-pathis already enabled, but the client never calls save or restore. A process outside the engine also cannot save the evicted snapshot: that copy has already been freed when the eviction line is logged, and a restore has to happen before the next prefill.The behavior described in this issue is the missing piece: on a switch, write the outgoing conversation to a bounded SSD directory and read it back when that conversation returns, with no client API call.
oMLX (https://github.com/jundot/omlx) is a finer version of the same idea on Apple Silicon. KV is stored in blocks. Hot blocks stay in RAM. When RAM is full, blocks spill to SSD instead of being discarded, and a later request restores the matching prefix from disk, including after a restart. Copy-on-write keeps a shared prefix once until the conversations diverge. That last part matters for the skill-edit case. A single session file of the whole conversation stops matching when the edit changes the start of the prompt, so the tail is prefilled again. Block reuse can keep the parts that did not change.
Would you try that model for this disk tier, not only a whole-snapshot spill along the lines of the closed #1480 and the open #1937? I can retest on this machine if an opt-in flag reaches a Windows CUDA build.
@shoucandanghehe commented on GitHub (Nov 5, 2026):
I have a local engine-side disk-cache implementation, but #3341, #4226 and #5211 already cover automatic persistence, so I do not want to open another competing disk-tier PR.
There are three separable capabilities I could contribute to the selected design:
Which of these are in scope, and which existing branch should they target? I would keep them independently reviewable instead of bundling them into #1962's RAM-sharing PR. These are descriptions of inspected local code, not current-main runtime results; no new performance, durability or backend-compatibility claim is being made.