Skip to content

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