Repository navigation
[Engine] conversation cache budget: count every part of a split GGUF - #7579
Open
Cinderella-Man wants to merge 1 commit into
Open
Cinderella-Man wants to merge 1 commit into
Cinderella-Man wants to merge 1 commit into
Conversation
…GGUF `--native` names the first part of a split GGUF (`...-00001-of-00006.gguf`), which is often only the metadata, so the budget took a few MB off the free RAM instead of the model: a 158 GB UD-Q5_K_XL in six parts on a 121 GiB PC got `--conversation-cache-mib 30976` while the loaded model left about 13 GB free. Every part beside the named one is counted now (a missing part counts as nothing), so a split model that fills the RAM is left to the engine's own sizing, as the module intends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
The conversation cache budget from #7044 (
terminal/strata_control/conversation_cache_size.py) takes the model's sizeoff the free RAM, and reads that size from the file
--nativenames. For a split GGUF that is the first part, whichis often only the metadata. Unsloth's Qwen3.8-Flash-Next UD-Q5_K_XL is six parts: part 1 is 10.4 MiB of 150,954 MiB.
On a 121 GiB PC with three RTX 3090s (layer split, the experts in RAM) the budget was 40 % of (122,308 - 10 - 4,096 -
2,560) MiB, capped at a quarter of the RAM, so the server passed
--conversation-cache-mib 30976. The loaded modelleaves about 13 GB of RAM available on that PC, so a long agent session could park conversations until the engine's
2,560 MiB floor.
Now every part beside the named one is counted (
<stem>-NNNNN-of-MMMMM.gguf, the namingterminal/ref/load.pyalready uses; a missing part counts as nothing). The same start gets no flag, so the engine sizes the cache itself, as
the module says it should for "a model that fills the RAM". A single-file model is read as before.
Related discussion
#7044 (the budget this fixes). No scope question: a fix inside the existing rule, no default changed.
Approach
model_mib()matches the five-digit split name and sums the sizes of parts 1..N in the same folder. The rest of themodule is unchanged. Two tests in
terminal/tests/terminal/test_conversation_cache_size.py: the parts are summed(also when another part is named, and with a part missing), a name that only looks like a part is one file, and the
case above with the real part sizes (
Path.statpatched, no 150 GB of files), which now leaves the args alone.Validation
Passed:
python3 -m unittest tests/terminal/test_conversation_cache_size.py(interminal/, Python 3.14, Linux,3416d048b): 16 tests OK. The two new ones fail on8db8753d5(1.0 != 6.0;10.4 != 150953.9).python3 -m unittest serve/test_conversation_cache_budget.py: 8 tests OK.conversation_cache_size.pyisbyte-identical to main's), the module on the real files and RAM: before,
model 10 MiB, RAM total 124377 free 122308 MiB -> --conversation-cache-mib 30976; after,model 150954 MiB ... -> no flag.[strata] conversation cache: ...line, no
--conversation-cache-mibon the engine's command line, the engine's ownconversation cache sized from the free RAM: 3328 MiB for up to 4 parked conversations, and the server answered (short / code / long-prompt greedyrequests).
Failed:
None observed.
Not run:
python tools/check(pytest is not installed on the machine where I ran the tests; the two files were run withunittest). No CI run of this revision.pathlib; not run there.Limits
not keep in RAM).
🤖 Generated with Claude Code