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

Support Azure OpenAI #55

Closed
sd2k opened this issue Sep 20, 2023 · 1 comment · Fixed by #56
Closed

Support Azure OpenAI #55

sd2k opened this issue Sep 20, 2023 · 1 comment · Fixed by #56
Labels
enhancement New feature or request

Comments

@sd2k
Copy link
Contributor

sd2k commented Sep 20, 2023

As requested in grafana/azure-data-explorer-datasource#601 and tracked in grafana/azure-data-explorer-datasource#602 for the ADX plugin, we should allow users to point the LLM app to Azure OpenAI as well as the regular OpenAI API.

@ishaan-jaff
Copy link

Hi @sd2k I believe we can help with this issue. I’m the maintainer of LiteLLM https://github.com/BerriAI/litellm

TLDR:
We allow you to use any LLM as a drop in replacement for gpt-3.5-turbo.
If you don't have access to the LLM you can use the LiteLLM proxy to make requests to the LLM

You can use LiteLLM in the following ways:

With your own API KEY:

This calls the provider API directly

from litellm import completion
import os
## set ENV variables 
os.environ["OPENAI_API_KEY"] = "your-key" # 
os.environ["COHERE_API_KEY"] = "your-key" # 

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion(model="command-nightly", messages=messages)

Using the LiteLLM Proxy with a LiteLLM Key

this is great if you don’t have access to claude but want to use the open source LiteLLM proxy to access claude

from litellm import completion
import os

## set ENV variables 
os.environ["OPENAI_API_KEY"] = "sk-litellm-5b46387675a944d2" # [OPTIONAL] replace with your openai key
os.environ["COHERE_API_KEY"] = "sk-litellm-5b46387675a944d2" # [OPTIONAL] replace with your 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(model="command-nightly", messages=messages)

@sd2k sd2k linked a pull request Sep 22, 2023 that will close this issue
SandersAaronD pushed a commit that referenced this issue Oct 27, 2023
* Add a ref to the Button in EditorList.

EditorList renders everything via a render prop except for the button.
Therefore to get a handle to that button I've used the [forwardRef][1] method
to add a ref.

[1]: https://reactjs.org/docs/forwarding-refs.html
SandersAaronD pushed a commit that referenced this issue Oct 30, 2023
* Add a ref to the Button in EditorList.

EditorList renders everything via a render prop except for the button.
Therefore to get a handle to that button I've used the [forwardRef][1] method
to add a ref.

[1]: https://reactjs.org/docs/forwarding-refs.html
SandersAaronD pushed a commit that referenced this issue Oct 31, 2023
* Add a ref to the Button in EditorList.

EditorList renders everything via a render prop except for the button.
Therefore to get a handle to that button I've used the [forwardRef][1] method
to add a ref.

[1]: https://reactjs.org/docs/forwarding-refs.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants