Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Anthropic Cache Control for choose AI rule #300

Open
elie222 opened this issue Jan 9, 2025 · 0 comments
Open

Use Anthropic Cache Control for choose AI rule #300

elie222 opened this issue Jan 9, 2025 · 0 comments

Comments

@elie222
Copy link
Owner

elie222 commented Jan 9, 2025

It's a lot cheaper to use cache control, but the npm libs we use don't fully support it yet:

  1. Caching tools isn't supported: Support Anthropic prompt caching for tool definitions vercel/ai#3820
  2. Cached token usage isn't returned: Anthropic Cache Control not returning cached token usage vercel/ai#4335
  3. Bedrock SDK doesn't yet support it: Support prompt caching in bedrock API (@anthropic-ai/bedrock-sdk) anthropics/anthropic-sdk-typescript#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant