processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

Add support for Azure OpenAI, Palm, Replicate, Sagemaker (100+LLMs) - using LiteLLM

Open ishaan-jaff opened this issue 2 years ago • 1 comments

This PR adds support for the above mentioned LLMs using LiteLLM https://github.com/BerriAI/litellm/ LiteLLM allows you to use any llm as a drop in replacement for gpt-3.5

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)

How to Test

Describe how to test that this solution works.

Related Tickets & Packages

  • Link to any related FOUR tickets, PRDs, or packages

Code Review Checklist

  • [x] I have pulled this code locally and tested it on my instance, along with any associated packages.
  • [x] This code adheres to ProcessMaker Coding Guidelines.
  • [x] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • [ ] This solution fixes the bug reported in the original ticket.
  • [x] This solution does not alter the expected output of a component in a way that would break existing Processes.
  • [x] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • [ ] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • [x] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • [ ] This ticket conforms to the PRD associated with this part of ProcessMaker.

ishaan-jaff avatar Sep 09 '23 18:09 ishaan-jaff

@velkymx @ryancooley can i get a review on this PR ?

if this initial commit looks good I can add docs + tests too 😀

ishaan-jaff avatar Sep 09 '23 18:09 ishaan-jaff