Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

add support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #408

Closed
wants to merge 1 commit into from

Conversation

ishaan-jaff
Copy link

Addressing this issue: #211

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

This PR adds support for models from all the above mentioned providers

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
Copy link
Author

cc @emrgnt-cmplxty @NolanTrem would love your feedback when you get the chance to look at this

@emrgnt-cmplxty
Copy link
Owner

Unfortunately this won't work for our implementation, since we have special logic around OpenAI's function handling. I'll keep an eye on your repository and consider introducing this when we are considering the problem more seriously, thanks.

@ishaan-jaff
Copy link
Author

@emrgnt-cmplxty litellm does function handling too - was there something missing in the package ?

@krrishdholakia
Copy link

hey @emrgnt-cmplxty @NolanTrem - just wanted to bump this. Anything we're missing on our end?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants