PulseAugur
中
实时 01:37:57
English(EN) cached_tokens is 0 because your system prompt isn't stable

开发者通过稳定系统提示解决了 LLM 缓存问题

一位开发者发现他们的 LLM 应用未能有效利用缓存,导致成本增加。最初怀疑是 Fireworks 的无服务器 API 存在会话亲和性问题,但他们发现缓存是自动的,但依赖于完全相同的提示前缀。问题源于一个动态的系统提示,其中包含不稳定的工作区引导和依赖于查询的记忆回忆。通过重构系统提示使其稳定,并将动态内容移至消息数组,开发者显著提高了缓存命中率并降低了成本,认识到依赖于查询的信息不应成为可缓存前缀的一部分。 AI

影响 强调了稳定的系统提示对于有效的 LLM 缓存和成本优化的重要性。

排序理由 开发者讨论了与 LLM API 使用相关的技术问题及其解决方案。

在 dev.to — LLM tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 2 个来源。 我们如何撰写摘要 →

开发者通过稳定系统提示解决了 LLM 缓存问题

本文如何被排名

Signal score
0 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
开发者讨论了与 LLM API 使用相关的技术问题及其解决方案。
Source corroboration
2 independent sources
Multiple independent publishers reporting the same story raises confidence that it's real and newsworthy.
Topics
infra, product
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
56 days old
Aged out of breaking-news scoring windows; ranking reflects the durable signal from the full source set.

完整方法见我们的编辑标准。

报道来源 [2]

  1. dev.to — LLM tag TIER_1 English(EN) · Chad Priest ·

    cached_tokens 为 0 是因为您的系统提示不稳定

    <p>I added a <code>[cache]</code> log line next to our usage tracker and read <code>usage.prompt_tokens_details.cached_tokens</code> off a warm conversation. It said <code>0</code>. Then <code>1</code>. Out of roughly 16,000 prompt tokens, every single turn. We were paying full p…

  2. dev.to — LLM tag TIER_1 English(EN) · Chad Priest ·

    cached_tokens 为 0 是因为您的系统提示不稳定

    <p>I added a <code>[cache]</code> log line next to our usage tracker and read <code>usage.prompt_tokens_details.cached_tokens</code> off a warm conversation. It said <code>0</code>. Then <code>1</code>. Out of roughly 16,000 prompt tokens, every single turn. We were paying full p…