thevickypedia / Jarvis

Fully Functional Voice Based Natural Language UI
https://jarvis-health.vigneshrao.com
MIT License
209 stars 41 forks source link

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

Closed ishaan-jaff closed 5 months ago

ishaan-jaff commented 1 year ago

This PR adds support for models from all the above mentioned providers using https://github.com/BerriAI/litellm/

Here's a sample of how it's used:

from litellm import completion, acompletion

## 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)

# async openai
response = acompletion(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

@thevickypedia can you take a look at this PR? Happy to add more comments/ info in the readme if the initial commit looks good😊

thevickypedia commented 1 year ago

@ishaan-jaff Thanks for raising a PR. I would like to run an extensive test the library. As you may have already noticed, my package is a natural language solution and mostly related to home-automation and serving as a personal-assistant rather than an AI. So it has little to no use for ML/DL libraries. Nevertheless, I'll go through your library and analyze the use-case scenarios before I can integrate it.

DawoodTouseef commented 1 year ago

It's best to integrate with open ai it answer the user request generating it instead of using the specfic command which you given it in jarvis/modules/conditions/conversation.py instead of that we can integrate it with open ai

dormant-user commented 5 months ago

I'm revisiting this PR after a long time. I did research about all the OpenAI solutions Unfortunately all the APIs are behind a payment firewall (one way or the other), and I'm totally against paying for a feature solely to integrate with Jarvis which is free otherwise So I decided to create my own private AI with ollama2, I'm still in the initial stages of customizing the model I'll have the feature integrated in the near future, so I'm closing this PR now Thanks again for raising a thoughtful PR