openui
openui copied to clipboard
Using openui with AzureOpenai
I have Azureopenai Credentials and i was wondering if the openui can be used with Azureopenai
I'm using the native OpenAI client which I imagine supports it. You can just change the code here.
i tried changing the code as you mentioned ,but still facing a lot of errors
Thanks @vanpelt works perfectly for me with gpt-4o. @NikitaRawat2003 the fastest way to try it, is to create on your azure instance a deployment that as the same name as the model name in openai ("gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo") and then import AsyncAzureOpenAI from openai and replace:
# openai = AsyncOpenAI(
# base_url=config.OPENAI_BASE_URL,
# api_key=config.OPENAI_API_KEY)
openai = AsyncAzureOpenAI(
api_key=config.OPENAI_API_KEY,
api_version="2024-02-01",
azure_endpoint=config.OPENAI_BASE_URL)
Thanks @vanpelt works perfectly for me with gpt-4o. @NikitaRawat2003 the fastest way to try it, is to create on your azure instance a deployment that as the same name as the model name in openai ("gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo") and then import AsyncAzureOpenAI from openai and replace:
# openai = AsyncOpenAI( # base_url=config.OPENAI_BASE_URL, # api_key=config.OPENAI_API_KEY) openai = AsyncAzureOpenAI( api_key=config.OPENAI_API_KEY, api_version="2024-02-01", azure_endpoint=config.OPENAI_BASE_URL)
did you add your endpoint and key in the config.py file? can you show me how you did it?
did you add your endpoint and key in the config.py file? can you show me how you did it?
@gyxter No need to change anything in the config.py, I reuse the variables. You can do as in the doc, you can export your variable in the terminal:
export OPENAI_API_KEY=*****
export OPENAI_BASE_URL=https://{your-instance}.openai.azure.com/
cd backend
python -m openui