bhaskatripathi / pdfGPT

PDF GPT allows you to chat with the contents of your PDF file by using GPT capabilities. The most effective open source solution to turn your pdf files in a chatbot!
https://huggingface.co/spaces/bhaskartripathi/pdfGPT_Turbo
MIT License
6.98k stars 837 forks source link

Adding support for Claude, PaLM, Llama2, and Cohere models #94

Closed krrishdholakia closed 1 year ago

krrishdholakia commented 1 year ago

Hi @bhaskatripathi ,

Noticed y'all are calling just OpenAI. I'm working on litellm (simple library to standardize LLM API Calls - https://github.com/BerriAI/litellm) and was wondering if we could be helpful.

Added support for Anthropic, Llama2, Cohere and PaLM by replacing the raw openai.ChatCompletion.create endpoint with completion from litellm.

Would love to know if this helps.

krrishdholakia commented 1 year ago

The only change here is the api key that you're accepting, can now be one of any of those llm providers (for llama 2 that's replicate)

No other changes to the code required.

If you accepted multiple keys, we could also do model fallbacks to prevent failed requests (in case one fails, switch to another provider).