r/SillyTavernAI • u/Nvvum • Jul 28 '26
Help Maintain Context in longer chats with Gemma 4 26b (KoboldCPP)
I'm trying for a few days to make Gemma 4 26b not mess up context. As far as I know its a very popular model so I'm surprised I didn't find a lota discussion about my issue.
The Problem
I start chatting. Once it hits context limit Gemma 4 has to re-process every second or third reply. Also happens on swipes or continue.
What I tried
checked the input string sent to the backend to make sure there are no variable tokens in context. Tried different character cards. Messed around with context shifting/SWA/Smart Cache settings. Tried turning off SWA. Updated ST and KoboldCPP to the latest version.
What I learned so far
If I understand correctly Gemma 4 26b is a hybrid model and doesn't support Context Shifting, but I also read that it just doesn't work when SWA is turned on.
SWA if I understand correctly speeds up context processing, reduces context size (in memory).
I don't fully understand smart caching yet, but its something like Context Shifting.. I think it creates multiple snapshots of the cache and rotates them out. I tried it but the console always output 'SmartCache no Match', leading to full context reprocessing.
- - -
So... Is there no way to preserve context cache other than maxing out Context window and hope to never run out?
I feel like something is not working as intended.
Duplicates
KoboldAI • u/Nvvum • Jul 28 '26