DEV Community

Cover image for Menu Translator: A Private, Offline Menu Translation Tool Powered by Llama 3.2
Shubham Bawari
Shubham Bawari

Posted on

Menu Translator: A Private, Offline Menu Translation Tool Powered by Llama 3.2

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

Menu Translator is a small web app that translates restaurant menu items into another language and adds a short, customer-friendly description for each dish.

The target customer is a local restaurant owner or cafe manager who serves tourists, students, or foreign guests. Generic translators often mess up food names (for example, translating "Dal Makhani" word by word). This tool keeps the original dish name, gives a translated name, and explains what the dish is in one line.

There is also a "Restaurant notes" box. The owner can describe their restaurant and special items (for example, "Our Special Thali has 2 sabzi, dal, rice and 3 roti"), and the model uses this context while translating. This is the part a generic tool cannot do.

Supported languages: English, Hindi, French, Spanish, German, Japanese.

Demo

Screenshot of the Menu Translator web app showing a list of dishes, a restaurant notes box, a language dropdown, and the translated menu output

How to use it:

  1. Paste dish names, one per line.
  2. Optionally add restaurant notes.
  3. Pick the target language.
  4. Click Translate and get the result in a few seconds.

Code

GitHub logo shubsolos19 / Menu-Translator

Translates restaurant menu dishes using a local open-source model (Llama 3.2 via Ollama). Runs offline, no API cost, menu data stays private.

Menu Translator

Menu Translator Banner

Translates restaurant menu dishes using a local open-source model (Llama 3.2 via Ollama). Runs offline, no API cost, menu data stays private.

Screenshot

App Screenshot

Setup

  1. Install Ollama from ollama.com
  2. ollama pull llama3.2
  3. pip install -r requirements.txt
  4. python app.py
  5. Open http://localhost:5000



The whole app is a single app.py file, so anyone can read it, run it, and change it in minutes.

How I Built It

  • Model: Llama 3.2, an open-weight model from Meta
  • Local inference: Ollama, which runs the model on my own laptop
  • Backend: Python and Flask, with one route that sends a prompt to Ollama's local API
  • Frontend: plain HTML, CSS, and JavaScript inside the same file, no build step

Flow: the user's dish list, restaurant notes, and chosen language go into a structured prompt. The prompt asks the model to keep the original name, give the translated name, and write a short description. Flask sends it to Ollama on localhost:11434 and shows the response on the page.

To run it:

  1. Install Ollama and run ollama pull llama3.2
  2. pip install -r requirements.txt
  3. python app.py
  4. Open http://localhost:5000

Why Does Open Innovation Matter?

  • Cost: There are no API fees and no per-request charges. A small restaurant can translate its menu as many times as needed for free, which makes this a realistic product for a tiny business.
  • Privacy: Everything runs on the local machine. Menus, recipes, and notes about specials never leave the owner's computer.
  • Works offline: After the model is downloaded, no internet is needed.
  • Customizable: The restaurant notes box adapts the output to each business. With an open model I can also swap in a different one by changing a single word in the code (MODEL = "llama3.2"), or fine-tune for a specific cuisine later.
  • No lock-in: I am not tied to any provider's pricing, rate limits, or policy changes.

Top comments (2)

Collapse
 
launchgatecheck profile image
Launch Gate •

The restaurant-notes box gives you a useful boundary to test: a dish name isn't evidence of every ingredient. I'd try the same dish with notes saying "contains peanuts", then with that line removed, plus a mixed vegetarian/non-vegetarian thali. Can the translated output preserve explicit ingredient notes while marking anything inferred as needing owner review? In particular, an absent ingredient shouldn't become an "allergen-free" claim. Keeping the original dish and the source note beside the translation would make that review easier before it goes on a printed menu.

Collapse
 
hello_shubham profile image
Shubham Bawari •

Thank you, this is a great point. I made these changes:

  1. The model now only uses ingredients that the owner writes in the restaurant notes. It does not guess from the dish name.
  2. It is told never to say a dish is allergen-free or vegan.
  3. If a dish has no note, the output says "ingredients and allergens not confirmed, owner please verify".
  4. The owner's own note shows under each translation as "Source note".
  5. A warning on the page tells the owner to check everything before printing.

These are instructions to a small local model, so it can still make mistakes. Human review is a must. I have not tested your cases yet (same dish with and without "contains peanuts", and a mixed veg/non-veg thali), but I will try them next. Thanks for the idea.