github zilliztech/GPTCache 0.1.21
v0.1.21

latest releases: 0.1.44, 0.1.43, 0.1.42...
18 months ago

🎉 Introduction to new functions of GPTCache

  1. Support the temperature param
from gptcache.adapter import openai

openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    temperature = 1.0,  # Change temperature here
    messages=[{
        "role": "user",
        "content": question
    }],
)
  1. Add the session layer
from gptcache.adapter import openai
from gptcache.session import Session

session = Session(name="my-session")
question = "what do you think about chatgpt"
openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "user", "content": question}
    ],
    session=session
)

details: https://github.com/zilliztech/GPTCache/tree/main/examples#How-to-run-with-session

  1. Support config cache with yaml for server
from gptcache.adapter.api import init_similar_cache_from_config

init_similar_cache_from_config(config_dir="cache_config_template.yml")

config file template: https://github.com/zilliztech/GPTCache/blob/main/cache_config_template.yml

  1. Adapt the dolly model
from gptcache.adapter.dolly import Dolly

llm = Dolly.from_model(model="databricks/dolly-v2-3b")
llm(question)

What's Changed

Full Changelog: 0.1.20...0.1.21

Don't miss a new GPTCache release

NewReleases is sending notifications on new releases.