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 Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #15

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

Conversation

ishaan-jaff
Copy link

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. I added a condition to check if the provided model is supported by litellm -> if so it uses litellm for the completion call.

If not it maintains your openai call

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

@yakeJiang @ericxinwu would love some feedback on if this looks good. Happy to make your openai call as the default one and if the model is not supported by the openai call we can direct it to litellm

@booboosui
Copy link
Collaborator

thank you very much. we will consider your proposal as soon as possible

@ericxinwu
Copy link
Collaborator

@yakeJiang @ericxinwu would love some feedback on if this looks good. Happy to make your openai call as the default one and if the model is not supported by the openai call we can direct it to litellm

Thanks a lot for your PR, we will review it ASAP.

@ishaan-jaff
Copy link
Author

@ericxinwu @booboosui any updates on this ?

@Balor-TheDemon
Copy link

which other api keys can be used for this tool

@ishaan-jaff
Copy link
Author

@ishaan-jaff
Copy link
Author

Hi @ericxinwu @booboosui any update on this? Is there something missing in LiteLLM for your use case?

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.

4 participants