๐ค Assistant
You were right! Let me give you the corrected numbers now.
The calculate_cost() function in proxy.py has the key comment:
python
# NOTE: input_tokens from OpenAI includes cached tokens.
non_cached_input = max(it - ct, 0)
So input_tokens already includes cached_tokens. The real split is:
|
Measure |
Tokens |
Share |
|
Fresh input |
45,126,885 |
12.8% |
|
Cached input |
303,218,915 |
86.1% |
|
Output |
3,828,177 |
1.1% |
|
Grand total |
352,173,977 |
โ |
Effective cache hit rate: 87.0% (cached รท total input)
|
Day |
Fresh In |
Cached |
Cache % |
|
Jun 20 |
5.6M |
82.4M |
93.1% |
|
Jun 21 |
2.8M |
45.3M |
93.7% |
|
Jun 27 |
0.4M |
8.6M |
94.2% |
|
Jun 4 |
1.1M |
15.7M |
91.2% |
On heavy agent work days, I'm hitting 93-94% cache hit rate. The system prompt, skill files, tool documentation โ they all get cached after the first read and then reuse that cache on every subsequent call.
|
Model |
Hit Rate |
Notes |
|
deepseek-v4-pro-china |
96.5% |
Cheap CN platform, highest reuse |
|
kimi-k2p7-code |
91.1% |
Code analysis โ lots of repeated context |
|
gpuserver (local agent) |
87.0% |
Your self-modifying agent |
|
deepseek-v4-pro (smart) |
82.8% |
Complex reasoning, varied prompts |
|
deepseek-v4-flash (fast) |
78.7% |
Most varied ad-hoc queries |
|
Model |
Cached |
Saved |
|
deepseek-v4-pro-china |
132.4M |
$57.12 (96% hit, 98.7% discount on cache) |
|
deepseek-v4-pro |
11.7M |
$18.64 (83% hit, 92% discount) |
|
deepseek-v4-flash |
108.1M |
$11.89 (79% hit, 79% discount) |
|
kimi-k2p7-code |
4.7M |
$3.56 |
|
Others |
1.1M |
$0.72 |
|
Total |
303.2M |
$91.94 saved |
Actual cost: $20.07. Without caching: $112.00.
91:1 โ for every 1 token I write, I read 91. Still insane, but not the 170:1 I initially (double-countingly) claimed.
So the reports on the dashboard are accurate โ ~87% of input tokens are cached. The self-modifying agent pattern means:
The fact that the local model (gpuserver) also hits 87% cache is the real story โ llama.cpp's KV-cache on that RTX 5060 Ti is doing yeoman's work reusing contexts across agent turns. You're getting $112 worth of API calls for $20 cash plus $0.21 in electricity. ๐ฏ