Skip to content

Commit

Permalink
Documentation: Azure OpenAI (has GPT-4-32k)
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Oct 21, 2023
1 parent 3a66f50 commit cdaf972
Showing 1 changed file with 45 additions and 44 deletions.
89 changes: 45 additions & 44 deletions docs/config-azure-openai.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,87 @@
# Azure OpenAI Service Configuration with `big-AGI`
# Configuring Azure OpenAI Service with `big-AGI`

The following procedure will take ~5 minutes to go from zero to an Azure account with
access to the Azure OpenAI service, allocate instances, and deploy models.
The entire procedure takes about 5 minutes and involves creating an Azure account,
setting up the Azure OpenAI service, deploying models, and configuring `big-AGI`
to access these models.

By default the pricing is 'pay-as-you-go', and you enter credit card information which
is tied to a 'subscription' to the Azure service.
Please note that Azure operates on a 'pay-as-you-go' pricing model and requires
credit card information tied to a 'subscription' to the Azure service.

## Setup big-AGI
## Configuring `big-AGI`

Once you have API Endpoint and API Key it's easy to configure big-AGI.
If you have an `API Endpoint` and `API Key`, you can configure big-AGI as follows:

1. Open the big-AGI application
1. Launch the `big-AGI` application
2. Go to the **Models** settings
3. Add a Vendor, and select **Azure OpenAI**
- input the Endpoint, e.g. 'https://your-openai-api-1234.openai.azure.com/'
- input the API Key, e.g. 'fd5...........................ba'
3. Add a Vendor and select **Azure OpenAI**
- Enter the Endpoint (e.g., 'https://your-openai-api-1234.openai.azure.com/')
- Enter the API Key (e.g., 'fd5...........................ba')

The deployed models are now available in the application. If you do not have a configured
Azure OpenAI service instance, read the next section.
The deployed models are now available in the application. If you don't have a configured
Azure OpenAI service instance, continue with the next section.

## Setup Azure
## Setting Up Azure

### Step 1: Azure Account & Subscription

Create your account, and create a subscription (to pay for the service).

1. Create an account on [azure.microsoft.com](https://azure.microsoft.com/en-us/)
2. Navigate to the [Azure Portal](https://portal.azure.com/)
2. Go to the [Azure Portal](https://portal.azure.com/)
3. Click on **Create a resource** in the top left corner
4. Search for **Subscription** and select **[Create Subscription](https://portal.azure.com/#create/Microsoft.Subscription)**
- fill in the required fields and click on **create**
- write down the **Subscription ID** (e.g. `12345678-1234-1234-1234-123456789012`)
- Fill in the required fields and click on **Create**
- Note down the **Subscription ID** (e.g., `12345678-1234-1234-1234-123456789012`)

### Step 2: Apply for Azure OpenAI Service

We'll now be creating "OpenAI"-specific resources on Azure. This requires to 'apply',
and acceptance should be quick (even as low as minutes)
and acceptance should be quick (even as low as minutes).

1. Go to [Azure OpenAI Service](https://aka.ms/azure-openai)
1. Visit [Azure OpenAI Service](https://aka.ms/azure-openai)
2. Click on **Apply for access**
- Fill in the required fields (including the subscription ID) and click on **Apply**

Once accepted you can now create OpenAI resources on Azure
Once your application is accepted, you can create OpenAI resources on Azure.

### Step 3: Azure OpenAI Resource
### Step 3: Create Azure OpenAI Resource

For more help, see [Azure: Create and deploy OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal)
For more information, see [Azure: Create and deploy OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal)

1. Click on **Create a resource** in the top left corner
2. Search for **OpenAI** and select **[Create OpenAI](https://portal.azure.com/#create/Microsoft.CognitiveServicesOpenAI)**
3. This will take you to the **Create OpenAI** page
3. Fill in the necessary fields on the **Create OpenAI** page
![Creating an OpenAI service](pixels/config-azure-openai-create.png)
- Select the subscription
- Select the a resource group, or quickly create one from this page
- Select the region:
> Note: The region is important, as it will determine the models available to you. **Canada East** has GPT-4-32k models, for instance.
> For the full list, see [Azure > OpenAI > Models > GPT-4 models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
- Select a name for the service (e.g. `your-openai-api-1234`)
- Select a pricing tier (e.g. `S0` is standard)
- Select a resource group or create a new one
- Select the region. Note that the region determines the available models.
> For instance, **Canada East** offers GPT-4-32k models, For the full list, see [GPT-4 models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
- Name the service (e.g., `your-openai-api-1234`)
- Select a pricing tier (e.g., `S0` for standard)
- Select: "All networks, including the internet, can access this resource."
- Click on **Review + create** and then **Create** (no need to configure anything else)
- Click on **Review + create** and then **Create**

API Keys and Endpoints are available after resource creation
After creating the resource, you can access the API Keys and Endpoints. At any point, you can go to
the OpenAI Service instance page to get this information.

1. Click on **Go to resource**
2. Click on **Develop**
- Copy the _Endpoint_, under "Language API", e.g. 'https://your-openai-api-1234.openai.azure.com/'
- Copy the _KEY 1_
- Click on **Go to resource**
- Click on **Develop**
- Copy the `Endpoint`, called "Language API", e.g. 'https://your-openai-api-1234.openai.azure.com/'
- Copy `KEY 1`

### Step 4: Deploy Models

In the OpenAI resource instance, models are not available by default. You need to pick and
choose using an operation called "deploy" (which doesn't seem related to devops deployments,
as it is instant).
By default, Azure OpenAI resource instances don't have models available. You need to deploy the models you want to use.

1. Click on **Model Deployments > Manage Deployments**
2. Click on **+Create New Deployment** for how many models you want to make available
2. Click on **+Create New Deployment**
![Deploying a model](pixels/config-azure-openai-deploy.png)
3. Select the model you want to deploy
- Select the model you want to deploy
- Optionally select a version
- name the model, e.g., `gpt4-32k-0613`

Repeat as necessary for each model you want to deploy.

## See Also
## Resources

- [Azure OpenAI Service Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/)
- [Guide: Create an Azure OpenAI Resource](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal)
- [Azure OpenAI Models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
- [Azure OpenAI Models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)

1 comment on commit cdaf972

@vercel
Copy link

@vercel vercel bot commented on cdaf972 Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

big-agi-git-main-enricoros.vercel.app
get.big-agi.com
big-agi-enricoros.vercel.app

Please sign in to comment.