DEV Community

Onkar Jadhav
Onkar Jadhav

Posted on

What I Built

I built Mahaswad (महासवाद), a 100% local, privacy-friendly AI recipe generator dedicated to traditional Maharashtrian cuisine.

I built this for my friend who loves authentic home-cooked regional food—like Puneri Misal, Pithla Bhakri, Kolhapuri Tambda Rassa, or Kanda Poha. However, whenever he opens his kitchen pantry and sees a random assortment of ingredients, he struggles to quickly match them to an authentic traditional dish without wading through ad-heavy online recipe sites or generic AI tools that don't understand local culinary nuances.

Mahaswad solves this by letting him input whatever ingredients he has on hand (e.g., poha, peanuts, onions, turmeric) and instantly generates:

An authentic dish match categorized across four distinct regional styles (Puneri, Kolhapuri, Malvani, and Vidarbha).

Full step-by-step cooking instructions with required pantry additions.

Output options in either English or native Marathi (Devanagari script).

A specialized Chef Note detailing traditional regional serving context.

Best of all, it runs completely offline on CPU hardware with zero subscription costs or cloud APIs!

Demo

Code
Check out the full open-source repository on GitHub:

🍛 Mahaswad — Maharashtrian Recipe Generator

Hacktoberfest 2026 · Powered by Ollama + Gemma 2B · Built with FastAPI + Streamlit

Turn your available ingredients into authentic Maharashtrian recipes — in English or Marathi — using a fully local, privacy-friendly AI running on your own machine.


✨ Features

  • 🤖 100% Local AI — Uses gemma2:2b via Ollama. No API keys, no cloud, no cost.
  • 🗺️ 4 Regional Styles — Puneri, Kolhapuri, Malvani, and Vidarbha cuisine
  • 🍽️ 4 Dish Categories — Breakfast, Main Course, Snack, Dessert
  • 🇮🇳 Bilingual — Recipes in English or Marathi (Devanagari script)
  • ⚡ Real-time generation — FastAPI backend + interactive Streamlit UI
  • 🔍 Smart ingredient matching — AI identifies the closest traditional dish

🏗️ Architecture

┌─────────────────────┐        HTTP POST        ┌──────────────────────┐
│   Streamlit UI      │ ──────────────────────► │   FastAPI Backend    │
│   (app.py)          │   /generate-recipe       │   (main.py)          │
│   localhost:8501    │ ◄──────────────────────  │   localhost:8000     │
└─────────────────────┘     RecipeResponse       └──────────┬───────────┘
                                                            │ ollama.chat()
…



Plaintext

Mahaswad/

├── app.py # Streamlit interactive UI

├── main.py # FastAPI backend & Ollama integration

├── requirements.txt # Dependencies (FastAPI, Streamlit, Ollama, etc.)

├── run.sh # Launch script (Linux/macOS)

└── run.bat # Launch script (Windows)

GitHub Repo: onkarjadhav5598/Mahaswad

How I Built It
The main goal of Mahaswad was to deliver high performance on everyday consumer hardware (Intel i7 8th Gen CPU, 16 GB RAM, no discrete GPU).

Open-Source Model Engine: Powered by Google's Gemma 2 2B (gemma2:2b), running locally through Ollama.

FastAPI Backend (main.py): Exposes a RESTful /generate-recipe endpoint that structures regional chef system prompts, regulates inference parameters (temperature=0.6, num_predict=1024), and uses regex cleaning to strip out scratchpad reasoning tags before serving structured JSON responses.

Streamlit Frontend (app.py): Provides a clean, responsive web interface for entering ingredients, selecting meal categories (Breakfast, Main Course, Snack, Dessert), choosing regional styles, and toggling output languages.

System Architecture
Plaintext
┌─────────────────────┐ HTTP POST ┌──────────────────────┐
│ Streamlit UI │ ──────────────────────► │ FastAPI Backend │
│ (app.py) │ /generate-recipe │ (main.py) │
│ localhost:8501 │ ◄────────────────────── │ localhost:8000 │
└─────────────────────┘ RecipeResponse └──────────┬───────────┘
│ ollama.chat()
▼
┌──────────────────────┐
│ Ollama (local) │
│ gemma2:2b │
│ localhost:11434 │
└──────────────────────┘
Why Does Open Innovation Matter?
Building with open-weight models like Gemma 2 2B made this project possible in ways closed commercial APIs never could:

Zero Operating Costs & True Accessibility: Using closed-source AI APIs requires credit cards, usage caps, and per-token fees. Open-weight models running locally allow anyone to build and run AI applications indefinitely for free.

Complete Data Privacy: A cooking assistant shouldn't need to ping remote cloud servers or collect telemetry on everyday user habits. Everything remains on-device.

Hyper-Local Contextual Freedom: Open innovation gives developers full control over system instructions, custom prompt engineering, and local regional context—allowing Gemma 2B to accurately capture niche regional traditions (like Puneri, Kolhapuri, Malvani, and Vidarbha cooking styles) without cloud safety filters over-refusing cultural terminology.

Prize Categories
Best Use of Gemma ($200) — Powered entirely by Google's open-weight gemma2:2b model running locally via Ollama.

Top comments (0)