Dev Guide Cache Hit Rate

Nested lingtai-dev-guide reference for computing the recent prompt-cache hit rate from LingTai token ledgers over rolling windows (default 1h / 5h / 1d / 3d). Explains the provider-agnostic input/cached fields in logs/token_ledger.jsonl, the exact formula (sum(cached)/sum(input) per window), timestamp/timezone handling, the daemon double-count hazard, and ships a read-only stdlib script (scripts/cache_hit_rate.py) that aggregates an agent workdir, a project root, or a single ledger file. Use when asked how effective prompt caching has been recently, or to diagnose a cache-hit-rate drop after a refresh/affinity/cache-key change.

lingtai-ai c5841ec 2 files · 21.1 KB Updated

File contents

lingtai-ai/lingtai/tree/main/tui/internal/preset/skills/lingtai-dev-guide/reference/cache-hit-rate commit c5841ecc9a

Frequently asked questions

npx skillmds@latest add lingtai-ai/dev-guide-cache-hit-rate