Skip to content

About

ChowGenie is a fully offline AI recipe genie and smart kitchen companion. Powered by Google's on-device Gemma multimodal model, it analyzes food photos, creates personalized diet plans, tracks your pantry, and features an offline P2P mesh chat.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

ChowGenie App Icon

ChowGenie

Your Offline AI Recipe Genie & Smart Kitchen Companion.

Flutter Gemma Dart Android Offline

Description

ChowGenie is a fully offline AI-powered recipe genie and smart kitchen companion. Powered by Google's Gemma 4 E2B multimodal model running entirely on-device via flutter_gemma, it generates recipes from ingredients, analyzes food photos, creates personalized diet plans, manages your pantry, and enables peer-to-peer recipe sharing and chat - all without internet.

Demo

Watch the ChowGenie Demo Video

On-Device AI Engine (Gemma 4 E2B)

ChowGenie is powered entirely by Google's Gemma 4 E2B IT (LiteRT-LM) model, executing locally via flutter_gemma:

  • Model: gemma-4-E2B-it.litertlm (~2.59GB) - multimodal (text + vision)
  • Runtime: LiteRT-LM with GPU acceleration (PreferredBackend.gpu)
  • Capabilities: Recipe generation, ingredient identification from photos, diet personalization, meal planning, nutrition analysis

Features

# Feature Description
1 AI Recipe Engine Gemma generates complete recipes from ingredient text or food photos
2 Ingredient-Based Search Type what you have → Gemma suggests recipes you can make
3 Food Photo Recognition Snap ingredients or a dish → Gemma identifies and generates a recipe
4 Personalized Diet Plans Health profile (conditions, allergies, goals) injected into every prompt
5 P2P Recipe Sharing Share via QR code, JSON export, or directly over BLE / LAN mesh
6 Smart Pantry Track inventory, expiry alerts, auto-generated shopping list, "What Can I Make?"
7 Voice Interaction Hands-free cooking mode with speech-to-text and text-to-speech
8 Nutrition Analytics Daily calorie/macro rings, weekly bar charts, water tracker, AI health insights
9 Recipe Customization Serving scaler, vegan/keto/gluten-free transform, spice slider, cooking method swap
10 Recipe Database SQLite-backed with full-text search, favorites, ingredient lookup, bulk asset indexing
11 Meal Prep Planner Weekly batch cooking timeline with cross-utilization and storage/reheat guides
12 LocalMesh Chat P2P messaging over BLE + LAN multicast - text messaging and recipe sharing

Application Screens & Navigation Guide

ChowGenie consists of a modern, warm Material 3 layout utilizing a bottom navigation bar for core screens and an interactive grid dashboard on the Home tab for quick access to dedicated tools:

Global Navigation Bars

  • Bottom Navigation Bar: Provides quick, tabbed navigation across:
    • Home (Dashboard): The hub for daily logs, hydration tracking, calorie rings, and quick-launch cards.
    • Recipes: Full listing of pre-loaded and user-generated recipes, searchable and filterable.
    • IngrediGuard (Scanner): Multimodal AI vision scanner to analyze food barcodes or ingredient list safety.
    • Meal Planner: Weekly calendar schedule to arrange breakfast, lunch, and dinner.
    • Mesh Chat: Offline messaging and direct P2P recipe transfer over BLE or Local Wi-Fi.
  • Top App Bars: Context-specific headers displaying the active screen name, with quick-action settings and back-navigation support.

Key Features & Screen Modules

