Skip to content

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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ishaan-jaff
Copy link

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
Author

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

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

@santiatpml santiatpml left a comment

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

👀

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