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

feat(liteLLM): Add support for Azure OpenAI, Palm, Claude-2, Llama2, CodeLlama (100+LLMs) #1097

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Sep 2, 2023

Description

This PR adds support for the above mentioned LLMs using LiteLLM https://github.com/BerriAI/litellm/
Example:
docs on langchain integration https://python.langchain.com/docs/integrations/chat/litellm

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")

In addition LiteLLM client allows you to n [Experimental + Optional Features]:

  • A/B test LLMs in production
  • Dynamically control each LLMs prompt, temperature, top_k etc in our UI (no need to re-deploy code)
  • Logging to view input/outputs for each LLM

Here's a link to a live demo of litellm client: https://admin.litellm.ai/

liteLLM-Ab-testing

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

@ishaan-jaff
Copy link
Contributor Author

@StanGirard can you please take a look at this PR when possible ? Happy to add more docs/tests if this initial commit looks good😊

@StanGirard
Copy link
Collaborator

Looks really cool. I don’t have my pc with me currently but here are a few notes:

  • don’t you need to install litellm package in the requirements.txt ?
  • how can I deploy my own admin ?

@aadityamundhalia
Copy link
Contributor

@ishaan-jaff i think instead of replacing the current import you should add .env variable and with if statement allow both openai as well as litellm

@StanGirard
Copy link
Collaborator

@ishaan-jaff i think instead of replacing the current import you should add .env variable and with if statement allow both openai as well as litellm

The goal is to replace openai with a project that allows anyone :)

@@ -1,5 +1,6 @@
pymupdf==1.22.3
langchain==0.0.247
langchain==0.0.281
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

langchain 0.0.281 includes the latest version of ChatLiteLLM too

@ishaan-jaff
Copy link
Contributor Author

  • don’t you need to install litellm package in the requirements.txt ?

@StanGirard done, good catch. Also bumped the version of langchain to include the latest ChatLiteLLM fixes https://github.com/langchain-ai/langchain/releases

  • how can I deploy my own admin ?

This is an experimental feature using completion_with_split_tests. Happy to add docs to quivr about how to do this too, here's a link to our docs: https://docs.litellm.ai/docs/tutorials/ab_test_llms

Just want to re-iterate that the dashboard is experimental and our focus is entirely on making LiteLLM really good at I/O

Copy link
Collaborator

@StanGirard StanGirard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gozineb looks good to me. Can you check that everything works ? Especially with the version update of langchain ?

Should only need to test:
Uploading
Chat with a brain and unplug.

@@ -1,5 +1,6 @@
pymupdf==1.22.3
langchain==0.0.247
langchain==0.0.281
litellm==0.1.531
Copy link
Contributor

@mamadoudicko mamadoudicko Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still needlitellm import ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so :) langchain is just a wrapper. It doesn't come with the packages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

@gozineb
Copy link
Contributor

gozineb commented Sep 5, 2023

@StanGirard looks good to me ! Merging this as soon as the checks pass !

@gozineb gozineb changed the title Add support for Azure OpenAI, Palm, Claude-2, Llama2, CodeLlama (100+LLMs) feat(liteLLM): Add support for Azure OpenAI, Palm, Claude-2, Llama2, CodeLlama (100+LLMs) Sep 5, 2023
@gozineb gozineb merged commit 02964c4 into QuivrHQ:main Sep 5, 2023
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
…CodeLlama (100+LLMs) (#1097)

* v0 litellm

* bump versions
@NormTurtle
Copy link

what about PALM
which has free API from google?

@ishaan-jaff
Copy link
Contributor Author

we support palm too https://docs.litellm.ai/docs/providers

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.

6 participants