Illness to Nutrition Web Service Link
The goal of this project is to build a publicly accessible auto-scaling container using Azure App Services and Flask. This is an easy way to build and deploy a scaleable web-hosted.
This service take the input of an illness that useres give and return the nutrient they need for their body. It is a Flask web application integrated with OpenAI's LLM model, utilizing Docker for effective containerization.
Workflows:
- User Input: Users input illness into the application.
- Search: The application processes the inputted illness and searches for nutrients needed for this illness.
- Output: The nutrients needed for this illness is listed.
Take Input:
Return Outputs:
- Flask Web Application:
- Functionality: The web app allows users to input prompts, which are then processed by the GPT-3.5 model to generate responses. The responses are displayed on a results page.
- The web app (main.py) incorporates routes for the index page and the result page. User can input illness.
- HTML Templates: The project contains HTML templates (index.html and result.html) providing a user-friendly interface.
- Functionality: The web app allows users to input prompts, which are then processed by the GPT-3.5 model to generate responses. The responses are displayed on a results page.
- Open AI LLM Model Integration:
- API Interaction: The application interfaces with the Open AI LLM Model via API calls. It sends a the user input of nutrients to get predictions.
- Docker Containerization: Dockerfile:
- This Dockerfile containerizes a Flask app, setting up a Docker container with Python and Gunicorn to run the web application. It encapsulates the app's code and dependencies, simplifying deployment across different environments.
Azure has its own docker. The web service is deployed on Azure
- Azure Container Registry:
- Azure Container Apps Deployment:
- Azure Docker Image:
- git clone the repo
- install:
make install - get access to user token via GPT
- create an env file and add user token
- run:
python main.pyand navigate to the locally hosted website - upload image or use default image
- build docker image:
docker build --tag <insert image name>. - login to azure cli:
az login - deploy azuer web app:
az containerapp up --resource-group <insert resource group> --name <insert app name> --ingress external --target-port 50505 --source. - view app via
conatiner appsand docker image viacontainer regsitryin azure web portal
- Format code
make format - Lint code
make lint - Test coce
make test
- https://github.com/nogibjj/python-ruff-template
- https://learn.microsoft.com/en-us/azure/developer/python/tutorial-containerize-simple-web-app?tabs=web-app-flask
- https://learn.microsoft.com/en-us/azure/container-apps/scale-app?pivots=azure-cli
- https://github.com/Azure-Samples/msdocs-python-flask-webapp-quickstart