srush / MiniChain

A tiny library for coding with large language models.
https://srush-minichain.hf.space/
MIT License
1.19k stars 74 forks source link

adding support for anthropic, cohere, replicate and azure #26

Open krrishdholakia opened 11 months ago

krrishdholakia commented 11 months ago

Hi @srush

Following on from this issue -https://github.com/srush/MiniChain/issues/22. 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.

I added support for Palm, Claude, Azure, Cohere and Llama2 (via Replicate) by replacing the OpenAI endpoint with litellm. The code is pretty similar to the OpenAI class - as litellm follows the same pattern as the openai-python sdk.

Would love to know if this helps.

Happy to add additional tests / update documentation, if the initial PR looks good to you.