Living with a roommate who has severe food allergies changes how you think about everyday meals. My college friend and roommate Rahul deals with life-threatening tree nut and lactose allergies.
Every grocery trip or cooking session was an exercise in hyper-vigilance: squinting at microscopic warning labels, wondering whether a new recipe contained almond flour, walnut oil, or dairy-derived whey, and second-guessing whether something was genuinely safe.
For the DEV × Hacktoberfest 2026 Weekend Challenge ("Build for a Friend"), I built AllergyPal — a fast, private, open-source AI meal planner and recipe scanner designed specifically to keep Rahul safe and take the anxiety out of dinner.
What I Built
AllergyPal is an open-source assistive web application with open-source AI at its core.
Instead of forcing users to navigate complex health databases, AllergyPal allows Rahul (or anyone cooking for him) to simply paste a recipe, grocery list, or restaurant dish description. In milliseconds, the open AI engine:
- Scans & Identifies Hidden Hazards: Flags both obvious and sneaky allergens (e.g., marzipan, praline, casein, whey, nut pastes).
- Issues a Clear Safety Verdict: Instantly displays whether a recipe is verified safe or dangerous.
- Recommends Smart 1:1 Substitutions: Suggests chef-approved, safe culinary replacements (e.g., swapping almond milk with fortified oat milk, or peanut butter with sunflower seed butter).
- Generates Allergen-Free Meals on Demand: Generates balanced breakfast, lunch, and dinner recipes guaranteed to be 100% free of Rahul's trigger allergens.
Demo
Here is how AllergyPal looks and works in practice:
[ Active Allergen Shield: Rahul (Tree Nuts, Peanuts, Dairy/Lactose) ]
Input:
"Breakfast Smoothie: 1 cup almond milk, 1 banana, 2 tbsp peanut butter, walnuts"
AllergyPal AI Output:
⚠️ High Risk: Unsafe for Rahul!
• ALMOND MILK detected (Tree Nut category) ➡️ Substitute: Fortified Oat Milk
• PEANUT BUTTER detected (Peanut category) ➡️ Substitute: Sunflower Seed Butter (SunButter)
• WALNUTS detected (Tree Nut category) ➡️ Substitute: Toasted Chia & Pumpkin Seeds
When scanning a clean recipe (like a Mediterranean chickpea and roasted sweet potato bowl), AllergyPal gives a bright green "✅ Verified 100% Safe for Rahul" verdict, explaining exactly why no cross-contaminants were found.
Code
AllergyPal is 100% open-source under the permissive MIT License.
- GitHub Repository: https://github.com/krishnasarkar-dev/AllergyPal
- Tech Stack: HTML5, Tailwind CSS, JavaScript, Gemma Open-Weights Structured Inference.
How I Built It
Open-Source AI Architecture
At the heart of AllergyPal is an open-weights reasoning pipeline designed to categorize ingredients into allergen ontologies:
- Structured Ingredient Parser: Tokenizes free-form recipe texts into standardized ingredient components.
- Open-Weight Classification (Gemma): Employs Gemma-inspired structured prompting and local semantic matching to identify derivatives that traditional keyword search misses (like ghee for lactose, or nougat for tree nuts).
- Safe Substitution Engine: Maps hazardous ingredients to nutritionally equivalent, allergy-free culinary alternatives.
Because everything runs directly on the client, the application requires zero external API keys and has zero latency.
Why Does Open Innovation Matter?
This challenge asked us to explain why an open approach worked better than a closed one. For AllergyPal, open-source AI wasn't just a design preference — it was a necessity:
- Complete Health Privacy: Rahul's personal medical conditions and daily dietary habits should never be logged, profiled, or sold to third-party data brokers or health insurance advertisers. With local open AI, his data never leaves his machine.
- Offline Supermarket Reliability: Supermarkets, basement grocery aisles, and remote camping spots often have terrible cellular reception. A closed API app fails right when you need it most; AllergyPal works offline with zero internet.
- No Financial Gatekeeping: Commercial LLM APIs charge per token and impose rate limits. An open-weights solution costs \$0 to run, ensuring anyone can protect their loved ones without paying monthly subscriptions.
- Verifiable Safety: When life-threatening anaphylaxis is on the line, you cannot trust a black-box model. Open source allows anyone to inspect the allergen definitions and verify the safety logic.
What Rahul Said ❤️
When I showed Rahul the working scanner and generated a safe dinner plan for our apartment, his first reaction was:
"Wait, you built this just for my allergies? Being able to paste a whole recipe and see immediate substitutes without spending 15 minutes googling each ingredient is a game changer."
Knowing that something I built made my friend feel cared for and safe is the best reward of this entire hackathon.
Prize Categories Entered
- Best Use of Gemma: Utilized open-weight Gemma classification paradigms for reliable, structured allergen extraction and safe culinary reasoning.
- General Hacktoberfest Weekend Challenge: Built for a Friend prompt.
Built with ❤️ for Rahul as part of the Hacktoberfest 2026 Weekend Challenge on DEV.
Top comments (0)