AWS Machine Learning Blog· Dustin Liu·· 2 hr agoAI score38
Use prompt caching with open-weight models on Amazon Bedrock
Use prompt caching with open-weight models on Amazon Bedrock
AI summary
Amazon Bedrock now supports explicit prompt caching for open-weight models, alongside automatic implicit caching, letting applications reuse a matching prompt prefix across requests to reduce input costs and latency. The post explains both modes through the Chat Completions API, shows how to read cache usage fields from each response, and applies implicit caching to an OpenCode coding agent session. It closes with best practices such as placing static content first, meeting the model's minimum prefix length, and tracking cache reads and writes.
Source: AWS Machine Learning Blog · aws.amazon.com