Skip to content

introduce cached tokens to usage #1133

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

Closed

Conversation

agoddijn-fern
Copy link

It's useful to understand whether (and how) we are leveraging prompt caching in different models.
So far I've looked at OpenAI, Anthropic, and Gemini

https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#how-prompt-caching-works
https://platform.openai.com/docs/guides/prompt-caching
https://ai.google.dev/gemini-api/docs/caching?lang=python

@alexmojaki
Copy link
Contributor

Thanks, this looks good, especially since you seem to have fixed how we measured input tokens in Anthropic. If you run pytest --inline-snapshot=fix that should update the tests so that they pass.

@agoddijn-fern
Copy link
Author

Note for this, a potential next step would be to implement some of the different caching strategies mentioned in

https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#optimizing-for-different-use-cases

I'm not sure what the most ergonomic way of doing this would be

@DouweM
Copy link
Contributor

DouweM commented Apr 30, 2025

This is being implemented in #1549!

@DouweM DouweM closed this Apr 30, 2025
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.

4 participants