Skip to content

DeepSeek prefix cache hit rate drop - CC Switch fix

Quick fix

Upgrade to cc-switch v3.16.3 to fix cache hit rate calculation errors caused by format conversion.

Error output
缓存命中率在低于 50%
English translation

Cache hit rate drops to below 50%

When using vendors like OpenCode Go, the CC Switch format conversion path (e.g., OpenAI→Anthropic) has a bug that causes cached tokens to be counted repeatedly in statistics, resulting in a significantly lower displayed cache hit rate (dropping from normal 90%+ to below 50%). This is a statistical false positive, not actual request failure.

Additionally, some users reported that when routing through CC Switch, request transformations such as Anthropic System Message Normalization and JSON Payload Canonicalization changed the request prefixes sent to DeepSeek, causing DeepSeek's automatic cache based on exact prefix matching to fail, actually decreasing hit rates. However, for this specific severe deviation issue of "hit rate displaying below 50%", it was confirmed as a statistical bug and fixed in v3.16.3.

  1. Update cc-switch to the latest version (at least v3.16.3), which has fixed the issue of duplicate counting of cached tokens.

ToolClaude Code
Version3.16.2
PlatformsmacOSWindows
Did the hit rate normalize after updating to v3.16.3?
Yes, according to feedback in issue #4243, the DeepSeek v4pro cache hit rate for OpenCode Go has returned to normal levels after updating to v3.16.3.
Why was the hit rate previously below 50%?
This was because cached tokens were counted repeatedly in the statistics on the format conversion path, halving the hit rate data. This is not an issue with the model service itself, but an internal statistical logic error in cc-switch.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.