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
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?

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.

None yet

2 participants