You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are accumulated across all iterations of the most recent run. Zero values mean the provider didn't return cache metrics (either caching is not enabled, or the provider doesn't report them).
72
72
73
+
### UI Display
74
+
75
+
Cache stats appear automatically in both the **terminal** and **Web UI** — no extra flags needed:
76
+
77
+
**Terminal** — gray summary line after each final answer:
78
+
```
79
+
── 5,432 in · 890 out · 320 stored · 2,100 read
80
+
```
81
+
82
+
Only non-zero metrics are shown. Labels:
83
+
-`stored` — tokens written to populate the cache (Anthropic, first request)
84
+
-`read` — tokens served from cache hit (Anthropic, subsequent requests)
85
+
-`cached` — tokens matched by automatic prefix caching (OpenAI/DeepSeek)
86
+
87
+
**Web UI** — per-message stats at the bottom of each assistant bubble:
88
+
```
89
+
⚡ 2.4s · 5.4k in · 890 out · 320 stored · 2.1k read
90
+
```
91
+
92
+
And session-level totals in the top bar:
93
+
```
94
+
∑ 8.2k in · 1.8k out · 3.4k read · 650 stored
95
+
```
96
+
97
+
Hover over any stat for a tooltip explanation.
98
+
73
99
## How It Works
74
100
75
101
1.**Before each LLM call**, if `PromptCaching` is enabled, the loop calls `llm.ApplyCacheMarkers(messages)` which:
0 commit comments