|
| 1 | +# Continuous Monitoring Pipeline |
| 2 | + |
| 3 | +This tutorial describes an advanced use case of [running flows in Azure ML Pipelines](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/run-flow-with-pipeline/pipeline.ipynb). |
| 4 | +The detailed explanations of the prerequisites and principles can be found in the aforementioned article. |
| 5 | +Continuous monitoring is necessary to maintain the quality, performance and efficiency of Generative AI applications. |
| 6 | +These factors directly impact the user experience and operational costs. |
| 7 | + |
| 8 | +We will run evaluations on a basic chatbot flow, then aggregate the results to export and visualize the metrics. |
| 9 | +The flows used in this pipeline are described below: |
| 10 | +- [Basic Chat](https://github.com/microsoft/promptflow/tree/main/examples/flows/chat/chat-basic) |
| 11 | +- [Q&A Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-qna-rag-metrics) |
| 12 | +- [Perceived Intelligence Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-perceived-intelligence) |
| 13 | +- [Summarization Evaluation](https://github.com/microsoft/promptflow/tree/main/examples/flows/evaluation/eval-summarization) |
| 14 | + |
| 15 | +Connections used in this flow: |
| 16 | +- `azure_open_ai_connection` connection (Azure OpenAI). |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +### Prompt flow SDK: |
| 21 | +- Azure cloud setup: |
| 22 | + - An Azure account with an active subscription - [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) |
| 23 | + - Create an Azure ML resource from Azure portal - [Create a Azure ML workspace](https://ms.portal.azure.com/#view/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/searchQuery/machine%20learning) |
| 24 | + - Connect to your workspace then setup a basic computer cluster - [Configure workspace](https://github.com/microsoft/promptflow/blob/main/examples/configuration.ipynb) |
| 25 | +- Local environment setup: |
| 26 | + - A python environment |
| 27 | + - Installed Azure Machine Learning Python SDK v2 - [install instructions](https://github.com/microsoft/promptflow/blob/main/examples/README.md) - check the getting started section and make sure version of 'azure-ai-ml' is higher than `1.12.0` |
| 28 | + |
| 29 | +Note: when using the Prompt flow SDK, it may be useful to also install the [`Prompt flow for VS Code`](https://marketplace.visualstudio.com/items?itemName=prompt-flow.prompt-flow) extension (if using VS Code). |
| 30 | + |
| 31 | +### Azure AI/ML Studio: |
| 32 | +Start a compute session. |
| 33 | +The follow the installation steps described in the notebook. |
| 34 | + |
| 35 | +## Setup connections |
| 36 | +Ensure that you have a connection to Azure OpenAI with the following deployments: |
| 37 | +- `gpt-35-turbo` |
| 38 | +- `gpt-4` |
| 39 | + |
| 40 | +## Run pipeline |
| 41 | + |
| 42 | +Run the notebook's steps until `3.2.2 Submit the job` to start the pipeline in Azure ML Studio. |
| 43 | + |
| 44 | +## Pipeline description |
| 45 | +The first node reads the evaluation dataset. |
| 46 | +The second node is the main flow that will be monitored, it takes the output of the evaluation dataset as a `data` input. |
| 47 | +After the main flow's node has completed, its output will go to 3 nodes: |
| 48 | +- Q&A Evaluation |
| 49 | +- Perceived Intelligence Evaluation |
| 50 | +- Simple Summarization |
| 51 | + |
| 52 | +The Simple Summarization and the main nodes' outputs will become the Summarization Evaluation node's input. |
| 53 | + |
| 54 | +Finally, all the evaluation metrics will be aggregated and displayed in Azure ML Pipeline's interface. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +## Metrics visualization |
| 59 | +In the node `Convert evaluation results to parquet` Metrics tab, the aggregated metrics will be displayed. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +The evolution of the metrics can be monitored by comparing multiple pipeline runs: |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +## Contact |
| 69 | +Please reach out to Lou Bigard ( <[email protected]>) with any issues. |
0 commit comments