DeepSeek-V4-Flash Tip: Mid-conversation System Messages Break Prompt Cache

CharlesStross · reddit · 2026-08-02

Developer Charles Stross shared an important PSA for DeepSeek-V4-Flash users: inserting system role messages mid-conversation will break your prefix cache, degrading performance and increasing costs.

The Cause: DeepSeek's official chat template format lacks a mid-conversation system turn. Forcing a system message in the middle or at the tail of a conversation disrupts the context structure, effectively frying the prefix cache.

The Solution: Users should utilize the latestreminder role instead of system for mid-conversation instructions. This is the role DeepSeek trained for this purpose, and it passes through inference engines like llama.cpp without issue, maintaining cache hit rates.

Original post →

More from Models

Models channel →