Skip to main content
Home / Portfolio / Kitchen Coach
Personal Systems

Kitchen Coach

Learn to cook by doing, with diet rules checked in code, not in prompts

Built by Rogue AI · Cooking practice + diet-aware planning · Self-hosted for a household

Started on 19 October 2026 as a cook-along and recipe app for a two-person household. Meal planning, meal prep, shopping and stock came in the first week, freezer sauces and a faster food log by late October. In November the focus moved to sauces: a Sauce School, a sauce rule enforced in code across the whole library, and practice tracking. Pictures moved to FLUX.2 klein on 11 November.

Kitchen Coach, Learn to cook by doing, with diet rules checked in code, not in prompts

The problem

Recipe apps assume you already cook, and meal planners treat diet rules as a filter on a search. In a household with two different sets of food rules, aversions and targets, the hard part is a week of meals that fits both people, a shopping list that respects each person's avoid list, and actually learning to turn what is left in the pan into a sauce. An LLM can draft recipes, but it cannot be trusted to keep the rules.

What I built

A cooking-practice app with a step-by-step cook-along (screen wake lock, voice, timers), a Sauce School that starts with six quick Level 1 sauces and climbs a ladder per sauce family, technique cards and ingredient cards. Planning builds a week of meals for two people against both profiles, with per-person portion lines, weekly caps and frozen sauce portions filled into dinners. Shopping lists come from the plan or from chosen days, ticking an item puts it in stock, and a list can be sent as plain text to a phone. The local model drafts recipes, imports recipes from a URL and suggests weekly additions; the rule engine decides what is allowed.

Architecture

Rule engine in code
Per-person profiles: vegetarian flags with exceptions, avoid lists, dislikes, no alcohol or added sugar, net carbs and protein per meal, cook-time and quick-lunch limits, weekly caps for oily fish, red meat and tuna. The same matcher guards plans, swaps and shopping lists.
Generate, check, regenerate
Model output is zod-validated, checked against both profiles and the sauce rule, then rejected and regenerated with the failure reasons in the prompt, within a fixed retry budget.
Planner and freezer
A solver picks the week; after that, cooked freezer sauces are placed on dinners two portions at a time, never on a locked or prepped slot and never the same sauce two days running. Frozen portions are ticked off when eaten.
Nutrition from published data
USDA SR Legacy values per 100 g including micronutrients and fatty acids; glycemic load only from a published GI table. Meal score, swaps and taste profile are pure, unit-tested functions.
Local AI worker
One GPU job at a time: text jobs first on host Ollama, then the image queue on ComfyUI with the text model unloaded. The client refuses any model URL that is not on the local host, so data cannot leave by misconfiguration.
Hardened web layer
Custom JWT sessions, Host allowlist, CSRF origin check, nonce CSP, per-IP rate limits, capped bodies, and a recipe-URL importer that resolves and checks every IP, pins it, follows no redirects and caps the download.

Tech stack

Next.js 16React 19Prisma 7PostgreSQLTailwind 4Ollama (gemma4:31b, qwen2.5vl:7b)ComfyUI FLUX.2 kleinVitestDocker

What broke first

  • ▸

    Diet rules belong in code, not in the prompt. Every model answer is schema-validated, then run through the household rule check; a failing draft is rejected and regenerated with the reasons fed back. Macros never come from the model at all, only from the USDA table.

  • ▸

    A recipe that ends at "bake 15 minutes" with the juices still in the dish teaches nothing. When I turned that into a check, 56 of 64 everyday recipes failed it. Now every dish with pan juices, cheese or cream has an explicit sauce step, and a script fails the build of the library if one is missing.

  • ▸

    Wide rules break more than they protect. A single blanket term on an avoid list blocked curries and béchamel dishes by mistake. The rules had to name exactly what is out and in which form, and a test plan run lists every failure with its reason so a real one stands out.

Outcome

A household plans a week of meals that passes both people's rules, shops from it, and learns a sauce with every dish instead of following a list of steps. The model writes drafts, the code decides, and 320 tests cover the rules, the planner and the pipelines.

Honest limits

Built for one household on a home network, not a product. It is not a dietitian: every page carries a not-medical-advice footer, nutrition comes only from USDA SR Legacy data and glycemic load only from a published GI table, so anything unknown is left uncounted rather than estimated. The private health logs stay per person and only ever reach the local model on the same machine. Pictures render only while the local image server is running.

Related reading

← Back to portfolio