Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Markdown
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Determine Configuration Values](#determine-configuration-values)
- [Configure the Azure OpenAI Models](#configure-the-azure-openai-models)

# Introduction
This guide describes how to configure Azure to generateproduce the prerequisitesvalues required to enableconfigure the Ayfie Personal Assistant feature. It is assumed that one already has

# Prerequisites
These are the prerequisites that must be fulfilled before setting up Personal Assistant:
- **Obtain an Azure Subscription** - One must have an active Azure subscription. If one don’t have one, one can sign up for an Azure subscription and access to on the [Azure website](https://azure.microsoft.com/en-us/).
- **Get Azure OpenAI as described inApproval** - The Azure subscription needs to be approved for [Azure OpenAIOpen Service DocumentationAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview). How to do that is described in [Ayfie Personal Assistant - How to Request Access to the Azure OpenAI Service](https://ayfie-dev.atlassian.net/wiki/spaces/SAGA/pages/3443523634/Ayfie+Personal+Assistant+-+How+to+Request+Access+to+the+Azure+OpenAI+Service).

 Once the prerequisites above have been completed, one can then start configuring Ayfie Personal Assistant.

# Determine PrerequisitesConfiguration TheValues
prerequisitesOne areneeds to providedetermine the following entitiesconfiguration values:
- **Deployment Name**
- **API Address**
- **API Key**

for each of the following 3 Azure OpenAI models:
- **Main Model**
- **High Quality Model**
- **Embeddings Model**

ForThe historicalintended reasons, Personal Assistant supports the concept of adifference between the Main Model and athe High Quality Model. Thisis tothe makequality itof possiblethe forchat customersresponses towhen tradeusers performancetoggle forbetween cost.the However,two asin the currently best performing model Personal Assistant UI. The normal approach is alsoto set the mostMain inexpensiveModel one,up the recommended setup is the *full* mode option (see section Personal Assistant in the [Installation Guide](https://ayfie-dev.atlassian.net/wiki/spaces/SAGA/pages/2400714758/Ayfie+Locator+Installation+Guide)) in combination with *gpt-4*, version *1106-Preview*, as the Main Model. Practically speaking, this means that one uses identical configuration for the Main Model and the High Quality Model (see instructions below)with GPT-3.5 and the High Quality Model with GPT-4. The reason for having two options and not just a single High Quality Model option is that GPT-3.5 can, depending on the current offerings, be faster and/or lower cost than GPT-4.

The last listed model is for creating embeddings. Embeddings are numerical representations of words that are learned from large amounts of text data. Currently, there is only one supported model.

Each of the 3 models requires an API address and an API key. However, unless one chose to spread the models across geographical regions, all 3 models will be reached via the same API address and an API key.

Given the limited options for each setting, the configuration of the prerequisites in Azure described in the next section, has a very predictable outcome:
- Main Model Deployment Name: ***gpt-435-turbo***
- High Quality Model Deployment Name: ***gpt-4***
- Embeddings Model Deployment Name: ***text-embedding-ada-002***
- API Address: *the same one for all three*
- API Key: *the same one for all three*

# Configure the Azure OpenAI Models
For more information, consult [Azure OpenAI Service Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview).

Follow these steps to set up the deployments for the 3 Azure OpenAI models:
- Log in to the Azure portal at [portal.azure.com](https://portal.azure.com/)
- Make sure the account that is logged in has at least one subscription
- Go to *Azure OpenAI*
  - Click *Create*, to create a Resource
    - In *Project Details*, select *Subscription*
    - In *Project Details*, select *Resource Group*
    - In *Instance Details*, select *Region*.  Not all models are available in all regions, consult with [Azure OpenAI Service models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models) for availability. EU country customers should for legal reason select a region that is within EU. To avoid any data quota conflict with a current or a future deployment of the standalone version of the Personal Assistant, it is recommended to not select the regions *Sweden Central*, *UK South* and *Canada East*.
    - In *Instance Details*, set the *Name*
    - In *Instance Details*, select *Pricing Tier*
    - Click *Next* to go to the *Network* tab
    - In *Type*, select *All networks, including internet can access this resource.*
    - Click *Next* to go to the *Tags* tab
    - Click *Next* to go to the *Review + submit* tab
    - Click *Create*
  - When Resource is created, select the resource in *Azure OpenAI*
  - Click *Keys and Endpoint* in the left menu
    - **Copy the value of *Endpoint*, it will be required later as the API Address**
    - **Copy the value of *KEY 1*, it will be required later as the API Key** (optionally *KEY 2*, both keys are valid)
  - Click *Model deployments* in the left menu
  - Click *Manage Deployments* (this will open a new portal)
  - Click *Create new deployment* to create Main model
    - Select the model (recommended *gpt-435-turbo*)
    - Select the Model Version (recommendedSet to *1106-PreviewAuto-update to default*)
    - Set the *Deployment Name* (must be same as model name)
      - **Copy the *Deployment Name*, it will be required later**
    - In *Advanced Options*, set *Tokens per Minute Rate Limit (thousands)* to maximum value.
  - Click *Create new deployment* to create High Quality model
(only required if one wishes- to use a different deployment for Select the Highmodel Quality Model than for the Main Model(recommended *gpt-4*)
    - Select the modelModel Version (recommended   - Select the Model version.*1106-Preview*)
    - Set the *Deployment Name* (must be same as model name).
      - **Copy the *Deployment Name*, it will be required later**
    - In *Advanced Options*, set *Tokens per Minute Rate Limit (thousands)* to maximum value.
  - Click *Create new deployment* to create Embeddings model
    - Select the model (must be *text-embedding-ada-002*)
    - Set the *Deployment Name* (must be same as model name)
      - **Copy the *Deployment Name*, it will be required later**
    - In *Advanced Options*, set *Tokens per Minute Rate Limit (thousands)* to maximum value