AI Cloud Architect

Introducing explicit prompt caching with open-weight models on Amazon Bedrock

AWSHow-to by Dustin Liu, Aman Arora, Melanie Li and Saurabh TrikandeAWS Artificial Intelligence Blog

Many generative AI applications resend the same long context on every request. Prompt caching lets open-weight models on Amazon Bedrock reuse it to reduce input cost and latency. This post shows implicit and explicit caching through the Chat Completions API and applies caching to an OpenCode coding agent session.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Bedrock now supports explicit prompt caching for open-weight models via the Chat Completions API, alongside implicit caching, to reuse repeated context and cut input cost and latency.

Who it is for

Teams running open-weight models on Bedrock with long repeated prompts, system prompts or agent loops that want to reduce input cost.

Key points

  • Explicit mode needs prompt_cache_options with mode set to explicit and prompt_cache_breakpoint markers on content parts.
  • Cache reads are billed lower than standard input; cache writes can cost more on some models.
  • Minimum prefix length, breakpoint limits and TTL depend on the model; check the model card.

Timeline

  1. What it explainsIntroducing Kimi K3 on Amazon Bedrock · AWS · Announcement
  2. This postIntroducing explicit prompt caching with open-weight models on Amazon Bedrock

Go deeper