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 Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM #111

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

ishaan-jaff
Copy link
Contributor

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 ishaan-jaff changed the title Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM Oct 4, 2023
@ishaan-jaff
Copy link
Contributor Author

@jianghuyihei @callanwu can I get a review on this PR ?

@ishaan-jaff
Copy link
Contributor Author

addressing #108

@cbrom
Copy link

cbrom commented Oct 4, 2023

I was actually searching for a wrapper to do this my self, but couldn't find one. Thanks for this @ishaan-jaff

@jianghuyihei
Copy link
Collaborator

@jianghuyihei @callanwu can I get a review on this PR ?

It sounds great,we will review it soon.

Copy link
Collaborator

@callanwu callanwu left a comment

Choose a reason for hiding this comment

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

thx~

@callanwu callanwu merged commit 91f2d8a into aiwaves-cn:master Oct 5, 2023
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.

None yet

4 participants