DEV Community

Jerita D
Jerita D

Posted on

Week 4

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Recipe Heirloom is a small web app that preserves family recipes the way they were really passed down.

Most of the recipes we inherit were never written down. They were said out loud: "a handful of rice, cook till it smells sweet." Recipe Heirloom takes a recipe told that way, plus the name of the person who taught it, and turns it into a clear recipe with a title, a short story, ingredients with estimated measurements, numbered steps, and notes about what to look, smell, or taste for. Every estimate is marked with a ~ so nothing is passed off as exact. Finished recipes go into a "family cookbook" that you can download.

For the theme, I skipped the ghosts and took the Día de los Muertos side of it. The people who taught us to cook are still present every time we make their dish, and an ofrenda is really a way to keep someone's tastes and stories alive. I wanted a tool that catches those recipes before they're forgotten.

Demo

Image of the working of my app

Code

GitHub logo Jeri20 / Hacktober_week4

Hacktober_week4 submission

Recipe Heirloom

Tell a family recipe the way someone actually told it ("a handful of this, cook till it smells right") and an open-weight model turns it into clear steps with measurements, keeping the story behind it.

Built for the Hacktoberfest Open-Source AI Challenge, Week 4: Ghost in the Machine (honoring the past, in the spirit of Día de los Muertos).

Files

  • app.py is the whole app: a Flask server with the HTML page embedded
  • requirements.txt lists flask and openai

Run locally (fully offline, with Ollama)

ollama pull llama3.2
pip install -r requirements.txt
python app.py

Open http://localhost:5000. No env vars needed.

Deploy on Vercel

  1. Put these three files in a GitHub repo.
  2. In Vercel, choose "Add New Project" and import the repo. Vercel detects the Flask app in app.py automatically.
  3. Under Settings, Environment Variables, add:
Name Example value
BASE_URL https://api.groq.com/openai/v1
API_KEY your key from that host
MODEL llama-3.3-70b-versatile

Any…

The whole app is one file, app.py, which holds the Flask server and the HTML page. A requirements.txt lists flask and openai.

How I Built It

  • Serving: the app talks to the model through the standard openai Python client pointed at any OpenAI-compatible endpoint. That means one code path supports both hosted open-model providers and local inference with Ollama.
  • Backend: Flask, with a single /api/heirloom route. A system prompt tells the model to act as a careful family-recipe archivist, never invent ingredients, mark estimated amounts with ~, and keep the speaker's voice in the story. The model replies in JSON, and the server has fallbacks for hosts without JSON mode and for models that wrap the JSON in extra text.
  • Frontend: plain HTML, CSS, and JavaScript with no framework. Recipes are saved in the browser's localStorage, with a button to download the whole cookbook as JSON.
  • Hosting: Vercel, with the model host, key, and model name set through environment variables (BASE_URL, API_KEY, MODEL).

Why Does Open Innovation Matter?

A family recipe is personal data. It carries a grandmother's name, her habits, and the memories attached to the dish. Open-weight models changed how I could build this:

  • Swappable: the model is just a configuration value. If a host raises prices or removes a model, I change one environment variable and keep going. The app doesn't depend on any single company's API.
  • Private when you want it: the same code runs entirely on a laptop with Ollama, with no internet and nothing leaving the machine. For something as personal as a family's recipes, that option matters.
  • Free to run: locally the cost is zero, and hosted open models are cheap enough that a hobby project never has to worry about it.
  • Built to last: a recipe collection is meant to outlive any one service. Because the model, the code, and the cookbook file are all open and portable, the project can't be locked inside a platform that might disappear.

One honest trade-off: the Vercel version calls a hosted open model, so it needs the internet. I kept the fully offline path in the same code, and I think that flexibility is the real advantage of the open approach.

Top comments (0)