Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Llama2, Palm, Cohere, Anthropic, Replicate, Azure Models - using litellm #13

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

ishaan-jaff
Copy link
Contributor

This PR adds support for 50+ models with a standard I/O interface using: https://github.com/BerriAI/litellm/

ChatLiteLLM() is integrated into langchain and allows you to call all models using the ChatOpenAI I/O interface
https://python.langchain.com/docs/integrations/chat/litellm

Here's an example of how to use ChatLiteLLM()

ChatLiteLLM(model="gpt-3.5-turbo")
ChatLiteLLM(model="claude-2", temperature=0.3)
ChatLiteLLM(model="command-nightly")
ChatLiteLLM(model="replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1")

@ishaan-jaff
Copy link
Contributor Author

Addressing: #9

@ishaan-jaff
Copy link
Contributor Author

@fynnfluegge can you please take a look at this PR when possible?

Happy to add docs/testing if this initial commit looks good to you

If this PR looks useful would love to meet to discuss how we can be helpful to you. Here's my calendly for your convenience

@fynnfluegge
Copy link
Owner

@ishaan-jaff this is great, thanks a lot! 🔥
I think a new argarse argument would make sense here, instead the --gpt4 argument. Maybe --model with default gpt3.5-turbo as currently. Then any litellm supported model can be used with that argument. Maybe a section in the README.md would be helpful.

One question: litellm uses only environment parameters to access sagemaker or azure hosted models right?
I also prepared a small PR that exposes the sagemaker and azure langchain api here #12 but I guess this one is absolete if we use litellm, isn't it?

@fynnfluegge
Copy link
Owner

@ishaan-jaff tested with OpenAI, works great! If you could run poetry lock in your branch I will merge this 🙌

pyproject.toml Show resolved Hide resolved
@fynnfluegge fynnfluegge merged commit 48e6910 into fynnfluegge:main Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants