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

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

Conversation

ishaan-jaff
Copy link

This PR adds support for models from all the above mentioned providers using https://github.com/BerriAI/litellm - litellm allows you to interact with Palm, Azure, Anthropic, etc models using OpenAI chatCompletions Input/Output format.

It standardizes Inputs/outputs to LLM APIs making it easier to use newer models and debug easily

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

from litellm import completion, acompletion

## 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"}]

# google palm call
result = completion(model="chat-bison-001", messages=messages)

# google palm call
result = completion(model="text-bison-001", messages=messages)

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

# async openai
response = acompletion(model="gpt-3.5-turbo", messages=messages)

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

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

@google-cla
Copy link

google-cla bot commented Aug 6, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ishaan-jaff
Copy link
Author

@michael-chi @giranntu can you please take a look at this ? If it looks good happy to add more docs/tests. Thought this would be useful because litellm simplifies using Non OpenAI LLM models😊

Copy link

@shakeebshams shakeebshams left a comment

Choose a reason for hiding this comment

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

Could you sign the cla: https://cla.developers.google.com/clas

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