[FEATURE_REQUEST] Reduce chat-file duplication with compact single-swipe storage (improves load speed on larger chats)

Author: dariusmccloudCreated Sep 28, 2026Updated Sep 28, 2026
Labels🦄 Feature Request

Have you searched for similar requests?

Yes

Is your feature request related to a problem? If so, please describe.

Assistant messages with only one swipe stores the same response twice in chat file JSONL: once in mes and again in swipes[0]. In long chats, this adds redundant data to chat files and backups and significantly increases latency.

I’d like to reduce that duplication while preserving message content, swipe metadata, and normal chat behavior.

Describe the solution you'd like

0001-Optimize-compact-chat-storage.patch

Support a versioned compact storage format for assistant messages where the only swipe exactly matches mes.

The attached prototype patch:

Omits the redundant swipe text when saving. Restores it when loading the chat. Preserves multiple swipes and swipe metadata. Expands compact data into conventional JSONL on export.

This is a storage optimization patch only; no changes are made to the file to what is sent to the model.

Describe alternatives you've considered

  • Keeping the existing format preserves compatibility but retains the duplicate text.
  • Compressing backups would reduce backup size without addressing duplication in active chat files.
  • This fix only applies to SillyTavern (and potentially forks) while leaving the files compatible for other front ends,

Additional context

The patch includes focused tests for compaction, restoration, and export. It also includes save-request coalescing and chat-load diagnostics; those could be considered separately from the storage-format proposal.

Please treat this as a prototype for discussion. Compatibility with existing chat readers and extensions, and measurable performance benefits, would need validation before adoption.

0001-Optimize-compact-chat-storage.patch

Priority

Medium (Would be very useful)

Are you willing to test this on staging/unstable branch if this is implemented?

Yes