Configure Danswer to use GPT models hosted on Azure
Refer to Model Configs for how to set the
environment variables for your particular deployment.If you’re already familiar with Azure OpenAI, feel free to skip to the
configuring Danswer
section at the end
By far the most requested model integration has been Azure OpenAI. As of Aug 2023, GPT-4 is the most capable LLM
available. When combined with the Enterprise grade security and geographical deployment options of Azure, this
becomes a very attractive option for using with Danswer.
As of Aug 2023, Azure OpenAI access is by
application only. This may change
moving forward, please check online for the latest information.Start by creating the Azure OpenAI Resource
Search for Azure OpenAI service
Click on +Create to create a new Azure OpenAI resource
Once the resource is created, visit it in Azure OpenAI Studio
Select ChatThen click on View Code to see the connection info which we will configure for DanswerNote the values provided in the sample code (also feel free to try out the code to verify it works)
Following the image above, you would configure Danswer with the following environment variables:
Copy
GEN_AI_MODEL_PROVIDER=azureGEN_AI_MODEL_VERSION=Danswer # "deployment_name", shown in image with the line # model = "deployment_name"GEN_AI_API_ENDPOINT=https://danswer.openai.azure.com/GEN_AI_API_VERSION=2023-02-15-previewGEN_AI_API_KEY=<your-azure-key> # found below the code section in the above image
You can also leave the GEN_AI_API_KEY unset and set it later via the UI