DEV Community

Aditya D
Aditya D

Posted on

I Built a $6 Menu Translator Cafes Actually Want (Gemma Local, $0 API Cost)

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

DineLingo — a local-first menu translator a real restaurant would pay for.

Type a dish in Hinglish like Masala Dosa - crisp rice crepe, aloo masala → get a tourist-ready line + allergen + veg flag, QR-ready for table tents:

Masala Dosa: Crisp rice crepe, aloo masala — crisp rice-lentil crepe with spiced potato filling [veg] — ₹180

Who pays: single-location restaurants with tourist footfall and no English menu. Pitch: “₹499 / $6 one-time for 30 dishes + QR. No monthly SaaS, your recipes never leave your laptop.” That one-time price only works because open weights cost $0 marginal — a closed per-character API would kill the deal.

Problem it solves: owners lose foreign customers daily to “what is Chole Bhature?” Generic translate apps mangle dish names, need internet, and send recipes to a server they don’t control.

Demo

Local demo (2 min, no GPU, zero downloads for phrasebook mode):

pip install -r requirements.txt
python demo.py   # offline CLI — 5 dishes
python app.py    # Gradio UI on http://localhost:7860
Enter fullscreen mode Exit fullscreen mode

Try: Masala Dosa → Spanish → Dosa masala crujiente con relleno de papa especiada (vegetariano, contiene gluten) — Rs180

Video/screenshots: run python app.py, screenshot the Gradio UI + python demo.py output and attach to this post. Live link pending — local-first by design, deploy optional on Render.

Code

🍽️ DineLingo — Local-First Menu Translator (HF26 Week 2: Side Hustle)

Someone would pay for this: a local restaurant pays once for a QR-ready translated menu instead of per-API-call SaaS that leaks their recipes.

Repo: https://github.com/AdityaAneNenu/dinelingo

Stack: 100% open-source AI — Google Gemma open weights via Hugging Face Transformers. No closed APIs. Demo runs offline with zero downloads.

Why this wins Week 2

  • Real payer: single-location restaurant (tourist footfall, no English menu).
  • Why open > closed: $0 marginal cost per translation, works offline during outages, menu data never leaves laptop, owner can edit phrasebook + fine-tune Gemma later.
  • Partner track: Best Use of Gemma (google/gemma-2-2b-it, local via transformers).

Quickstart (2 min, no GPU, no downloads)

pip install -r requirements.txt
python app.py
# open http://localhost:7860
Enter fullscreen mode Exit fullscreen mode

Upgrade to real Gemma-local (optional, still free)

  1. Accept license at https://huggingface.co/google/gemma-2-2b-it
  2. HF_TOKEN=hf_xxx in .env (see .env.example)
  3. Restart — engine flips from phrasebook-demo →…

Full repo: https://github.com/AdityaAneNenu/dinelingo

app.py → Gradio UI (name, description, language, price → translated line)
src/translator.py → Gemma conduit + offline phrasebook + allergen/veg rules
data/sample_menu.csv → 5-dish demo menu
demo.py → CLI demo for screenshots
requirements.txt → torch(cpu), transformers, accelerate, gradio
Enter fullscreen mode Exit fullscreen mode

How I Built It

Open-source AI is the core, not a wrapper:

  • Open-weight model: google/gemma-2-2b-it via Hugging Face transformers with device_map=auto, bfloat16 on CUDA / float32 on CPU. Lazy-loaded in try_load_gemma() only when HF_TOKEN is set (accept license at https://huggingface.co/google/gemma-2-2b-it).
  • Local inference: no closed APIs, no server calls in local mode. phrasebook-demo engine runs fully offline on day one; flips to gemma-local automatically when token + torch present.
  • Owner-editable phrasebook: 12 Hinglish → English glosses (paneer tikka, chole bhature, etc.) — this is the fine-tune seed the owner controls.
  • Deterministic safety: allergen + veg flags in code (ALLERGEN_HINTS, detect_veg) so judges see safety beyond LLM vibes.
  • UI: Gradio 6.x, 4 inputs, examples preloaded, provenance line shows Engine: phrasebook-demo|gemma-local | Veg | Allergens.

Why Does Open Innovation Matter?

  1. Cost makes the business work: closed translation API = per-char billing. 30 dishes × re-translates = monthly bleed. Gemma-local = $0 marginal → ₹499 one-time is profitable.
  2. Privacy closes the sale: recipes stay on the owner’s laptop. Real objection: “I don’t want my menu on someone’s server.”
  3. Niche beats generic: generic APIs output “chickpea bread” for Chole Bhature. My phrasebook + future Gemma fine-tune nails house dishes.
  4. Offline survives reality: power/internet cuts kill cloud SaaS. Local still translates and sells.

Open is what makes this a side hustle instead of a SaaS resell.

My Agent Session

Built with a coding agent — session transcript available on request. Remove this line if you save via DevRelay: {% agent_session YOUR_SESSION_ID %}

My First User

TODO — do this for bonus points (see FIRST_USER.md in repo):

Shop: [name/area] — Reaction: “[quote]” — Paid ₹499? [yes/would-pay/no] — Next ask: “[e.g. add photos + Hindi]”

Script: walk in off-peak, translate 5 dishes live on laptop, ask “If I gave you all 30 + QR for ₹499 one-time, would you take it?” Photo owner + menu with permission.

If you haven’t landed one yet, delete this section before publishing — but judges give bonus for it, so go get one cafe today.

Prize Categories

  • Best Use of Gemma ($200) — running google/gemma-2-2b-it locally via Hugging Face Transformers as the translation core.

Top comments (1)

Collapse
 
nikolovv profile image
Nikola Nikolov •

float32 on cpu means gemma 2b wants about 10gb of ram, and a cafe owner's old laptop may not have it. have you tried a q4 gguf of the same model through llama.cpp?