团队如何防止重复的 LLM API 调用和代币浪费?

2作者: cachelogic6 个月前
我很好奇,那些运行大量使用 LLM 的应用程序的团队,在生产环境中是如何处理重复或冗余的 API 调用的? 在试验 LLM API 时,我注意到同一个提示词有时会在应用程序的不同部分被重复发送,这导致了不必要的 token 使用和更高的 API 成本。 对于在生产环境中使用 OpenAI、Anthropic 或类似 API 的团队: 你们目前是如何检测或防止重复提示词或冗余调用的? 你们是依赖日志记录和仪表盘、缓存层、内部代理服务,还是其他方式? 或者这通常被认为是一个小问题,大多数团队只是将其视为正常使用的一部分?
查看原文
I&#x27;m curious how teams running LLM-heavy applications handle duplicate or redundant API calls in production.<p>While experimenting with LLM APIs, I noticed that the same prompt can sometimes be sent repeatedly across different parts of an application, which leads to unnecessary token usage and higher API costs.<p>For teams using OpenAI, Anthropic, or similar APIs in production: How do you currently detect or prevent duplicate prompts or redundant calls? Do you rely on logging and dashboards, caching layers, internal proxy services, or something else? Or is this generally considered a minor issue that most teams just accept as part of normal usage?