From 75ab7ec7b871c8399a95d5bf528441f2856250dd Mon Sep 17 00:00:00 2001 From: SimFG Date: Fri, 26 Jul 2024 11:29:43 +0800 Subject: [PATCH 1/5] add the note for the gptcache api --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d2249717..c5f6f955 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Slash Your LLM API Costs by 10x 💰, Boost Speed by 100x ⚡ 📔 This project is undergoing swift development, and as such, the API may be subject to change at any time. For the most up-to-date information, please refer to the latest [documentation]( https://gptcache.readthedocs.io/en/latest/) and [release note](https://github.com/zilliztech/GPTCache/blob/main/docs/release_note.md). +**NOTE:** As the number of large models is growing explosively and their API shape is constantly evolving, we no longer add support for new API or models. We encourage the usage of using the get and set API in gptcache, here is the demo code: https://github.com/zilliztech/GPTCache/blob/main/examples/adapter/api.py + ## Quick Install `pip install gptcache` From 571f27215039eaadb8312dcb3e34a2d737abbd6d Mon Sep 17 00:00:00 2001 From: SimFG Date: Thu, 1 Aug 2024 17:33:27 +0800 Subject: [PATCH 2/5] Fix the nil memory eviction when using the init_similar_cache method Signed-off-by: SimFG --- gptcache/manager/factory.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gptcache/manager/factory.py b/gptcache/manager/factory.py index 65d4bb2e..12a0468a 100644 --- a/gptcache/manager/factory.py +++ b/gptcache/manager/factory.py @@ -118,6 +118,12 @@ def manager_factory(manager="map", maxmemory_samples=eviction_params.get("maxmemory_samples", scalar_params.get("maxmemory_samples")), ) + if eviction_manager == "memory": + return get_data_manager(s, v, o, None, + eviction_params.get("max_size", 1000), + eviction_params.get("clean_size", None), + eviction_params.get("eviction", "LRU"),) + e = EvictionBase( name=eviction_manager, **eviction_params @@ -194,7 +200,7 @@ def get_data_manager( vector_base = VectorBase(name=vector_base) if isinstance(object_base, str): object_base = ObjectBase(name=object_base) - if isinstance(eviction_base, str): + if isinstance(eviction_base, str) and eviction_base != "memory": eviction_base = EvictionBase(name=eviction_base) assert cache_base and vector_base return SSDataManager(cache_base, vector_base, object_base, eviction_base, max_size, clean_size, eviction) From bae7ffeef774e762d9d4e60fce70be00011188a6 Mon Sep 17 00:00:00 2001 From: SimFG Date: Thu, 1 Aug 2024 19:24:11 +0800 Subject: [PATCH 3/5] Update the version to 0.1.44 Signed-off-by: SimFG --- gptcache/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gptcache/__init__.py b/gptcache/__init__.py index 39df80f7..adbd3527 100644 --- a/gptcache/__init__.py +++ b/gptcache/__init__.py @@ -1,5 +1,5 @@ """gptcache version""" -__version__ = "0.1.43" +__version__ = "0.1.44" from gptcache.config import Config from gptcache.core import Cache From 48f8e768d7dcd7f66d948ad07914a630a382b45b Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Wed, 18 Sep 2024 05:05:21 +0300 Subject: [PATCH 4/5] Update the location of data manager script (#650) Signed-off-by: Emmanuel Ferdman --- docs/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing.md b/docs/contributing.md index d35b09ac..8abe4302 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -102,7 +102,7 @@ refer to the implementation of [milvus](https://github.com/zilliztech/GPTCache/b ## Add a new data manager -refer to the implementation of [MapDataManager, SSDataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/cache/data_manager.py). +refer to the implementation of [MapDataManager, SSDataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py). 1. Implement the [DataManager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py) interface 2. Add the new store to the [get_data_manager](https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py) method From 5dfc8977e03b4b1d7fe53d5f7a3fbd7e13767eec Mon Sep 17 00:00:00 2001 From: Dvir David Biton Date: Thu, 26 Dec 2024 09:10:51 +0200 Subject: [PATCH 5/5] Fix setup encoding --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5cfeda12..7646200e 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ here = os.path.abspath(os.path.dirname(__file__)) -with open("README.md", "r") as fh: +with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read()