diff --git a/docs/my-website/docs/caching/gpt_cache.md b/docs/my-website/docs/caching/gpt_cache.md index 3a514a6cb..aeeac2ef4 100644 --- a/docs/my-website/docs/caching/gpt_cache.md +++ b/docs/my-website/docs/caching/gpt_cache.md @@ -3,18 +3,31 @@ GPTCache is a Library for Creating Semantic Cache for LLM Queries GPTCache Docs: https://gptcache.readthedocs.io/en/latest/index.html# + GPTCache Github: https://github.com/zilliztech/GPTCache ## Usage ### Install GPTCache +``` pip install gptcache +``` ### Using GPT Cache with Litellm Completion() +#### Using GPTCache +In order to use GPTCache the following lines are used to instantiat it ```python from gptcache import cache -from litellm.cache import completion +# set API keys in .env / os.environ +cache.init() +cache.set_openai_key() +``` + +#### Full Code using GPTCache and LiteLLM +```python +from gptcache import cache +from litellm.cache import completion # import completion from litellm.cache import time # Set your .env keys