MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Add support for Llama 2, Palm, Anthropic, Cohere Models - using litellm

Open ishaan-jaff opened this issue 2 years ago • 7 comments

Addressing https://github.com/geekan/MetaGPT/issues/97

I'm the maintainer of litellm https://github.com/BerriAI/litellm - a simple & light package to call OpenAI, Azure, Cohere, Anthropic, Replicate API Endpoints

This PR adds support for models from all the above mentioned providers (by creating a class liteLLM)

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)

ishaan-jaff avatar Aug 04 '23 17:08 ishaan-jaff

cc @geekan can I get a review on this ?

ishaan-jaff avatar Aug 04 '23 17:08 ishaan-jaff

Thanks! Can we make llama2 a local file and call it? So everything is local without the need to call external APIs.

hohoCode avatar Aug 04 '23 18:08 hohoCode

any update here? @ishaan-jaff

stellaHSR avatar Sep 04 '23 03:09 stellaHSR

Thanks for bumping @stellaHSR taking a look

ishaan-jaff avatar Sep 05 '23 00:09 ishaan-jaff

Hi @ishaan-jaff, I suggest implementing acompletion_text() to make using liteLLM in metagpt easier.

stellaHSR avatar Sep 15 '23 15:09 stellaHSR

will love to be able to use local models especially llama2 70B

izevar avatar Oct 31 '23 14:10 izevar

Any updates on this? @ishaan-jaff

raphant avatar Apr 16 '24 15:04 raphant