In this example, we will implement a Retrieval Augmented Generation (RAG) application leveraging Phi3 as SLM, AI Search as vectorDB and Prompt Flow as low-code orchestrator.
- Easy deployment using Docker.
- Scalable architecture for handling AI workflows.
- Low code approach using Prompt Flow
Before you begin, ensure you have met the following requirements:
- Docker installed on your local machine.
- An Azure account with permissions to create and manage container resources.
- An Azure AI Studio and Azure AI Search instances
- An embedding model to create your index (can be either an Azure OpenAI embedding or an OS model from the catalog)
- Python 3.8 or later installed on your local machine.
- An Azure Container Registry (or any registry of your choice)
-
Create a new flow on your Azure AI Studio Project using the flow.yaml file.
-
Deploy a Phi3 Model from your Azure AI model catalog and create the connection to your project. Deploy Phi-3 as a Model as a Service
-
Create the vector index on Azure AI Search using any document of your choice Create a vector index on Azure AI Search
-
Deploy the flow on a managed enpoint and use it in the prompt-flow-frontend.py file. Deploy a flow on an online endpoint
-
Clone the repository:
git clone [[https://github.com/yourusername/prompt-flow-frontend.git](https://github.com/microsoft/Phi-3CookBook.git)](https://github.com/microsoft/Phi-3CookBook.git) cd code/07.Lab/RAG with PromptFlow and AISearch
-
Build the Docker image:
docker build -t prompt-flow-frontend.py .
-
Push the Docker image to Azure Container Registry:
az acr login --name yourregistry docker tag prompt-flow-frontend.py:latest yourregistry.azurecr.io/prompt-flow-frontend.py:latest docker push yourregistry.azurecr.io/prompt-flow-frontend.py:latest
-
Run the Docker container:
docker run -p 8501:8501 yourregistry.azurecr.io/prompt-flow-frontend.py:latest
-
Access the application in your browser at
http://localhost:8501
.
Valentina Alto - Linkedin
Full Article: RAG with Phi-3-Medium as a Model as a Service from Azure Model Catalog