langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Support AzureOpenAI configuration

Open bluesheep opened this issue 2 years ago • 14 comments

The AzureOpenAI LLM is functionally identical to the OpenAI LLM but requires different parameters.

Azure OpenAI

It would be great to be able to use this configuration!

bluesheep avatar Mar 30 '23 15:03 bluesheep

Hey, we are adding it in our next release. It might some more testing but should work.

ogabrielluiz avatar Apr 04 '23 22:04 ogabrielluiz

Just FYI this would also make it possible to use any llama.cpp compatible models (llama, alpaca, gpt4all, etc) via https://github.com/abetlen/llama-cpp-python#web-server

abetlen avatar Apr 06 '23 19:04 abetlen

This looks very interesting. I have started working on it. It requires a few extra parameters other than the API key. In the case of llama-cpp-python is it exactly the same as the docs?

In LangFlow, if you don't pass the API key, LangChain will still try to find it in the environment but according to the example in the docs, there are a few variables you need to set to be able to use it. What is your opinion on that?

Are those variables normally set in the environment of the average Azure user?

The deployment_name param is now really simple to add, but we must have a clear template of the node and how it is used.

ogabrielluiz avatar Apr 06 '23 21:04 ogabrielluiz

image What do you think of this approach?

ogabrielluiz avatar Apr 06 '23 22:04 ogabrielluiz

@ogabrielluiz woops, after looking into it a little deeper it looks like this was actually already possible with the regular OpenAI llm. I missed that you could just change the OPENAI_API_BASE environment variable. This is actually preferrable as the azure endpoints seem to be using an older version of the OpenAI API.

Anyways, sorry for the confusion. Great tool btw!

image

abetlen avatar Apr 07 '23 01:04 abetlen

Oh, nice!

Maybe we could put that functionality into the OpenAI node to allow the person to chose.

I've been thinking about dynamic nodes that change depending on params. Maybe this would be a good use case to explore.

Anyway, with what you described it is possible to use your project?

ogabrielluiz avatar Apr 07 '23 01:04 ogabrielluiz

Yes it should, I'm trying to make it as interoperable as possible with existing tools that already are built against the OpenAI API.

Currently switching between models doesn't actually do anything as the server only supports a single llama.cpp model loaded in at once but I'm working on allowing the user to provide aliases so e.g. gpt-3.5-turbo -> llama-7b or text-davinci-003 -> llama-30b

abetlen avatar Apr 07 '23 01:04 abetlen

image

What do you think of this approach?

Nice, but right now the OpenAI node takes the OPENAI_API_KEY. Azure OpenAI requires 4 values: OPENAI_API_TYPE, OPENAI_API_KEY``, OPENAI_API_BASEandOPENAI_API_VERSION`. The user should also be able to provide them.

adumont avatar Apr 18 '23 16:04 adumont

In addition we'd also need an Azure Open AI Embedding node.

adumont avatar Apr 18 '23 16:04 adumont

I got an Azure OpenAI account and can test if necessary. Is the code already written? Do you need help?

mycaule avatar Apr 18 '23 18:04 mycaule

Same here I have an Azure Account, I can help with testing.

El mar, 18 abr 2023, 20:03, Michel Hua @.***> escribió:

I got an Azure OpenAI account and can test if necessary. Is the code already written? Do you need help?

— Reply to this email directly, view it on GitHub https://github.com/logspace-ai/langflow/issues/85#issuecomment-1513588841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRLWWTUAUBKTP34XR3D73XB3JODANCNFSM6AAAAAAWNPWKJQ . You are receiving this because you commented.Message ID: @.***>

adumont avatar Apr 18 '23 18:04 adumont

Me too!

SOUMYABROTOBANERJEE avatar Apr 21 '23 18:04 SOUMYABROTOBANERJEE

Just bumping this one, I feel it will enable a lot of users. And indeed, I can also help test.

TheodorosGalanos avatar Apr 25 '23 22:04 TheodorosGalanos

bump!

khu834 avatar May 08 '23 20:05 khu834

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 23 '23 04:06 stale[bot]