How to know if there is a cache hit before requesting? #572
Unanswered
mayalinetsky-kryon
asked this question in
Q&A
Replies: 1 comment 2 replies
-
There is no way, because you also need a component to determine whether two vectors are similar, at least a library like faiss. If you just want to see if it exists in the cache, you can use the encapsulated api method --get, https://github.com/zilliztech/GPTCache/blob/main/gptcache/adapter/api.py#L105 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After reading the documentation and understanding the behind-the-scenes I got a sense that we can know if there will be a cache hit if* we have all questions ordered chronologically, by using only the embedding function, the similarity evaluation and the post-process function.
Am I correct?
Does GPTCache have a built-in function that does this? If not, how do I know there was a cache hit after sending a request to the LLM?
*[I assume here that the cache is infinite, and no data is removed from it.]
Beta Was this translation helpful? Give feedback.
All reactions