返回首页

AWS 公布 Bedrock 上 OpenAI 模型的提示缓存模式:六轮负载输入成本降约 62%

  • 核心机制:Agent 每轮都会重发工具定义、指令、历史与新消息;Bedrock 提示缓存保存已处理的提示前缀,后续请求从缓存读取,只处理新增内容。支持隐式缓存、显式 prompt_cache_breakpoint,也可组合使用。
  • 接入细节:缓存前缀至少 1,024 token,TTL 至少 30 分钟;使用 prompt_cache_key 在会话间复用共享前缀;新增工具可用 additional_tools 追加而不改初始工具目录;子 Agent 可先预热共享前缀再并行发起。
  • 成本数据:在 GPT-6 Astra 的六轮工作负载中,隐式缓存使输入成本较无缓存降低约 62%,显式滚动断点约降低 61%;另一示例中滚动断点把单会话建模输入成本从 0.87 美元降至 0.32 美元。缓存写入按正常输入价的 1.25 倍计费。
  • 行业观察:Agent 的上下文重复是输入成本的主要来源之一;隐式与显式缓存分别对应增长中的会话历史与跨会话共享的工具/指令前缀,组合使用比单一模式更贴近实际 Agent 工作流。 🔗 AWS Machine Learning Blog
Five growing agent requests, with tools, instructions, and earlier history marked in red and each new turn in yellow.Turn 1 writes the tools and instructions through a breakpoint. Turn 2 reads that same prefix from cache and processes its new question.Rolling breakpoints, where each turn reads all earlier turns and writes only its own tool result.Bar chart comparing the input cost of each caching setup on GPT-6 Astra, relative to no caching.Native additional_tools loading preserves the earlier cached prefix. The GPT-6 Astra Runtime test reads 2,068 tokens and writes a 145-token extension. Editing the initial catalog causes a cache miss.Support and billing sessions each reuse the cache for their fixed tool profile.