docs update
This commit is contained in:
parent
5fb8675cf8
commit
02accce48e
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user