Module Description
Ask Genie The core AI engine. Features a dual-modal interface allowing users to type ingredients, use voice dictation, or snap photos of raw food. The on-device Gemma model instantly processes these inputs alongside the user's health profile (allergies, diet targets) to generate highly personalized recipes.
Recipe Book A massive, infinite-scrolling repository of over 30,000 preloaded recipes plus all user-generated AI recipes. Features high-performance SQLite pagination, comprehensive tag filtering, alphabetical quick-jump, and a favorites system.
AI Culinary Assistant A conversational AI chef powered by Gemma. Users can open a direct chat window during cooking to ask for real-time ingredient substitutions, flavor pairing advice, or step-by-step culinary guidance, with the model retaining full session context.
LocalMesh Chat A completely offline communication hub. Uses Bluetooth LE for direct peer-to-peer messaging and UDP multicast for a local Wi-Fi "Lounge" group chat. Users can seamlessly share encoded recipe cards with nearby chefs without any internet connection.
IngrediGuard An AI-powered vision scanner designed for health safety. Users point their camera at food packaging or ingredient lists, and Gemma analyzes the text to flag toxic additives, generate a safety score (1-100), and recommend healthier alternatives based on their profile.
Pantry & Shopping A smart inventory management system. Tracks ingredient quantities and highlights expiring items. It automatically generates shopping lists and features a unique "What Can I Make?" AI tool that cross-references active pantry stock to suggest immediate meal options.
Meal Planner A comprehensive 7-day visual calendar scheduler for organizing Breakfast, Lunch, Dinner, and Snacks. Features an automated "Generate Weekly Plan" AI button that fills the entire calendar with meals perfectly tailored to the user's caloric targets and dietary restrictions.
Meal Prep Mode A batch-cooking timeline generator. It aggregates all recipes scheduled for the week in the Meal Planner, calculates mathematically scaled ingredient totals, and generates optimized cross-utilization prep instructions (e.g., "Chop all onions for both Monday and Tuesday now").
Nutrition & Analytics The health tracking dashboard. Displays beautiful daily macro rings (Protein, Carbs, Fats), calorie counters, interactive weekly bar charts, and an incremental hydration tracker. It automatically parses nutritional data from logged recipes and compares daily totals against Diet Plan goals.
Diet Plan & Profile The central health brain of the application. Captures the user's biometrics, active BMI/BMR goals, specific allergies, and dietary constraints (e.g., Vegan, Keto). These fields are persistently stored and injected invisibly into every single AI prompt across the app.
Voice Cooking A hands-free kitchen interface. Utilizes device-native Speech-to-Text to listen for commands like "Next step" or "Read ingredients", and Text-to-Speech to read recipe instructions aloud sequentially, ensuring users can cook without touching their screen.
QR Share An optical data transfer utility. Compresses entire Recipe objects into robust JSON strings rendered as high-density QR codes. Includes an integrated camera scanner to instantly import recipes from other devices directly into the SQLite database.
Settings The administrative hub. Allows users to manage their active profiles, manually handle the local LiteRT AI model extraction and permissions, trigger complete database wipes, and toggle the global "Spice & Magic" Material 3 UI theme.

On-Device AI Capabilities (Gemma Engine)

ChowGenie leverages Google's Gemma 4 E2B model to provide advanced capabilities without calling external servers. The local AI engine is deeply integrated across the following services:

graph TD
    A[User Inputs: Photo / Text / Speech] --> B[Gemma Engine via flutter_gemma]
    C[Health Profile: Allergies / Calorie Goals] -->|Dynamically Injected| B
    B --> D[Output: Custom Recipe Markdown]
    B --> E[Output: Multimodal Ingredient Vision]
    B --> F[Output: Personalized Macro/Diet Guidance]
Loading

1. Context-Aware Prompt Construction (Ask Genie)

When you ask the Genie for a recipe, it doesn't just pass your ingredients. The RecipeViewModel dynamically queries your UserProfile from the SQLite database. It injects:

  • Your active allergies (instructing Gemma to explicitly omit matching items).
  • Your health conditions (e.g., "User has: Hypertension. Avoid high sodium").
  • Your daily calorie targets.

This custom prompt is passed directly to the local Gemma instance, ensuring every recipe fits your health parameters.

2. Multimodal Vision Recognition

Under the Photo Tab of Ask Genie, the image's raw byte array is loaded on-device and analyzed by Gemma's vision encoder. It extracts ingredients from the photo, passes them to the text decoder, and outputs a formatted recipe instantly.

3. Interactive Voice-Guided Cooking

ChowGenie includes a hands-free Voice Cooking Mode. Controlled by VoiceService, it uses:

  • Speech-to-Text: Listens to vocal inputs (e.g., "Next step", "Repeat step") to hands-free navigate recipes while cooking.
  • Text-to-Speech (TTS): Dictates steps aloud sequentially.
  • Ask Genie Microphone Dictation: Lets you vocally dictate your pantry list inside the text field instead of typing.

4. Weekly Plan AI Blueprint

