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

Re-implement token caching for Vercel AI SDK usage #60

Merged
merged 9 commits into from
Mar 4, 2025

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 3, 2025

This PR implements token caching for the Vercel AI SDK with Anthropic provider. It adds the appropriate providerOptions.anthropic.cacheControl: 'ephemeral' property to the last two messages in the conversation, which allows the conversation up to that point to be cached (with a ~5 minute window), reducing token consumption during repeated API calls.\n\nFixes #58

@bhouston bhouston force-pushed the feature/issue-58-token-caching branch from 15ac90d to 870cbee Compare March 3, 2025 21:18
@bhouston bhouston merged commit 73604de into main Mar 4, 2025
1 check failed
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

Successfully merging this pull request may close these issues.

1 participant