{"slug": "build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma", "title": "Build for a Friend: a local-first meal planner on open-weight Gemma", "summary": "A developer built Friend Meal Planner, a local-first web app that uses the open-weight gemma3:1b model via Ollama to generate 7-day Indian meal plans with grocery lists and budget checks for a lactose-intolerant, peanut-allergic roommate on a ₹2000/week budget. Testing revealed the 1B model repeatedly suggested paneer and yogurt despite explicit allergy instructions, so the developer added a deterministic allergy guardrail that scans each plan against an allergen keyword map and appends a flagged Allergy Check section. The app runs entirely offline with a zero-dependency Python server and vanilla HTML/JS, generating a plan in about 40 seconds on CPU.", "body_md": "My roommate Nagaraj needed high-protein vegetarian food on a ₹2000/week budget — while strictly avoiding peanuts and lactose. So for the Build for a Friend theme, I built him a meal planner that runs **entirely on his laptop**: no accounts, no API keys, no cloud.\n\n**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. You fill in your friend's profile — diet, allergies, dislikes, budget — and the plan streams in, token by token.\n\n`python3 app.py` and open `http://localhost:8000` (needs Ollama + `gemma3:1b` pulled; ~40s per plan on CPU)\nNagaraj, my roommate in Bengaluru. Hostel-style cooking, 30-minute recipes, ingredients from local markets, everything priced in ₹. I handed him the first plan — his verdict: *\"now that's cooking\"* (he also immediately asked for a recipe mode and non-veg mode, so that's next).\n\nOpen-weight AI is what makes this project *possible*, not just cheaper:\n\nTesting caught something important: the 1B model kept suggesting paneer and yogurt to my *lactose-allergic* friend, despite explicit instructions. Rather than hide that, I added a **deterministic allergy guardrail** — every plan is scanned line-by-line against an allergen keyword map (lactose → milk, curd, paneer, ghee…) and an ⚠️ Allergy Check section is appended flagging risky dishes for review. Prompt engineering sets the intent; code enforces the safety property. That's the architecture I'd defend: never let a probabilistic model be the last word on food safety.\n\nThis also enters the **Best Use of Gemma** category — the whole app is Gemma-powered, running the open-weight `gemma3:1b` model locally through Ollama.", "url": "https://wpnews.pro/news/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma", "canonical_source": "https://dev.to/sank8/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma-59po", "published_at": "2026-10-05 03:33:46+00:00", "updated_at": "2026-10-05 03:42:56.640079+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "ai-safety", "generative-ai"], "entities": ["Gemma", "Ollama", "gemma3:1b", "Friend Meal Planner", "Nagaraj"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma", "markdown": "https://wpnews.pro/news/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma.md", "text": "https://wpnews.pro/news/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma.txt", "jsonld": "https://wpnews.pro/news/build-for-a-friend-a-local-first-meal-planner-on-open-weight-gemma.jsonld"}}