facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.49k stars 2.1k forks source link

Add support for Palm, Claude-2, Cohere, Sagemaker, Bedrock (100+LLMs) #5076

Closed ishaan-jaff closed 1 year ago

ishaan-jaff commented 1 year ago

Patch description

This PR adds support for the above mentioned LLMs using LiteLLM https://github.com/BerriAI/litellm/ LiteLLM is a lightweight package to simplify LLM API calls - use any llm as a drop in replacement for gpt-3.5-turbo.

Example

from litellm import completion

## set ENV variables
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(model="command-nightly", messages)

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

Testing steps

Other information

facebook-github-bot commented 1 year ago

Hi @ishaan-jaff!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

ishaan-jaff commented 1 year ago

@mojtaba-komeili @klshuster can i get a review on this PR ?

happy to add docs/ tests if this initial commit looks good

mojtaba-komeili commented 1 year ago

I am not sure if the litelm package had wide enough adoption to justify adding that to our packages. Perhaps for now it makes sense to keep is as part of an external branch.

github-actions[bot] commented 1 year ago

This PR has not had activity in 30 days. Closing due to staleness.

ishaan-jaff commented 1 year ago

Hi @mojtaba-komeili following up on this - LiteLLM has 2.5K stars, used by 290+ open source projects. We'd love to create value for this package

We make it very easy to evaluate LLMs

mojtaba-komeili commented 1 year ago

OK, let's merge this in.