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 Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #80

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

ishaan-jaff
Copy link

@ishaan-jaff ishaan-jaff commented Aug 3, 2023

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. 👀🔧

This PR Adds support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm
I'm the maintainer of litellm https://github.com/BerriAI/litellm - a simple & light package to call OpenAI, Azure, Cohere, Anthropic API Endpoints

This PR adds support for models from all the above mentioned providers

Here's a sample of how it's used:

from litellm import completion

## set ENV variables
# ENV variables can be set in .env file, too. Example in .env.example
os.environ["OPENAI_API_KEY"] = "openai key"
os.environ["COHERE_API_KEY"] = "cohere key"

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion("command-nightly", messages)

# anthropic call
response = completion(model="claude-instant-1", messages=messages)

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply 😄🚀

  • Bugfix (non-breaking change which fixes an issue) 🐛
  • New feature (non-breaking change which adds functionality) ✨
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) 💥
  • Documentation Update (if none of the other choices apply) 📖

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md 📚
  • I have added tests that prove my fix is effective or that my feature works ✅✔️
  • I have added necessary documentation (if appropriate) 📝

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... 💡❓

References and related issues (e.g. #1234)

N/A 📌

@ishaan-jaff ishaan-jaff requested a review from RayVentura as a code owner August 3, 2023 20:39
@ishaan-jaff
Copy link
Author

@RayVentura if this looks good, happy to add tests and docs on how to use this with other model providers 😊

@krrishdholakia
Copy link

@ishaan-jaff @RayVentura any updates on this?

@Prakashmaheshwaran
Copy link

@ishaan-jaff worked this and tested as much as i could (i am only a student) everything works fine can add documents and test case if wanted to be, would like to work with you guys on this for actual experience

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.

3 participants