Skip to content

Commit 477544d

Browse files
update bicep and readme to remove deployment name (#9)
* change bicep files and readme to use AZURE_AI_AGENT_MODEL_NAME instead of AZURE_AI_CHAT_MODEL_NAME * update bicep files to remove references to AZURE_AI_CHAT_DEPLOYMENT_NAME and have the deployment names default to the model name * add Quota Recommendations section to the readme
1 parent ea684a9 commit 477544d

File tree

11 files changed

+62
-89
lines changed

11 files changed

+62
-89
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ Make sure the following tools are installed:
3030
2. [Python 3.9+](https://www.python.org/downloads/)
3131
3. [Git](https://git-scm.com/downloads)
3232

33+
#### Quota Recommendations (Optional)
34+
35+
The default for the model capacity in deployment is 50k tokens. For optimal performance, it is recommended to increase to 100k tokens. You can change the capacity by following the steps in [setting capacity and deployment SKU](docs/deploy_customization.md#customizing-model-deployments).
36+
37+
* Navigate to the [Azure AI Foundry Portal](https://ai.azure.com/)
38+
* Select the AI Project you are using for this template if you are not already in the project.
39+
* Select Management center from the bottom left navigation menu
40+
* Select Quota, click the GlobalStandard dropdown and select the model and region you are using for this accelerator to see your available quota. Please note GPT-4o mini and text-embedding-ada-002 are used as default.
41+
* Request more quota or delete any unused model deployments as needed.
3342

3443
#### Bringing an existing AI project resource
3544

@@ -86,14 +95,12 @@ At this point you could make changes to the code if required. However, no change
8695

8796
#### Configure your Agent (optional)
8897
<!-- TODO where do we want this? probably after downloading the code -->
89-
For options on customizing the deployment to disable resources, change resource names, or customize the models, you can follow these steps in [deployment customizations](docs/deploy_customization.md) now.
90-
91-
If you want to personalize your agent, you can change the default configuration for your agent. This can include changing the model, adding tools, and uploading files to the agent. More information can be found in [Customizing Model Deployments](docs/deploy_customization.md#customizing-model-deployments).
98+
If you want to personalize your agent, you can change the default configuration for your agent. This can include changing the model, adding tools, and uploading files to the agent. For more information on the Azure OpenAI models and non-Microsoft models that can be used in your deployment, view the [list of models supported by Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/concepts/model-region-support).
9299

93-
To change the model, set the following environment variables:
100+
To specify the model (e.g. gpt-4o-mini, gpt-4o) that is deployed for the agent when `azd up` is called, set the following environment variables:
94101
```shell
95-
azd env set AZURE_AI_CHAT_DEPLOYMENT_NAME <MODEL_DEPLOYMENT_NAME>
96-
azd env set AZURE_AI_CHAT_MODEL_NAME <MODEL_DEPLOYMENT_NAME>
102+
azd env set AZURE_AI_AGENT_MODEL_NAME <MODEL_NAME>
103+
azd env set AZURE_AI_AGENT_MODEL_VERSION <MODEL_VERSION>
97104
```
98105
To add tools, update the `agents.yaml` file located in the repository.
99106
```python

azure.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ pipeline:
4242
- USE_CONTAINER_REGISTRY
4343
- USE_APPLICATION_INSIGHTS
4444
- USE_SEARCH_SERVICE
45-
- AZURE_AI_CHAT_DEPLOYMENT_NAME
46-
- AZURE_AI_CHAT_DEPLOYMENT_SKU
47-
- AZURE_AI_CHAT_DEPLOYMENT_CAPACITY
48-
- AZURE_AI_CHAT_MODEL_NAME
49-
- AZURE_AI_CHAT_MODEL_FORMAT
50-
- AZURE_AI_CHAT_MODEL_VERSION
45+
- AZURE_AI_AGENT_DEPLOYMENT_NAME
46+
- AZURE_AI_AGENT_DEPLOYMENT_SKU
47+
- AZURE_AI_AGENT_DEPLOYMENT_CAPACITY
48+
- AZURE_AI_AGENT_MODEL_NAME
49+
- AZURE_AI_AGENT_MODEL_FORMAT
50+
- AZURE_AI_AGENT_MODEL_VERSION
5151
- AZURE_AI_EMBED_DEPLOYMENT_NAME
5252
- AZURE_AI_EMBED_DEPLOYMENT_SKU
5353
- AZURE_AI_EMBED_DEPLOYMENT_CAPACITY

docs/deploy_customization.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,38 @@ To customize the model deployments, you can set the following environment variab
4343

4444
### Using a different chat model
4545

46-
Change the chat deployment name:
46+
Change the agent model format (either OpenAI or Microsoft):
4747

4848
```shell
49-
azd env set AZURE_AI_CHAT_DEPLOYMENT_NAME Phi-3.5-MoE-instruct
49+
azd env set AZURE_AI_AGENT_MODEL_FORMAT Microsoft
5050
```
5151

52-
Change the chat model format (either OpenAI or Microsoft):
52+
Change the agent model name:
5353

5454
```shell
55-
azd env set AZURE_AI_CHAT_MODEL_FORMAT Microsoft
55+
azd env set AZURE_AI_AGENT_MODEL_NAME gpt-4o-mini
5656
```
5757

58-
Change the chat model name:
58+
Set the version of the agent model:
5959

6060
```shell
61-
azd env set AZURE_AI_CHAT_MODEL_NAME Phi-3.5-MoE-instruct
62-
```
63-
64-
Set the version of the chat model:
65-
66-
```shell
67-
azd env set AZURE_AI_CHAT_MODEL_VERSION 2
61+
azd env set AZURE_AI_AGENT_MODEL_VERSION 2024-07-18
6862
```
6963

7064
### Setting capacity and deployment SKU
7165

7266
For quota regions, you may find yourself needing to modify the default capacity and deployment SKU. The default tokens per minute deployed in this template is 50,000.
7367

74-
Change the capacity (in thousands of tokens per minute) of the chat deployment:
68+
Change the capacity (in thousands of tokens per minute) of the agent deployment:
7569

7670
```shell
77-
azd env set AZURE_AI_CHAT_DEPLOYMENT_CAPACITY 50
71+
azd env set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY 50
7872
```
7973

80-
Change the SKU of the chat deployment:
74+
Change the SKU of the agent deployment:
8175

8276
```shell
83-
azd env set AZURE_AI_CHAT_DEPLOYMENT_SKU Standard
77+
azd env set AZURE_AI_AGENT_DEPLOYMENT_SKU Standard
8478
```
8579

8680
Change the capacity (in thousands of tokens per minute) of the embeddings deployment:

infra/api.bicep

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param containerRegistryName string
88
param serviceName string = 'api'
99
param exists bool
1010
param projectConnectionString string
11-
param chatDeploymentName string
11+
param agentDeploymentName string
1212

1313
resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
1414
name: identityName
@@ -25,8 +25,8 @@ var env = [
2525
value: projectConnectionString
2626
}
2727
{
28-
name: 'AZURE_AI_CHAT_DEPLOYMENT_NAME'
29-
value: chatDeploymentName
28+
name: 'AZURE_AI_AGENT_DEPLOYMENT_NAME'
29+
value: agentDeploymentName
3030
}
3131
{
3232
name: 'RUNNING_IN_PRODUCTION'

infra/core/ai/hub.bicep

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ param containerRegistryId string = ''
1414
param aiServicesName string
1515
@description('The AI Services connection name to use for the AI Foundry Hub Resource')
1616
param aiServicesConnectionName string
17-
// @description('The AI Services Content Safety connection name to use for the AI Foundry Hub Resource')
18-
// param aiServicesContentSafetyConnectionName string
1917
@description('The Azure Cognitive Search service name to use for the AI Foundry Hub Resource')
2018
param aiSearchName string = ''
2119
@description('The Azure Cognitive Search service connection name to use for the AI Foundry Hub Resource')
@@ -78,24 +76,6 @@ resource hub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' =
7876
}
7977
}
8078

81-
// resource contentSafetyConnection 'connections' = {
82-
// name: aiServicesContentSafetyConnectionName
83-
// properties: {
84-
// category: 'AzureOpenAI'
85-
// authType: 'ApiKey'
86-
// isSharedToAll: true
87-
// target: aiService.properties.endpoints['Content Safety']
88-
// metadata: {
89-
// ApiVersion: '2023-07-01-preview'
90-
// ApiType: 'azure'
91-
// ResourceId: aiService.id
92-
// }
93-
// credentials: {
94-
// key: aiService.listKeys().key1
95-
// }
96-
// }
97-
// }
98-
9979
resource searchConnection 'connections' =
10080
if (!empty(aiSearchName)) {
10181
name: aiSearchConnectionName

infra/core/host/ai-environment.bicep

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ param aiServicesName string
1616
param aiServicesConnectionName string
1717
@description('The AI Services model deployments.')
1818
param aiServiceModelDeployments array = []
19-
// @description('The AI Services content safety connection name.')
20-
// param aiServicesContentSafetyConnectionName string
2119
@description('The Log Analytics resource name.')
2220
param logAnalyticsName string = ''
2321
@description('The Application Insights resource name.')
@@ -59,7 +57,6 @@ module hub '../ai/hub.bicep' = {
5957
applicationInsightsId: hubDependencies.outputs.applicationInsightsId
6058
aiServicesName: hubDependencies.outputs.aiServicesName
6159
aiServicesConnectionName: aiServicesConnectionName
62-
// aiServicesContentSafetyConnectionName: aiServicesContentSafetyConnectionName
6360
aiSearchName: hubDependencies.outputs.searchServiceName
6461
aiSearchConnectionName: searchConnectionName
6562
}

infra/main.bicep

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ param applicationInsightsName string = ''
5454
param aiServicesName string = ''
5555
@description('The AI Services connection name. If ommited will use a default value')
5656
param aiServicesConnectionName string = ''
57-
// @description('The AI Services content safety connection name. If ommited will use a default value')
58-
// param aiServicesContentSafetyConnectionName string = ''
5957
@description('The Azure Container Registry resource name. If ommited will be generated')
6058
param containerRegistryName string = ''
6159
@description('The Azure Key Vault resource name. If ommited will be generated')
@@ -74,25 +72,25 @@ param principalId string = ''
7472
// Chat completion model
7573
@description('Format of the chat model to deploy')
7674
@allowed(['Microsoft', 'OpenAI'])
77-
param chatModelFormat string
75+
param agentModelFormat string
7876

7977
@description('Name of the chat model to deploy')
80-
param chatModelName string
78+
param agentModelName string
8179
@description('Name of the model deployment')
82-
param chatDeploymentName string
80+
param agentDeploymentName string
8381

8482
@description('Version of the chat model to deploy')
8583
// See version availability in this table:
8684
// https://learn.microsoft.com/azure/ai-services/openai/concepts/models#global-standard-model-availability
87-
param chatModelVersion string
85+
param agentModelVersion string
8886

8987
@description('Sku of the chat deployment')
90-
param chatDeploymentSku string
88+
param agentDeploymentSku string
9189

9290
@description('Capacity of the chat deployment')
9391
// You can increase this, but capacity is limited per model/region, so you will get errors if you go over
9492
// https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits
95-
param chatDeploymentCapacity int
93+
param agentDeploymentCapacity int
9694

9795
// Embedding model
9896
@description('Format of the embedding model to deploy')
@@ -129,15 +127,15 @@ var tags = { 'azd-env-name': environmentName }
129127

130128
var aiDeployments = [
131129
{
132-
name: chatDeploymentName
130+
name: agentDeploymentName
133131
model: {
134-
format: chatModelFormat
135-
name: chatModelName
136-
version: chatModelVersion
132+
format: agentModelFormat
133+
name: agentModelName
134+
version: agentModelVersion
137135
}
138136
sku: {
139-
name: chatDeploymentSku
140-
capacity: chatDeploymentCapacity
137+
name: agentDeploymentSku
138+
capacity: agentDeploymentCapacity
141139
}
142140
}
143141
{
@@ -188,9 +186,6 @@ module ai 'core/host/ai-environment.bicep' = if (empty(aiExistingProjectConnecti
188186
: '${abbrs.storageStorageAccounts}${resourceToken}'
189187
aiServicesName: !empty(aiServicesName) ? aiServicesName : 'aoai-${resourceToken}'
190188
aiServicesConnectionName: !empty(aiServicesConnectionName) ? aiServicesConnectionName : 'aoai-${resourceToken}'
191-
// aiServicesContentSafetyConnectionName: !empty(aiServicesContentSafetyConnectionName)
192-
// ? aiServicesContentSafetyConnectionName
193-
// : 'aoai-content-safety-connection'
194189
aiServiceModelDeployments: aiDeployments
195190
logAnalyticsName: logAnalyticsWorkspaceResolvedName
196191
applicationInsightsName: !useApplicationInsights
@@ -333,7 +328,7 @@ module api 'api.bicep' = {
333328
containerAppsEnvironmentName: containerApps.outputs.environmentName
334329
containerRegistryName: containerApps.outputs.registryName
335330
projectConnectionString: projectConnectionString
336-
chatDeploymentName: chatDeploymentName
331+
agentDeploymentName: agentDeploymentName
337332
exists: apiAppExists
338333
}
339334
}
@@ -343,7 +338,7 @@ output AZURE_RESOURCE_GROUP string = rg.name
343338
// Outputs required for local development server
344339
output AZURE_TENANT_ID string = tenant().tenantId
345340
output AZURE_AIPROJECT_CONNECTION_STRING string = projectConnectionString
346-
output AZURE_AI_CHAT_DEPLOYMENT_NAME string = chatDeploymentName
341+
output AZURE_AI_AGENT_DEPLOYMENT_NAME string = agentDeploymentName
347342

348343
// Outputs required by azd for ACA
349344
output AZURE_CONTAINER_ENVIRONMENT_NAME string = containerApps.outputs.environmentName

infra/main.parameters.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@
5050
"useSearchService": {
5151
"value": "${USE_SEARCH_SERVICE=true}"
5252
},
53-
"chatDeploymentName": {
54-
"value": "${AZURE_AI_CHAT_DEPLOYMENT_NAME=gpt-4o-mini}"
53+
"agentDeploymentName": {
54+
"value": "${AZURE_AI_DEPLOYMENT_NAME=${AZURE_AI_AGENT_MODEL_NAME=gpt-4o-mini}}"
5555
},
56-
"chatModelFormat": {
57-
"value": "${AZURE_AI_CHAT_MODEL_FORMAT=OpenAI}"
56+
"agentModelFormat": {
57+
"value": "${AZURE_AI_AGENT_MODEL_FORMAT=OpenAI}"
5858
},
59-
"chatModelName": {
60-
"value": "${AZURE_AI_CHAT_MODEL_NAME=gpt-4o-mini}"
59+
"agentModelName": {
60+
"value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-4o-mini}"
6161
},
62-
"chatModelVersion": {
63-
"value": "${AZURE_AI_CHAT_MODEL_VERSION=2024-07-18}"
62+
"agentModelVersion": {
63+
"value": "${AZURE_AI_AGENT_MODEL_VERSION=2024-07-18}"
6464
},
65-
"chatDeploymentSku": {
66-
"value": "${AZURE_AI_CHAT_DEPLOYMENT_SKU=GlobalStandard}"
65+
"agentDeploymentSku": {
66+
"value": "${AZURE_AI_AGENT_DEPLOYMENT_SKU=GlobalStandard}"
6767
},
68-
"chatDeploymentCapacity": {
69-
"value": "${AZURE_AI_CHAT_DEPLOYMENT_CAPACITY=50}"
68+
"agentDeploymentCapacity": {
69+
"value": "${AZURE_AI_AGENT_DEPLOYMENT_CAPACITY=50}"
7070
},
7171
"embedDeploymentName": {
7272
"value": "${AZURE_AI_EMBED_DEPLOYMENT_NAME=text-embedding-ada-002}"

scripts/write_env.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Set-Content -Path $envFilePath -Value ""
66

77
# Append new values to the .env file
88
$azureAiProjectConnectionString = azd env get-value AZURE_AIPROJECT_CONNECTION_STRING
9-
$azureAiChatDeploymentName = azd env get-value AZURE_AI_CHAT_DEPLOYMENT_NAME
9+
$azureAiagentDeploymentName = azd env get-value AZURE_AI_AGENT_DEPLOYMENT_NAME
1010
$azureAiAgentId = azd env get-value AZURE_AI_AGENT_ID
1111
$azureTenantId = azd env get-value AZURE_TENANT_ID
1212

1313
Add-Content -Path $envFilePath -Value "AZURE_AIPROJECT_CONNECTION_STRING=$azureAiProjectConnectionString"
14-
Add-Content -Path $envFilePath -Value "AZURE_AI_CHAT_DEPLOYMENT_NAME=$azureAiChatDeploymentName"
14+
Add-Content -Path $envFilePath -Value "AZURE_AI_AGENT_DEPLOYMENT_NAME=$azureAiagentDeploymentName"
1515
Add-Content -Path $envFilePath -Value "AZURE_AI_AGENT_ID=$azureAiAgentId"
1616
Add-Content -Path $envFilePath -Value "AZURE_TENANT_ID=$azureTenantId"

scripts/write_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ ENV_FILE_PATH="src/.env"
77
> $ENV_FILE_PATH
88

99
echo "AZURE_AIPROJECT_CONNECTION_STRING=$(azd env get-value AZURE_AIPROJECT_CONNECTION_STRING)" >> $ENV_FILE_PATH
10-
echo "AZURE_AI_CHAT_DEPLOYMENT_NAME=$(azd env get-value AZURE_AI_CHAT_DEPLOYMENT_NAME)" >> $ENV_FILE_PATH
10+
echo "AZURE_AI_AGENT_DEPLOYMENT_NAME=$(azd env get-value AZURE_AI_AGENT_DEPLOYMENT_NAME)" >> $ENV_FILE_PATH
1111
echo "AZURE_AI_AGENT_ID=$(azd env get-value AZURE_AI_AGENT_ID)" >> $ENV_FILE_PATH
1212
echo "AZURE_TENANT_ID=$(azd env get-value AZURE_TENANT_ID)" >> $ENV_FILE_PATH

0 commit comments

Comments
 (0)