Why some harnesses get 99% cache hits on deepseek and others get 1.5%

ds v4.1 flash bills a cache hit at $0.003 per million vs $0.15 for a miss off peak, so 1/50 of the price. kimi K3 is 1/10 and GLM5.3 flash or Qwen 3.8 27b on alibaba are more like 1/4 to 1/5, so on deepseek the hit rate decides the input bill way more than on the others. going from 80% hits to 99% cuts effective input about 7x the hit rate mostly depends on the harness tho. composio ran ds v4 flash thru 8 harnesses on the same 30 tasks back in august and claude code got about 1.5% cache hits vs about 70% on codex, $0.195 per successful task vs $0.081. pi came out at $0.028 per success and someone reported 99.93% hits on it, and dsh users here keep reporting 99%+ too. reasonix publishes how they do it, system prompt and tool specs frozen at session start and history append only, and their readme puts generic openai style clients at around 30-60% on long sessions what usually breaks it is timestamps or ids in the system prompt, tools registered in a different order or mcp tools coming and going, compaction rewriting old turns, switching models, and getting moved to another backend mid session. parallel subagents can hurt too, going by deepseeks docs a prefix only becomes a cache unit once a request completes so 10 agents fired at once on a fresh prefix probably all miss. sending one request first to warm it should help to check yours, deepseek direct reports prompt_cache_hit_tokens and prompt_cache_miss_tokens in usage and openai style endpoints like z.ai or deepinfra put it in usage.prompt_tokens_details.cached_tokens. the cache is best effort per deepseeks docs and ppl here have reported anything from it lasting 8h to dropping from 99 to 88% overnight with nothing changed, so log it for a few days before blaming your setup

参与讨论