有没有考虑使用gptcache? #379

Closed
opened 2026-02-21 17:26:59 -05:00 by yindo · 3 comments
Owner

Originally created by @997172286 on GitHub (Aug 14, 2023).

Originally assigned to: @takatost on GitHub.

您好,我注意到这个项目使用了OpenAI的API进行文本生成。为了优化使用成本和响应延迟,我想询问一下您是否考虑过使用 GPTCache(https://github.com/zilliztech/GPTCache)。
GPTCache是一个开源的、用于OpenAI API的缓存代理,它可以通过本地缓存已生成的文本,从而大幅降低成本和提高响应速度。
主要优势有:

  • 通过文本缓存降低10-100倍的使用成本
  • 将响应时间从500ms降低到<50ms
  • 作为反向缓存代理很容易设置
  • 支持OpenAI和其他如Anthropic、Cohere等LLM
    我认为GPTCache可以大幅提升文本生成的规模和速度,同时优化成本。如果您对此有任何疑虑或者需要集成方面的帮助,欢迎随时提出。如果决定使用GPTCache,我也很乐意为项目做出贡献!
    感谢您的时间,期待您的回复。谢谢!
Originally created by @997172286 on GitHub (Aug 14, 2023). Originally assigned to: @takatost on GitHub. 您好,我注意到这个项目使用了OpenAI的API进行文本生成。为了优化使用成本和响应延迟,我想询问一下您是否考虑过使用 GPTCache(https://github.com/zilliztech/GPTCache)。 GPTCache是一个开源的、用于OpenAI API的缓存代理,它可以通过本地缓存已生成的文本,从而大幅降低成本和提高响应速度。 主要优势有: - 通过文本缓存降低10-100倍的使用成本 - 将响应时间从500ms降低到<50ms - 作为反向缓存代理很容易设置 - 支持OpenAI和其他如Anthropic、Cohere等LLM 我认为GPTCache可以大幅提升文本生成的规模和速度,同时优化成本。如果您对此有任何疑虑或者需要集成方面的帮助,欢迎随时提出。如果决定使用GPTCache,我也很乐意为项目做出贡献! 感谢您的时间,期待您的回复。谢谢!
yindo closed this issue 2026-02-21 17:26:59 -05:00
Author
Owner

@takatost commented on GitHub (Aug 15, 2023):

GPTCache, we have been aware of it for a while now. On one hand, our recent architecture has been undergoing frequent changes, and on the other hand, most of our users are still in the trial and error phase and haven't reached the stage where cost-saving is a pressing priority. So, the priority for implementing GPTCache is relatively low. We developing based on langchain, and I understand that using GPTCache is not difficult.

@takatost commented on GitHub (Aug 15, 2023): GPTCache, we have been aware of it for a while now. On one hand, our recent architecture has been undergoing frequent changes, and on the other hand, most of our users are still in the trial and error phase and haven't reached the stage where cost-saving is a pressing priority. So, the priority for implementing GPTCache is relatively low. We developing based on langchain, and I understand that using GPTCache is not difficult.
Author
Owner

@997172286 commented on GitHub (Aug 15, 2023):

I understand your concerns about prioritizing GPTcache integration. However, I believe there are some flaws in your current Q&A approach that GPTcache could help resolve.
The main issue is that your vector search in Weaviate often retrieves irrelevant questions, resulting in unnecessary calls to OpenAI. This wastes resources. With better similarity matching, you could avoid OpenAI requests when there is already a good question match in your dataset. This is where GPTcache comes in.
By caching responses for common questions, GPTcache reduces expensive OpenAI usage. When a cached response exists, you don't need to call OpenAI at all. This improves efficiency and consistency for standardized questions. The vector search just needs to be accurate enough to find relevant cache hits.
Overall, I think integrating GPTcache should be a priority. It offers a lightweight solution that works alongside your existing infrastructure to cut costs and improve response quality. Getting the most out of your dataset is key before resorting to OpenAI. I'm happy to discuss this further to illustrate the benefits. Let me know if you have any other questions!

@997172286 commented on GitHub (Aug 15, 2023): I understand your concerns about prioritizing GPTcache integration. However, I believe there are some flaws in your current Q&A approach that GPTcache could help resolve. The main issue is that your vector search in Weaviate often retrieves irrelevant questions, resulting in unnecessary calls to OpenAI. This wastes resources. With better similarity matching, you could avoid OpenAI requests when there is already a good question match in your dataset. This is where GPTcache comes in. By caching responses for common questions, GPTcache reduces expensive OpenAI usage. When a cached response exists, you don't need to call OpenAI at all. This improves efficiency and consistency for standardized questions. The vector search just needs to be accurate enough to find relevant cache hits. Overall, I think integrating GPTcache should be a priority. It offers a lightweight solution that works alongside your existing infrastructure to cut costs and improve response quality. Getting the most out of your dataset is key before resorting to OpenAI. I'm happy to discuss this further to illustrate the benefits. Let me know if you have any other questions!
Author
Owner

@takatost commented on GitHub (Aug 16, 2023):

I understand your intention. In addition to the mentioned issues, the upcoming features of Ops, such as the "Add improvement" and "likes" in log page of app that you see now, will be implemented similarly to GPTCache. Perhaps we will combine it with GPTCache, or maybe we will need to implement our own custom business logic.

@takatost commented on GitHub (Aug 16, 2023): I understand your intention. In addition to the mentioned issues, the upcoming features of Ops, such as the "Add improvement" and "likes" in log page of app that you see now, will be implemented similarly to GPTCache. Perhaps we will combine it with GPTCache, or maybe we will need to implement our own custom business logic.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#379