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

Any plans to add prompt caching for Anthropic? #365

Open
tavurth opened this issue Aug 25, 2024 · 2 comments
Open

Any plans to add prompt caching for Anthropic? #365

tavurth opened this issue Aug 25, 2024 · 2 comments

Comments

@tavurth
Copy link

tavurth commented Aug 25, 2024

Why?

When you send a request with Prompt Caching enabled:

The system checks if the prompt prefix is already cached from a recent query.
If found, it uses the cached version, reducing processing time and costs.
Otherwise, it processes the full prompt and caches the prefix for future use.

  • Cache write tokens are 25% more expensive than base input tokens
  • Cache read tokens are 90% cheaper than base input tokens
  • Regular input and output tokens are priced at standard rates

This is especially useful for:

  • Prompts with many examples
  • Large amounts of context or background information
  • Repetitive tasks with consistent instructions
  • Long multi-turn conversations

Seems like it can be super useful for large codebases where only a small section needs to be updated each time. Can basically send it all over and it'll be cached each time.

https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#how-prompt-caching-works

@CestDiego
Copy link

this would be perfect for having a similar feature to projects from Anthropic as well

@karthink
Copy link
Owner

karthink commented Sep 3, 2024

Yup, will add it soon.

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

3 participants