This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
I built SlothChef — an on-device AI fridge-to-recipe and automated grocery copilot created in honor of International Sloth Day to reward peak culinary laziness.
Instead of standing in front of an open refrigerator door for five minutes paralyzed by decision fatigue, you simply snap a photo of whatever random clutter is sitting in your fridge or pantry. In under 40 milliseconds, SlothChef classifies your available ingredients on-device via WebGPU, computes a Sloth Efficiency Score (0–100%), formulates an ultra-low-effort 1-pan recipe under 15 minutes using Google Gemma 2, and compiles an automated grocery list of the essential staples missing from your kitchen.
Who Gets to Be Lazier Because of It?
- Exhausted Workers & Students: Coming home at 10 PM with zero mental energy left to cook or wash a pile of cookware.
- Reluctant Cooks: Who hate chopping, complex prep steps, and multi-pan cleanup.
- Anyone Tired of the DoorDash Trap: Who would rather spend 8 minutes making a 1-pan comfort meal than wait 48 minutes for a $28 takeout delivery.
Demo
SlothChef runs locally on http://localhost:5175 with instant preset testing, real-time WebGPU vision classification, and ambient audio soundscapes.
Interactive Testing Highlights:
- Curated Fridge Scenarios: Test instant zero-effort cooking with pre-configured scenarios (Late-Night Sloth Scraps, Leftover Rice Tumbleweed, Zero-Cook Chickpea Smash, Sunday Pasta Panic, Foil-Lined Sheet Pan Medley).
- WebGPU Vision AI: Aim your webcam or drop a photo of your fridge to see ingredients and rot-risk candidates identified in ~40ms with 0KB uploaded.
- Sloth Efficiency Scorecard: Live calculations showing your Sloth Score (e.g. 98.4%), dishes saved versus traditional recipes (typically saving 4 dishes per meal), and time saved versus food delivery.
- 3-Step Low-Effort Recipe: Minimalist, step-by-step instructions with interactive completion checkboxes, ingenious dish-saving hacks, and a built-in Sloth Cooking Timer.
- Ambient Kitchen Simmer: A toggleable Web Audio API lo-fi pan sizzle and peaceful white noise soundscape to relax while your food cooks.
- Automated Missing Grocery List: Auto-sorted by department (Fresh Produce, Dairy & Refrigerated, Pantry & Spices, Protein) with one-click markdown checkbox copying for Apple Notes, Notion, or Instacart.
Code
Abhinav-Shrivas
/
Slow-and-Steady
On-device AI fridge-to-recipe & auto-grocery copilot for peak culinary laziness. Turns fridge clutter into 10-minute, 1-pan meals using WebGPU vision & Google Gemma 2.
🦥 SlothChef
On-Device AI Fridge-to-Recipe & Auto-Grocery Copilot
Never stare blankly into an open fridge again. Turns leftover fridge clutter into 10-minute, 1-pan meals and compiles an automated missing grocery list — powered 100% locally by WebGPU Vision and Google Gemma 2.
💡 The Problem: The Open-Door Fridge Paralysis
Everyone knows the feeling: you come home exhausted, open the refrigerator door, and stare blankly for 5 minutes. You see half an onion, cold takeout rice, two eggs, a jar of hot sauce, and cheddar cheese.
- Decision Fatigue: You are too exhausted to brainstorm what goes together.
- Dish Washing Dread: Standard recipe sites demand two prep bowls, a cutting board, a saucepan, a strainer, and a skillet. That means 15 minutes of washing dishes after eating.
- The 48-Minute DoorDash Trap: Ordering takeout takes 45–60 minutes, costs $25–$35, and arrives lukewarm.
- The Missing Ingredient Blindspot: You don't…
How I Built It
SlothChef was engineered around open-weight models, in-browser WebGPU hardware acceleration, and local agent runtimes. The architecture connects five coordinated local subsystems: an in-browser vision transformer that scans fridge clutter in milliseconds, an open-weight culinary agent powered by Google Gemma 2 tuned specifically for low-effort 1-pan recipes, an offline heuristic fallback engine for cabin or storm resilience, a Sloth Efficiency calculator, and a local-first grocery ledger.
1. In-Browser WebGPU Fridge Vision Classifier
The visual pipeline runs on @huggingface/transformers using a quantized Vision Transformer (Xenova/vit-base-patch16-224 ONNX runtime). When a fridge photo is captured or dropped into the viewfinder, it is processed directly on the client machine using WebGPU hardware acceleration (Direct3D 12 on Windows, Metal on macOS, or Vulkan on Linux), falling back to WASM SIMD CPU threads on older machines. In approximately 40 milliseconds, the model identifies available proteins, produce, and condiments with zero data transmitted over the internet.
2. Google Gemma 2 Low-Effort Culinary Agent (Modelfile)
For recipe formulation, SlothChef connects to a locally hosted Ollama instance powered by Google Gemma 2 (gemma2:2b). To guarantee low-effort, pan-saving results, the agent executes against a custom Modelfile with low temperature (0.35) for high factual accuracy:
FROM gemma2:2b
PARAMETER temperature 0.35
PARAMETER top_p 0.9
SYSTEM """You are SlothChef, an AI culinary assistant celebrating International Sloth Day.
Your mission is to reward peak human laziness.
Given a list of leftover fridge ingredients:
1. Formulate a delicious recipe that requires MAXIMUM 1 PAN and takes under 15 minutes.
2. Optimize for ZERO dishes and ZERO cutting board washing.
3. Suggest clever hacks (e.g., crack eggs directly into tortillas, use kitchen shears instead of cutting boards).
4. Identify 4 critical missing grocery items that should be added to the shopping list.
Always produce valid JSON matching the requested schema.
"""
To eliminate browser cross-origin restrictions when communicating with Ollama from Vite, requests are routed through a local /ollama reverse proxy directly to port 11434.
3. Graceful Offline Heuristic Fallback (Sloth Mode)
Because power outages or rural cabins often knock out internet access right when you need to cook, SlothChef includes a built-in offline heuristic recipe engine. If Ollama is offline or the user toggles "Sloth Mode", the application instantly synthesizes tested 1-pan recipes and missing grocery lists entirely in-memory using localized attribute heuristics, guaranteeing 100% operational uptime without internet access.
4. Sloth Efficiency Engine
The efficiency core evaluates recipe parameters against traditional cooking and takeout delivery. It factors in active prep minutes, cooking duration, cookware required, and chopping complexity to calculate a certified Sloth Score (0–100%), dishes saved (saving an average of 4 dishes per meal), and minutes saved versus waiting 48 minutes for food delivery.
5. Web Audio Ambient Soundscape
To make cooking genuinely relaxing, SlothChef includes a synthesized kitchen soundscape built directly with the Web Audio API. Using pink/brown noise filtered through a 1400Hz bandpass filter, it generates a warm pan simmer sizzle and gentle pentatonic timer chime without loading any external audio files.
Why Does Open Innovation Matter?
This week's theme asks: Where did your open-based approach work better than a closed one? For an everyday lifestyle utility like cooking and groceries, open innovation provides three decisive advantages over closed APIs:
1. $0 API Bills = Guilt-Free Everyday Use
Closed APIs like GPT-4o or Claude 3.5 Sonnet charge per image upload and per thousand completion tokens. Paying $15–$20/month in cloud subscriptions just to figure out what to do with three eggs and a tortilla defeats the entire purpose of saving money at home. Running quantized open weights on-device costs $0.00.
2. Operates During Storms, Outages, and Off-Grid Cabins
When severe weather takes down your home internet, you still need to eat. Cloud-dependent apps fail immediately without connectivity. Because SlothChef bundles on-device WebGPU vision and local Gemma 2 inference, it functions flawlessly in airplane mode.
3. Absolute Dietary and Living Privacy
Nobody wants high-resolution photos of their messy refrigerator, private medications stored in the door, or personal dietary habits uploaded to tech company servers for ad targeting. SlothChef guarantees that zero bytes of personal data ever leave your laptop.
4. Custom Modelfiles & Prompt Freedom
Closed APIs frequently output lengthy, over-complicated recipes requiring exotic spices or multi-pot steps. With Google Gemma 2 and our custom Modelfile, we enforce strict 1-pan limits, zero-chopping hacks, and formatted grocery schemas with total reliability and zero vendor lock-in.
The Lazy Payoff
Here is the real-world lazy payoff measured over a typical week of using SlothChef:
- Time Saved: An average of 35 to 40 minutes saved per meal compared to waiting 48 minutes for DoorDash or UberEats.
- Dishes Saved: Traditional recipes use a cutting board, prep bowl, two pans, and a colander (5 dishes). SlothChef recipes use 0 to 1 pan, saving roughly 20+ dishes from being scrubbed every week.
- Fridge Paralysis Eliminated: Standing with the door open for 5 minutes staring blankly is replaced by a 40-millisecond camera scan that immediately serves up a concrete 3-step meal.
- Zero-Effort Grocery Preparation: Missing essentials are identified automatically while you cook, eliminating the Sunday ritual of manually auditing your pantry before grocery shopping.
Prize Categories
Best Use of Gemma ($200 USD)
-
Model Used: Google Gemma 2 (
google/gemma-2-2b-it/gemma2:2b) by Google DeepMind. -
Implementation: Google Gemma 2 powers the core culinary reasoning and lazy recipe formulation engine. We created a custom Ollama
Modelfile(FROM gemma2:2b) with low temperature (0.35) and a specialized prompt enforcing strict 1-pan constraints, dish-saving kitchen hacks, and automated missing grocery extraction. It is paired with an in-browser WebGPU Vision Transformer and an offline heuristic fallback cache so users can turn fridge clutter into dinner in cellular dead zones with $0 API costs. -
Verification: Run
npm testto verify the open-weight recipe generation, Sloth Score calculator, and grocery grouping pipeline directly in your terminal, or inspectModelfilein the repository root.
Top comments (0)