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, Replicate, Sagemaker (100+LLMs) - using litellm #369

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

ishaan-jaff
Copy link
Contributor

This PR adds support for the above mentioned LLMs using LiteLLM https://github.com/BerriAI/litellm/
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("command-nightly", messages)

# anthropic call
response = completion(model="claude-instant-1", messages=messages)

@ishaan-jaff
Copy link
Contributor Author

@rentainhe can you take a look at this PR when you get the chance?

Happy to add more docs/testing if this initial commit looks good😊

@rentainhe
Copy link
Collaborator

This PR looks very nice. Would you be willing to add more judgment conditions and documentation? If users have not installed light-llm, they can use the original API provided by OpenAI. @ishaan-jaff

@ishaan-jaff
Copy link
Contributor Author

yes @rentainhe

can you provide some guidance on what changes you'd like me to add ?

@rentainhe
Copy link
Collaborator

rentainhe commented Sep 6, 2023

yes @rentainhe

can you provide some guidance on what changes you'd like me to add ?

Hello! Maybe you can try to use:

try:
    import lightllm
    HAS_LIGHTLLM = True
except:
    HAS_LIGHTLLM = False

Try to use a flag to control it, which may be better for the users who did not install lightllm, they can use openai original API instead of it

@ishaan-jaff

But I think I can merge this PR first, maybe you can try to update it later if you think this is a better solution~

@rentainhe
Copy link
Collaborator

It would be very nice for u to add more documentation (maybe in README) about this update! You can try to update the requirements.txt to inform the users to install litellm

@rentainhe rentainhe merged commit 220f49b into IDEA-Research:main Sep 6, 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

2 participants