DEV Community

Avinash Kumar
Avinash Kumar

Posted on

๐Ÿ› Khana Kya Hai? โ€” Ranchi Hostel Mess & Allergy Planner with Google Gemma

"Aaj mess mein kya kha sakta hoon?"

That is a simple question, but hostel mess menus become much harder to deal with when someone has a food allergy, intolerance, or dietary restriction.

For the Hacktoberfest 2026 Weekend Challenge: Build for a Friend, I built Khana Kya Hai?, a small AI-powered hostel mess planner that helps turn a daily mess menu into practical avoid, verify, and suitable-looking options.

๐Ÿค Building for a Friend

I built this around a real hostel problem faced by a friend.

In a hostel, students often do not get detailed ingredient information for every dish. Even when a dish looks safe, its ingredients or cooking method may be unclear.

The goal of Khana Kya Hai? is not to provide medical advice. Instead, it helps a student organize the available menu and identify which items should be avoided, which need verification, and which appear suitable based on the information provided.

I also showed the prototype to my hostel roommate Rahul, who deals with dairy sensitivities. He found the practical backup suggestions useful because hostel mess staff may not always be able to change the cooking method for an individual request.

โœจ What I Built

Khana Kya Hai? takes four inputs:

  • Today's hostel mess menu
  • Allergies or intolerances
  • Dietary preference
  • Daily food budget

It then uses Google's Gemma open-weight model to analyze the menu and generate a structured recommendation.

The interface is built with Gradio and runs from a Google Colab notebook.

๐Ÿง  How It Works

User Input
   |
   v
Mess Menu + Allergy + Diet + Budget
   |
   v
Google Gemma 4 31B
   |
   v
Menu Analysis
   |
   v
Python Safety / Consistency Layer
   |
   v
Final Recommendation
Enter fullscreen mode Exit fullscreen mode

Gemma handles the natural-language reasoning around the menu.

A separate Python layer performs deterministic checks for known allergy-related keywords and cleans the model output.

This extra layer also helps prevent contradictions, such as recommending a menu item after it has already been placed in the avoid list.

The application separates results into:

  • AVOID โ€” the item conflicts with the provided restriction
  • VERIFY โ€” ingredients or preparation are uncertain
  • SUITABLE-LOOKING โ€” the item appears compatible based on the available information

๐Ÿ›ก๏ธ Why Add a Deterministic Layer?

Generative AI is flexible, but food restrictions are a situation where blindly displaying generated text is not a good design.

Khana Kya Hai? therefore keeps explicit keyword-based checks outside the model.

For example, dairy-related inputs can expand into related terms such as:

milk
dairy
paneer
cheese
butter
cream
curd
yogurt
kheer
ghee
Enter fullscreen mode Exit fullscreen mode

The Python layer checks the generated categories against these terms and removes contradictory suitable/recommended results when an item is identified as conflicting with the provided restriction.

This is not a medical safety guarantee. It is a deterministic consistency layer around a generative model.

๐Ÿ–ฅ๏ธ Demo

๐Ÿ”— Live Demo

Open Khana Kya Hai?

Example Input

Today's Mess Menu:
Aloo Paratha, Paneer Butter Masala, Rice, Dal, Kheer

Allergy:
Milk / Dairy

Diet:
Vegetarian

Budget:
โ‚น100
Enter fullscreen mode Exit fullscreen mode

Example Output

Avoid:
- Paneer Butter Masala
- Kheer

Verify:
- Aloo Paratha
- Dal

Suitable-looking:
- Rice

Recommended Meal:
- Rice
Enter fullscreen mode Exit fullscreen mode

The application can also provide a low-cost alternative when the available mess menu does not fit the user's restrictions.

๐Ÿงช Testing

I tested the prototype with several hostel-style cases:

Dairy restriction

The application identified clearly dairy-heavy items such as paneer-based dishes and kheer for avoidance, while uncertain preparation cases such as paratha or dal could be placed under verification.

Peanut restriction

The application was tested with peanut as a restriction and checked that unrelated menu items were not automatically classified as peanut-containing.

Vegetarian preference

When a menu included chicken curry and the selected diet was vegetarian, the application classified chicken as an item to avoid and did not recommend it as a meal.

Consistency testing