Users can generate a complete 7-day personalized menu blueprint matching their profile target calorie/macro goals, diet preferences (e.g. Keto, Vegetarian), and medical restrictions/allergies in one tap. The plan is generated locally by Gemma and is synchronized across the Diet Plan dashboard and the Meal Planner bottom sheet.

5. Slot-by-Slot AI Suggestions

Tapping any daily slot (Breakfast, Lunch, Dinner, Snack) in the planner allows the user to call Gemma to dynamically suggest a customized single meal recommendation that aligns with their profile settings.


Offline P2P Local Mesh & Group Chat Rooms

ChowGenie contains a fully offline, zero-internet communication system that allows nearby chefs to interact, coordinate meals, and share recipes.

1. P2P Direct 1-to-1 Chat

  • Discovery: Devices discover each other using a combination of Bluetooth LE (flutter_blue_plus) and UDP Multicast on local Wi-Fi subnets.
  • Offline Database Persistence: All messages and scanned peers are saved to local SQLite tables (mesh_messages and mesh_peers). This allows you to browse conversation histories under the Recent Chats list, even when you're completely offline and peers are out of range.

2. Local Lounge (Wi-Fi Multicast Group Chat)

  • The Shared Lounge: A permanent local room named Local Lounge (Wi-Fi) is available on the Mesh screen.
  • UDP Multicast Broadcasts: When you send a message inside the Local Lounge, it is serialized and broadcasted over a raw UDP socket using the multicast group address 239.255.0.100 on port 55555. Any device on the same subnet listening to this socket receives the packet, decodes it, and displays the sender's display name above the message.

3. Attachment & Sharing Capabilities

  • Recipe Sharing (Fully Functional): Tap the attachment icon inside any chat to immediately open the recipe search drawer. Tapping a recipe encodes its entire structure (ingredients, directions, tags) into a JSON payload and transmits it.
  • Import Recipe: The receiver sees a custom card. Tapping Import Recipe extracts the payload, saves it to SQLite, and updates the local Recipe Book instantly.

