GPTCache
GPTCache copied to clipboard
Add support for Bard, Anthropic, Cohere, Azure, OpenAI Models - using litellm
I'm the maintainer of litellm https://github.com/BerriAI/litellm - a simple & light package to call Bard, Anthropic, Cohere, Azure, OpenAI LLM Models
This PR adds support for models from all the above mentioned providers, in this pr I made a new adapter called litellm.py
Here's a sample of how it's used:
from litellm import completion
## set ENV variables
# ENV variables can be set in .env file, too. Example in .env.example
os.environ["OPENAI_API_KEY"] = "openai key"
os.environ["COHERE_API_KEY"] = "cohere key"
messages = [{ "content": "Hello, how are you?","role": "user"}]
# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)
# cohere call
response = completion("command-nightly", messages)
# anthropic call
response = completion(model="claude-instant-1", messages=messages)
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: ishaan-jaff
To complete the pull request process, please assign simfg after the PR has been reviewed.
You can assign the PR to them by writing /assign @simfg in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Welcome @ishaan-jaff! It looks like this is your first PR to zilliztech/GPTCache 🎉
@cxie @SimFG @xiaofan-luan saw adding new LLM models was on the roadmap, made a PR to integrate with liteLLM which adds new LLM models. if this looks good would love to add support to GPTCache
@ishaan-jaff thanks for your pr, please make the dev branch as the target
what would next steps on this PR be? @ishaan-jaff @SimFG
@ishaan-jaff please add some test cases for your pull request