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 litellm Demo - call cohere models using chatGPT I/O format #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ishaan-jaff
Copy link

@ishaan-jaff ishaan-jaff commented Aug 4, 2023

I'm the maintainer of litellm https://github.com/BerriAI/litellm - a simple & light package to call Cohere, Anthropic, Azure, OpenAI LLM Models using chatGPT input/output format

This PR adds an example on how to use it

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)

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ishaan-jaff ishaan-jaff changed the title Add support for Bard, Anthropic, Cohere, Azure, OpenAI Models - using litellm Add litellm Demo - call cohere models using chatGPT I/O format Aug 4, 2023
@ishaan-jaff
Copy link
Author

@mrmer1 @co-sylvie can you please take a look at this PR. It simplifies making cohere api calls 😊

@ishaan-jaff
Copy link
Author

Hi @mrmer1 @jalammar any update on getting this reviewed ?

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.

2 participants