Build for a Friend: a local-first meal planner on open-weight Gemma
DEV Community

Build for a Friend: a local-first meal planner on open-weight Gemma

The Problem

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.

What I Built

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.

Who It's For

Nagaraj, 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).

Why Open Matters Here

Open-weight AI is what makes this project possible, not just cheaper:

  • Health data stays home. Allergies and eating habits are sensitive. With a local open-weight model, none of it touches a server anyone else controls - a closed API would mean shipping my friend's health profile to a third party on every generation.
  • Works offline. Hostel Wi-Fi dies constantly; the planner doesn't care.
  • Free forever. No per-token billing against a student budget.
  • Swappable. Gemma 3 1B today, something bigger tomorrow via one env var - no vendor lock-in.

The Honest Part: Small Models Slip, So I Built a Guardrail

Testing 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.

This also enters the Best Use of Gemma category - the whole app is Gemma-powered, running the open-weight gemma3:1b model locally through Ollama.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.