kuafuai / DevOpsGPT

Multi agent system for AI-driven software development. Combine LLM with DevOps tools to convert natural language requirements into working software. Supports any development language and extends the existing code.
https://www.kuafuai.net
Other
6.48k stars 831 forks source link

Add support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #15

Open ishaan-jaff opened 1 year ago

ishaan-jaff commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

ericxinwu commented 1 year ago

@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 commented 1 year ago

@ericxinwu @booboosui any updates on this ?

Balor-TheDemon commented 1 year ago

which other api keys can be used for this tool

ishaan-jaff commented 1 year ago

@Balor-TheDemon see: https://docs.litellm.ai/docs/providers

ishaan-jaff commented 11 months ago

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