Use Anthropic Cache Control for choose AI rule
Author: elie222Created Jan 9, 2025Updated Jun 21, 2026
It's a lot cheaper to use cache control, but the npm libs we use don't fully support it yet:
- Caching tools isn't supported: https://github.com/vercel/ai/issues/3820
- Cached token usage isn't returned: https://github.com/vercel/ai/issues/4335
- Bedrock SDK doesn't yet support it: https://github.com/anthropics/anthropic-sdk-typescript/issues/507
We'd probably need to implement it manually if we want this to work right now: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
Or make PRs to the above libraries.
We'd only use it on one ai call (Choose rule), although we use it use a lot, so it can lead to large cost savings.
Here's the WIP PR: https://github.com/elie222/inbox-zero/tree/anthropic-cache-control
Source: elie222/inbox-zero