-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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, Replicate Models - using litellm #283
Conversation
@ishaan-jaff is attempting to deploy a commit to the Danswer Team on Vercel. A member of the Team first needs to authorize it. |
@yuhongsun96 @Weves can I get a review on this PR ?😊 Happy to add more docs/tests if this initial commit looks good |
Hey @ishaan-jaff, this looks amazing! Would absolutely love to have this! A few questions:
If the above can be addressed, I'd love to just commit the your project completely. Also, if you could commit some docs for how to set up and use the difference model hosting services, please check out our docs page: https://docs.danswer.dev/gen_ai_configs/overview |
Hi @yuhongsun96
Currently working on ensuring we have support for HF models you use - will add a new commit once that's done + docs |
Curious why ? Has maintaining existing llm providers been challenging ? |
Since your project can handle all these disparate LLM providers, it just seems like an obvious win to unify it so we don't have to worry about introducing unnecessary code/complexity. And to support newer models, we could just bump your library version at some point down the line. It is not a great use of time on our end to build the same functionality many times when we can offload that to a external tool. |
In terms of reviewing the PR, here are some things we'd love to have:
We can refactor the code to be generic rather than referencing openai everywhere, no need to worry about that. Also, quick question, how do you handle things like tokenizing? We use tiktoken to ensure that we don't pass in too large of a message to the model, but this is specific to OpenAI. |
@yuhongsun96 tested locally on docker and it's working with the new liteLLM changes 😊
As for this, all the changes in this PR don't impact your current configuration - so there's nothing to add to docs |
Since this PR essentially starts using liteLLM here's how I was thinking of merging:
@yuhongsun96 let me know if this sounds good and if the PR looks good |
bump on this? @yuhongsun96 |
Hey! Sorry for the delay! Quick question, we saw that Langchain similarly has a way to plug/play LLMs. What are your views on this? The thinking being that Langchain is a larger project and is less likely to stop being maintained. But would love to hear about choosing litellm and the benefits. |
nice - what specifically within langchain did you see? @yuhongsun96 |
Hey @krrishdholakia! @yuhongsun96 is referring to https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/llms/base.py#L157 (and it's subclasses) |
Thanks for sharing the link
|
Hey @ishaan-jaff, sorry for the really long turnaround on this one. We re-standardized our LLM interfaces: Would LiteLLM still work given this? I imagine it would right? I still think there's a lot of value in using LiteLLM, would love to hear your thoughts |
Hi @yuhongsun96 - yes you can use our langchain class if you'd like - Curious - what made you change your mind? @yuhongsun96 / @Weves |
We were going to get back to you after reworking our LLM interfaces, but we just got really swamped with other things and forgot about it. Then someone asked again for it so we figured we'd reach out and get this finally done. It looks very easy to integrate just based on that page you sent, what are the env variables to configure the different models? I remember you saying that was the way to easily swap them? |
Hey @yuhongsun96 sounds good - made the PR here - #510 Let me know if i missed anything. |
Closing as #510 has been put in and cover this. Thanks for the contrib and your awesome lib! |
This PR adds support for models from all the above mentioned providers using https://github.com/BerriAI/litellm/
Here's a sample of how it's used: