Skip to content

Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM#1112

Open
ishaan-jaff wants to merge 2 commits into
postgresml:masterfrom
ishaan-jaff:master
Open

Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM#1112
ishaan-jaff wants to merge 2 commits into
postgresml:masterfrom
ishaan-jaff:master

Conversation

@ishaan-jaff

Copy link
Copy Markdown

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)

@ishaan-jaff

Copy link
Copy Markdown
Author

@levkk @montanalow can I get a review on this PR ?

@kczimm kczimm requested a review from santiatpml October 23, 2023 17:33

@santiatpml santiatpml left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ishaan-jaff Thanks for the PR. litellm seems like a promising addition to pgml-chat. I would like to pull this into our upcoming upgrade to pgml-chat (#1047).
When I try to install litellm using poetry (poetry add litellm) I see the following error. Could you please look into this?

Because no versions of litellm match >0.11.1,<0.12.0
 and litellm (0.11.1) depends on appdirs (>=1.4.4,<2.0.0), litellm (>=0.11.1,<0.12.0) requires appdirs (>=1.4.4,<2.0.0).
So, because no versions of appdirs match >=1.4.4,<2.0.0
 and pgml-chat depends on litellm (^0.11.1), version solving failed.

@cognitivetech

Copy link
Copy Markdown

👀

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