Build for a Friend: a local-first meal planner on open-weight Gemma
Description and use
A local‑first meal planner that runs entirely on a laptop, using the open‑weight Gemma 3 1B model via Ollama. It generates a 7‑day Indian meal plan with grocery list and budget check, enforces allergy safety with a deterministic guardrail, and operates offline without cloud dependencies.
Problem
Providing a high-protein vegetarian meal plan on a ₹2000/week budget while avoiding peanuts and lactose, without relying on cloud services or API keys.
Outcome
The app delivers a 7‑day meal plan within ~40s on CPU, keeps all health data local, works offline, and is free forever.
Workflow
- 1. Install Ollama and pull gemma3:1b model
- 2. Run python3 app.py
- 3. Open http://localhost:8000 in browser
- 4. Enter friend’s profile (diet, allergies, dislikes, budget)
- 5. Receive streamed meal plan token by token
- 6. Review Allergy Check section for flagged dishes
- 7. Adjust plan if needed
Evidence
My roommate Nagaraj needed high-protein vegetarian food on a ₹2000/week budget — while strictly avoiding peanuts and lactose.
Friend Meal Planner — a web app (vanilla HTML/JS + a zero-dependency Python server, stdlib only) that generates a 7-day Indian meal plan with a grocery list and budget check.
run python3 app.py and open http://localhost:8000 (needs Ollama + gemma3:1b pulled; ~40s per plan on CPU)
Testing caught something important: the 1B model kept suggesting paneer and yogurt to my lactose-allergic friend, despite explicit instructions.
I added a deterministic allergy guardrail — every plan is scanned line-by-line against an allergen keyword map and an ⚠️ Allergy Check section is appended flagging risky dishes for review.
- Record date: 2026-10-05T04:55:55.280Z