-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add prompt caching support for AWS Bedrock #3438
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
base: main
Are you sure you want to change the base?
Add prompt caching support for AWS Bedrock #3438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DouweM It's mostly the duplication of the same documentation we have for Anthropic CachePoint. What do you think, maybe we need to move it somewhere?
5263d8a to
6612939
Compare
|
@DenysMoskalenko Thanks for working on this Denys!
Agreed. Can you please have a look at these issues and address them in case they affect this implementation as well?
|
|
Sure:
|
- Emit cache-point tool entries so Bedrock accepts cached tool definitions - Document and test prompt caching (writes + reads) with cassette-body checks - Refresh Bedrock cassettes and type annotations to align with the new flow
783607c to
900d542
Compare
|
@DouweM The limitation is: |
@DenysMoskalenko If the number 4 changes or becomes model-specific we can add it to the model profile. But I do think we should take care of staying under the limit, because it's not so easy for the user to do so themself if there are In this case, "implicit magic" is a bit intentional, because as I wrote on #3453, the goal is for this to be useful to people who don't want to become experts on prompt caching and the limitations Anthropic enforces, not the more advanced users and use cases that need fine-grained control. In any case, the
Usually with model settings, we silently ignore them if they're not supported (that's why most of them say "Supported by: ..." in the docstring), so I might prefer to say "Supported by: Anthropic on Bedrock", and then silently ignore it for Nova. I agree raising errors when the user does something unsupported is usually good, but with model settings we typically do a "best effort" so that as many requests as possible succeed. |
Summary
Implements AWS Bedrock prompt caching support (see #3418) by fixing how cache points are sent, documenting the workflow, and extending test coverage to assert cache writes and reads.
Testing