Inspiration
Every day, high school cafeterias prepare hundreds of meals, often guessing the exact number of students who will actually eat based on gut feeling. If it rains, fewer students leave campus. If there's a pep rally, demand spikes. This guessing game leads to massive amounts of local food waste while, ironically, local food banks struggle to keep their shelves stocked.
We built PlatePredict to solve this exact problem (tackling the hackathon's Local Action rubric). We wanted to empower cafeteria managers with an AI-driven dashboard that accurately forecasts daily meal demand, stops waste before it is cooked, and automatically drafts action plans to redistribute any unavoidable leftovers to the community.
What it does
PlatePredict is an AI-powered dashboard that takes the guesswork out of high school cafeteria meal prep. It helps cafeteria managers accurately forecast food demand so they can stop overcooking and reduce local food waste.
Here is exactly how it works:
Captures Daily Variables: The cafeteria manager inputs tomorrow's planned menu, the forecasted weather, and any special school events (like a Pep Rally or Exam Day) into the simple web sidebar.
Historical Data Matching: The app instantly scans through the school's historical food waste database to find past days with the exact same conditions.
AI-Powered Predictions: It feeds this precise historical context to the Google Gemini AI, which calculates a highly accurate prediction of how many meal portions to prepare (including a 5% safety buffer to ensure no student goes hungry).
Actionable Insights: The AI generates an estimated "waste risk" in pounds and provides a customized, two-step action plan to help the manager adjust prep times or contact local food banks for leftover redistribution.
Human-in-the-Loop: Before any numbers are finalized, the manager reviews the AI's recommendations and clicks an approval checkbox, ensuring a human always makes the final call.
How we built it
We designed PlatePredict to be lightweight, fast, and entirely built in Python:
Frontend Dashboard: We used Streamlit to build a clean, responsive web interface that requires zero web-development experience from the end-user (the cafeteria manager).
Data Processing: We utilized Pandas to load and filter a realistic "Messy Food Waste" dataset from Kaggle.
The AI Brain: We integrated the Google Gemini 1.5 Flash API for lightning-fast generative insights.
The Architecture: The app takes the user's daily inputs (Menu, Weather, Events), uses Pandas to filter the Kaggle dataset for historical matches, and injects that highly specific data into the Gemini prompt. The LLM then acts as a reasoning engine, outputting a precise prep number and a generative action plan
Challenges we ran into
The "Execution Shell" Trap: Early on, we struggled with getting the Streamlit server to run, mistakenly trying to execute standard terminal commands inside the Python interpreter, which taught us how Streamlit's local hosting actually operates.
The "Blank AI" Quota Wall: While trying to use OpenAI's API, we immediately hit a hard Error 429 (Rate Limit Exceeded) quota wall. We quickly pivoted to DeepSeek, and finally settled on Google Gemini Flash due to its generous tier and speed, and also we were forced to contact one of our friends that has paid API for gemini and we used it
The Streamlit Rerun Bug: We encountered a major UX flaw where clicking the "Human-in-the-Loop" approval checkbox caused the entire app to rerun, entirely erasing the AI's generated response! We solved this by diving into advanced Streamlit mechanics and implementing st.session_state to give our app "memory," preserving the AI's output across button clicks.
Data Hallucinations: Initially, the AI was just making generic guesses. We had to engineer a "Smart Data Filter" in Python that actively cross-referenced the user's UI inputs with the train.csv file, gracefully handling edge cases (like searching for data that didn't exist in the CSV) so the app wouldn't crash.
Accomplishments that we're proud of
Engineering the "Smart Data Filter": We didn't just hook up an AI to a simple text prompt. We are incredibly proud of building a dynamic Python filter that actively reads our Kaggle dataset, finds exact historical matches based on user input, and injects that specific data into the LLM's context window. We also successfully engineered fallback logic so the app won't crash if it encounters an edge case!
Mastering Streamlit State Management: When we realized that interacting with checkboxes caused our app to rerun and erase the AI's output, we didn't give up. We successfully learned and implemented st.session_state to give our app "memory," vastly improving the user experience.
Rapid Tech Pivoting: When we hit strict quota walls and API errors with our initial LLM provider, we successfully pivoted our entire AI backend—twice! We transitioned from OpenAI to DeepSeek, and finally to Google Gemini, mapping the different Python structures on the fly without breaking our frontend.
Implementing Responsible AI: We are extremely proud that we didn't just build a "black box" that dictates what a cafeteria should do. By actively integrating a 5% mathematical safety buffer into the prompt and adding a strict "Human-in-the-Loop" approval UI, we built an AI tool that genuinely respects the human element of feeding students.
What we learned
Data is Boss: Building a beautiful UI is useless if the AI isn't grounded in real context. We learned how to seamlessly combine structured CSV data with unstructured LLM reasoning.API Agility: We learned how to quickly swap out LLM providers (OpenAI $\rightarrow$ DeepSeek $\rightarrow$ Gemini) by mapping different Python SDK structures on the fly.State Management: We mastered the concept of "Session State" in web apps, moving from static scripts to a dynamic application that remembers user interactions.
What's next for ClearPlate
In the future, we want to replace our manual data dropdown with a live API integration (like OpenWeatherMap or real time data from schools with variables we want) so the app automatically knows tomorrow's forecast. We also plan to build a custom FastAPI backend to scale the database for multiple schools in a single district!
Log in or sign up for Devpost to join the conversation.