Tech Stack

  • Flutter + flutter_gemma - On-device Gemma 4 E2B inference
  • Provider - State management
  • SQLite (sqflite) + SharedPreferences - 100% local storage (10 tables)
  • flutter_blue_plus - BLE peer discovery
  • UDP multicast - LAN peer discovery (same WiFi)
  • Material 3 - Warm "Spice & Magic" theme (ember orange #FF6D00 + genie purple #7C3AED)

Architecture

The project strictly follows the MVVM (Model-View-ViewModel) architectural pattern to ensure clean separation of concerns:

lib/
├── main.dart                      # Application entry point, Provider state tree setup, and routing
├── models/                        # Plain Dart data classes
│   ├── chat_message.dart          # Local AI chatbot history/messages model
│   ├── chat_session.dart          # Local AI chatbot session metadata
│   ├── ingrediguard_result.dart   # Model for product safety scan results
│   ├── meal_plan.dart             # Model for meal planning calendars
│   ├── mesh_message.dart          # Mesh network message structure
│   ├── mesh_peer.dart             # Model representation of a nearby mesh device
│   ├── model_status.dart          # Status tracking for Gemma model download/extraction
│   ├── nutrition_info.dart        # Calorie, macro, water logging tracker structures
│   ├── pantry_item.dart           # Model for pantry items inventory tracking
│   ├── recipe.dart                # Main recipe card data structure
│   ├── shopping_item.dart         # Shopping list item model
│   └── user_profile.dart          # User biometrics, allergies, target goals profile
├── services/                      # Singleton controllers for backend logic and APIs
│   ├── image_service.dart         # Local image compressor and camera controller helper
│   ├── local_db_service.dart      # Manages all SQLite CRUD operations across 10 tables
│   ├── mesh_service.dart          # Orchestrates BLE/UDP discovery and P2P network sockets
│   ├── model_manager.dart         # Interfaces with flutter_gemma for AI inference
│   ├── recipe_export_service.dart # Handles exporting recipes to QR code JSON formats
│   └── voice_service.dart         # Handles speech-to-text and text-to-speech lifecycle
├── theme/                         # Global theming & styles
│   ├── app_colors.dart            # Custom color palettes (ember orange, genie purple)
│   ├── app_light_colors.dart      # Material 3 light theme colors spec
│   ├── app_text_styles.dart       # Typography definition (Inter, Roboto)
│   └── app_theme.dart             # Master application ThemeData config
├── viewmodels/                    # State management and UI controllers
│   ├── chat_view_model.dart       # State provider for local chatbot
│   ├── daily_intake_view_model.dart # State provider for diet log tracking
│   ├── describe_meal_view_model.dart # ViewModel for describing scanned dishes
│   ├── ingrediguard_view_model.dart # ViewModel for analyzing packaging safety
│   ├── meal_plan_view_model.dart  # ViewModel for generating weekly menus
│   ├── mesh_view_model.dart       # State provider for offline LAN/BLE multicast
│   ├── nutrition_view_model.dart  # ViewModel for daily calorie trackers
│   ├── onboarding_view_model.dart # State control for onboarding profile steps
│   ├── pantry_view_model.dart     # VM for pantry catalog and inventory alerts
│   ├── recipe_view_model.dart     # State manager for recipe lists & searching
│   ├── scan_view_model.dart       # VM for multimodal image input & recipe generation
│   └── theme_view_model.dart      # Provider for toggling global themes
└── views/                         # UI views
    ├── screens/                   # Independent application screen pages
    │   ├── ask_genie_screen.dart           # Home tab's local AI question deck
    │   ├── chat_screen.dart                # Local chat dashboard screen
    │   ├── daily_intake_screen.dart        # Hydration and calorie tracker detail
    │   ├── describe_meal_screen.dart       # Meal photo description analyzer
    │   ├── diet_plan_screen.dart           # Diet goals & biometric settings screen
    │   ├── home_page.dart                  # Bottom nav home page root
    │   ├── ingrediguard_screen.dart        # Barcode & ingredient safety scanner view
    │   ├── meal_detail_screen.dart         # Detailed food nutritional page
    │   ├── meal_plan_screen.dart           # Interactive weekly calendar board
    │   ├── meal_prep_screen.dart           # Meal prepping grocery scaling lists
    │   ├── mesh_chat_screen.dart           # P2P direct chat room screen
    │   ├── mesh_home_screen.dart           # Multicast local peer discovery view
    │   ├── model_download_screen.dart      # LiteRT model downloading screen
    │   ├── nutrition_analytics_screen.dart # Weekly analytics visual dashboard
    │   ├── onboarding_screen.dart          # Initial app config startup screen
    │   ├── pantry_screen.dart              # Pantry inventory control screen
    │   ├── profile_edit_screen.dart        # Settings edit screen for health info
    │   ├── qr_share_screen.dart            # Recipe visual QR card screen
    │   ├── recipe_detail_screen.dart       # Detailed step-by-step recipe visual
    │   ├── recipe_list_screen.dart         # Database recipe dictionary list
    │   ├── settings_screen.dart            # Theme & database wipe admin settings
    │   └── voice_cooking_screen.dart       # Hands-free voice cooking assistant
    └── widgets/                   # Reusable UI widgets
        ├── capture_prompt_card.dart       # Quick capture helper card
        ├── dashboard_feature_card.dart    # Home screen feature card components
        ├── ingredient_chip.dart           # Horizontal scroll ingredient pill
        ├── nutrient_result_card.dart      # Detailed calorie breakdowns card
        ├── recipe_card.dart               # Reusable recipe preview banner
        └── wordmark.dart                  # Custom styled app word logo

Getting Started

cd ChowGenie
flutter pub get
flutter run

On first launch, the app guides you to download the Gemma model (~2.6GB). After that, no internet needed.

License

MIT License


Acknowledgements & Credits

  • Recipe Database: The core dataset of preloaded recipes is sourced and adapted from dpapathanasiou/recipes. Special thanks to the author for providing a robust, open-source foundation of culinary data.
  • Google Gemma: On-device AI powered by Google's LiteRT-LM framework.
  • flutter_gemma: Huge appreciation to the flutter_gemma plugin maintainers for enabling seamless integration of the Gemma model into the Flutter ecosystem.

About

ChowGenie is a fully offline AI recipe genie and smart kitchen companion. Powered by Google's on-device Gemma multimodal model, it analyzes food photos, creates personalized diet plans, tracks your pantry, and features an offline P2P mesh chat.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages