-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
60 lines (55 loc) · 1.99 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '3'
env:
RG: my_open_ai_rg
LOCATION: eastus
AI_RESOURCE_NAME: MyOpenAIResource
dotenv: ['.env']
tasks:
azure_auth:
desc: "Authenticate to Azure using Azure CLI"
cmds:
- az login
silent: false
create_resource_group:
desc: "Create a resource group ${RG} in $LOCATION"
cmds:
- az group create --name $RG --location $LOCATION
silent: false
deploy_open_ai:
desc: "Deploy Open AI"
cmds:
- az cognitiveservices account create -n $AI_RESOURCE_NAME -g $RG -l $LOCATION --kind OpenAI --sku s0 --subscription $AZURE_SUBSCRIPTION_ID
silent: false
deploy_gtp4o:
desc: "Deploy GPT4o"
cmds:
- az cognitiveservices account deployment create -n $AI_RESOURCE_NAME -g $RG --deployment-name gpt4o --model-name gpt-4o --model-version 2024-05-13 --model-format OpenAI --sku-name "Standard" --sku-capacity 1
silent: false
deploy_dalle3:
desc: "Deploy DALLE-3"
cmds:
- az cognitiveservices account deployment create -n $AI_RESOURCE_NAME -g $RG --deployment-name dall-e-3 --model-name dall-e-3 --model-version 3.0 --model-format OpenAI --sku-name "Standard" --sku-capacity 1
silent: false
list_deployments:
desc: "List deployments"
cmds:
- az cognitiveservices account deployment list -n $AI_RESOURCE_NAME -g $RG -o table
silent: false
deploy_all:
desc: "Deploy all"
cmds:
- task: create_resource_group
- task: deploy_open_ai
- task: deploy_gtp4o
- task: deploy_dalle3
silent: false
clean_up:
desc: "Clean up"
cmds:
- az cognitiveservices account delete -n $AI_RESOURCE_NAME -g $RG
- az cognitiveservices account purge -n $AI_RESOURCE_NAME -g $RG -l $LOCATION
- az group delete --name $RG --yes
silent: false
query_gpt4o:
cmds:
- curl https://$LOCATION.api.cognitive.microsoft.com/openai/deployments/gpt4o/chat/completions?api-version=2024-02-15-preview -H "Content-Type:application/json" -H "api-key:$YOUR_API_KEY" -d @query1.json