This application transcribes a YouTube cooking video and uses OpenAI's GPT-3 model to summarize the transcript into a recipe.
Try it at https://videorecipegen.com/
- Transcribes YouTube cooking videos into text.
- Summarizes the transcription into a recipe using OpenAI's GPT model.
- Formats the response into a recipe card.
- Limits the number of requests per user to prevent abuse.
- Flask: Used to serve the application.
- Redis: Used to store the number of requests per user.
- Pico CSS: A minimalistic CSS framework.
- HTMX: Used to provide dynamic HTML content.
- Kubernetes (EKS): Application and Redis are currently run in EKS, installed via the helm chart
- Clone the repository.
- Install the dependencies with
pip install -r requirements.txt
. - Run a redis docker container with
docker run --name my-redis -p 6379:6379 -d redis
. - Create a .env file with your
OPENAI_API_KEY
andYOUTUBE_API_KEY
values, you may also optionally set environment variables for the Redis, request limit and max video length settings. - Run the application from the /flask directory with
flask --app main run
.
- Submit a YouTube cooking video URL.
- The application will transcribe the video and generate a recipe.
- If the video is not a cooking video or is greater than the
MAX_VIDEO_DURATION
, an error message will be displayed.
- The application limits the number of requests to 5 per user per day. This is done using the IP address of the user.
- The application limits the duration of the video to 45 minutes. This is to prevent inputs greater than the models max tokens.
- The accuracy of the recipe depends on the quality of the video transcription and the performance of the GPT-3 model.
CI Actions can be found at ./github/workflows/
.
Container images are automatically built on pushes to main
.
Linting/Formatting is automatically ran on every push, using ruff
CD automation is WIP, currently deployed via helm chart into EKS. Migrating to ArgoCD GitOps running on a homelab K8s cluster.
Building out the testing coverage.
Tests can be run with pytest from the root directory using the command pytest --envfile flask/.env
to set up the env.