zilliztech / GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.
https://gptcache.readthedocs.io
MIT License
7.18k stars 502 forks source link

[Feature]: Add Redis as a CacheStorage #458

Closed pravingadakh closed 1 year ago

pravingadakh commented 1 year ago

Is your feature request related to a problem? Please describe.

Redis as Vector Store is already available, it will be good if it can be added as Cache Storage as well.

Describe the solution you'd like.

No response

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

SimFG commented 1 year ago

Thank for your attention. Redis is expected to be supported as a caching store next week. We also warmly welcome any contributions.

a9raag commented 1 year ago

Hi, @SimFG anyone already working on this? I don't mind contributing to this.

SimFG commented 1 year ago

Thank you for your support and attention. It was originally expected to release a new version next week, but because there are many PRs contributed and repaired problems recently, a temporary version was released. This is expected to be supported next week.

SimFG commented 1 year ago

@a9raag we welcome your contribution. And I have not yet commenced the development of this particular feature.

SimFG commented 1 year ago

Thank you very much for @a9raag's contribution. Currently, the dev branch already supports redis as a cache store. If you want a quick experience, you can try to install it through source code.

dmitrypol commented 1 year ago

does this require RediSearch module or can we use regular Redis?

SimFG commented 1 year ago

@dmitrypol yes, this requires. reference: https://github.com/redis/redis-om-python#-so-how-do-you-get-redisearch-and-redisjson image

akshaysaini11 commented 1 year ago

Hi Team, i have implement the redis with GPTcache. but code use below :

from gptcache.manager import manager_factory data_manager = manager_factory("redis,faiss", data_dir="./workspace", scalar_params={ "redis_host":"localhost", "redis_port":6379, "global_key_prefix":"gptcache", }, vector_params={"dimension": 128}, ) this code run but show error : cmd_name = str_if_bytes(command[0]) TypeError: 'NoneType' object is not subscriptable

please provided solution and guidance. kindly review. Thanks,

a9raag commented 1 year ago

@akshaysaini11 Can you check if you have redis json and search modules loaded for your redis? https://redis.io/resources/modules/ Or you can install redis-stack-server which comes pre-loaded with these modules.

akshaysaini11 commented 1 year ago

@akshaysaini11 Can you check if you have redis json and search modules loaded for your redis? https://redis.io/resources/modules/ Or you can install redis-stack-server which comes pre-loaded with these modules. Hi @a9raag , redis with gptcache use windows and linux. i am working for window but this suggestion for working in Linux, ubuntu. please provide suggestion for window. Thanks,