I also tested cases where an item could potentially appear in both an unsafe category and a recommendation. The Python consistency layer was added to reduce that kind of contradiction.

๐Ÿ’ฐ Practical Alternatives

When the available mess menu does not fit the user's restrictions, the prototype can suggest a simple low-cost backup option.

Current alternatives include:

Banana + Roasted Chana โ€” โ‚น25
Aloo Sandwich โ€” โ‚น40
Peanut + Banana โ€” โ‚น25
Plain Rice + Ready-to-eat Dal โ€” โ‚น45
Enter fullscreen mode Exit fullscreen mode

These are application-defined alternative estimates, not prices claimed for the hostel mess.

The alternative logic also avoids the peanut option when peanut is provided as an allergy.

๐ŸŒฑ Why Open Innovation & Gemma Matter

This project uses Google's Gemma, an open-weight model, as the core AI component.

What interested me was using the model for the actual natural-language reasoning around messy hostel menu descriptions rather than simply adding an AI chatbot to the interface.

An open-weight approach also leaves room for future experimentation such as swapping models, adapting the model, or moving toward local inference.

For a project involving personal food restrictions, that future possibility is particularly interesting because local inference could reduce the need to send such information to an external service.

๐Ÿ‘ฅ Feedback From My Hostel Friend

After I showed the prototype to my hostel roommate Rahul, he liked the idea of having practical backup suggestions when the hostel mess cannot easily change its ingredients or cooking method.

His feedback made me think beyond simply identifying foods and focus more on what a student can realistically do when the menu does not fit their restrictions.

๐Ÿ† Hacktoberfest 2026

This project was built for the Hacktoberfest Weekend Challenge: Build for a Friend.

Submission Category

Best Use of Gemma

The project uses Google's Gemma as its core AI model and explores how an open-weight model can be used to solve a small, practical hostel problem.

The challenge asks participants to build a new project with open-source AI at its core, explain why open innovation matters, and show who the project was built for. :chatgpt-content-reference{index="4"}

๐Ÿ“ธ Screenshots

Home Interface

Khana Kya Hai? Home

Dairy Allergy Test

Khana Kya Hai? Dairy Test

๐Ÿ” API Key Handling

The API key is not stored in the GitHub repository.

For the Colab version, the key is stored using Google Colab Secrets.

Create:

GEMMA_API_KEY
Enter fullscreen mode Exit fullscreen mode

and enable notebook access.

โ–ถ๏ธ How to Run

  1. Open khana_kya_hai.ipynb in Google Colab.

  2. Add your Google AI Studio API key to Colab Secrets using:

GEMMA_API_KEY
Enter fullscreen mode Exit fullscreen mode
  1. Run the notebook cells in order.

  2. Enter:

Mess menu
Allergies / intolerances
Dietary preference
Daily food budget
Enter fullscreen mode Exit fullscreen mode
  1. Click:
Analyze My Food
Enter fullscreen mode Exit fullscreen mode

The notebook launches the Gradio interface.

๐Ÿ“ Source Code

GitHub Repository:

https://github.com/Avinash-sdbegin/khana-kya-hai

The repository contains the Colab notebook, README, and project screenshots.

๐Ÿ“š What I Learned

The biggest lesson from this project was that adding a language model is only one part of building a useful application.

The more interesting part was combining:

Generative AI
      +
Deterministic Python Rules
      +
Simple Human-Centered UI
Enter fullscreen mode Exit fullscreen mode

Gemma provides flexible natural-language reasoning, while the Python layer provides predictable checks for known allergy-related terms.

Building this for an actual hostel use case also helped me think more about practical constraints instead of designing only for a technical demo.

๐Ÿ”ฎ Future Improvements

  • Better ingredient and allergen detection
  • Hostel-specific menu history
  • More accurate price estimation
  • Weekly meal planning
  • Local/offline model support
  • Personalized food preferences
  • Better handling of regional Indian dishes
  • More detailed cross-contact detection

โš ๏ธ Safety Note

Khana Kya Hai? is an educational and hackathon prototype.

It is not a medical or allergy-diagnosis system and should not be treated as one.

Food ingredients, recipes, cooking methods, and cross-contact can vary between messes. Users should always verify ingredients, cooking medium, and possible cross-contact with the food provider before eating.

Top comments (0)