- Install
makeutility if not already installed. - Run
make installto setup a Python virtual environment and install the necessary packages.
- Create an Azure Machine Learning Workspace on Azure portal.
- The example in this repo uses GPT4 with vision-preview and GPT3.5 turbo models.
- Create Azure OpenAI instances in regions where gpt-4, vision preview is available. We can check availability from this link.
- Deploy GPT4 models with model version vision-preview. Please use
gpt-4vas deployment name - Deploy GPT3.5 Turbo model. Please use
gpt-35as deployment name
- Create an Azure Machine Learning compute instance on the Azure portal. For development purposes, you can select the
Standard_DS11_v2CPU instance type. - Create a prompt flow compute instance runtime by selecting the compute instance created in the previous step.
Note: Idle shutdown does not occur on the AML computes which have prompt flow runtimes installed on them. Hence, please ensure to shutdown your compute instances when not in use.
Note: Recently new
GPT4omodel is launched. This model also supports images. Instead of GPT4v we can also use GPT4o model. Please follow similare steps to create connection and update flow.dag.yaml file to use GPT4o model.
Copy the .env-template file as .env and update the values.
- Make sure to login to Azure using
az logincommand - Set default values for Azure
az account set --subscription <my-sub>
az configure --defaults group=<my_resource_group> workspace=<my_workspace>
Install the prompt flow extension for VS Code by following this link.
We need five connections one for GPT4V and another for GPT3.5-turbo.
Please create connection files from the template in keyword_correctness\connections. Replace region with the region of Azure Open AI instance.
You can use the pf cli to create the connections locally. A sample command to create a connection locally is shown below.
pf connection create --file keyword_correctness\connections\aoai_gpt4v_westus.yaml --set api_key=<your_api_key> api_base="https://<azure_openai_resource_name>.openai.azure.com/"Refer here for more details on the connection creation using pf cli
After the connection is created, update the flow.dag.yaml file with the connection name, model name and the deployment name. Keep the deployment name same as the model name for simplicity.
Sample flow.dag.yaml file for GPT3.5T is shown below.
deployment_name: gpt-35-turbo
model: gpt-3.5-turbo
connection: aoai_gpt_35t_connectionFor more details on using the promptflow CLI run the help comand to get a list of all the commands.
pf -h Refer to this repository for more info.
- If you see any errors like
Request Header Fields Too Largein promptflow ui after submitting jobs, please make sure to update the runtime to promptflow latest version. - Please make sure to use the latest version of promptflow pip package.
- Please make sure that connections which are used in
flow.dag.yamlare added in the PromptFlow.