mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
(chore) remove bloat - deprecated gpt cache integration
This commit is contained in:
parent
6d9d79d12b
commit
717d3995b5
1 changed files with 0 additions and 27 deletions
|
|
@ -1,27 +0,0 @@
|
|||
###### LiteLLM Integration with GPT Cache #########
|
||||
# will be deprecated soon https://github.com/BerriAI/litellm/discussions/648#discussioncomment-7461510
|
||||
import gptcache
|
||||
|
||||
# openai.ChatCompletion._llm_handler = litellm.completion
|
||||
from gptcache.adapter import openai
|
||||
import litellm
|
||||
|
||||
|
||||
class LiteLLMChatCompletion(gptcache.adapter.openai.ChatCompletion):
|
||||
@classmethod
|
||||
def _llm_handler(cls, *llm_args, **llm_kwargs):
|
||||
return litellm.completion(*llm_args, **llm_kwargs)
|
||||
|
||||
|
||||
completion = LiteLLMChatCompletion.create
|
||||
###### End of LiteLLM Integration with GPT Cache #########
|
||||
|
||||
|
||||
# ####### Example usage ###############
|
||||
# from gptcache import cache
|
||||
# completion = LiteLLMChatCompletion.create
|
||||
# # set API keys in .env / os.environ
|
||||
# cache.init()
|
||||
# cache.set_openai_key()
|
||||
# result = completion(model="claude-2", messages=[{"role": "user", "content": "cto of litellm"}])
|
||||
# print(result)
|
||||
Loading…
Add table
Reference in a new issue