forked from phoenix/litellm-mirror
docs update
This commit is contained in:
parent
5fb8675cf8
commit
02accce48e
1 changed files with 14 additions and 1 deletions
|
@ -3,18 +3,31 @@
|
||||||
GPTCache is a Library for Creating Semantic Cache for LLM Queries
|
GPTCache is a Library for Creating Semantic Cache for LLM Queries
|
||||||
|
|
||||||
GPTCache Docs: https://gptcache.readthedocs.io/en/latest/index.html#
|
GPTCache Docs: https://gptcache.readthedocs.io/en/latest/index.html#
|
||||||
|
|
||||||
GPTCache Github: https://github.com/zilliztech/GPTCache
|
GPTCache Github: https://github.com/zilliztech/GPTCache
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Install GPTCache
|
### Install GPTCache
|
||||||
|
```
|
||||||
pip install gptcache
|
pip install gptcache
|
||||||
|
```
|
||||||
|
|
||||||
### Using GPT Cache with Litellm Completion()
|
### Using GPT Cache with Litellm Completion()
|
||||||
|
|
||||||
|
#### Using GPTCache
|
||||||
|
In order to use GPTCache the following lines are used to instantiat it
|
||||||
```python
|
```python
|
||||||
from gptcache import cache
|
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
|
import time
|
||||||
|
|
||||||
# Set your .env keys
|
# Set your .env keys
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue