A hybrid chat prototype for five days of sample school café menus, combining exact price filtering with streamed local-model responses.
- Next.js 15
- React 19
- TypeScript
- App Router
- Route Handlers
- Ollama
- Web Streams
- CSS
- Vercel
School Café Assistant AI is an educational chat prototype for exploring a fixed five-day menu. It answers supported budget questions from typed data and streams other menu, ingredient, and allergen questions through a configurable local Ollama model.
Students and staff may need a quick answer about a day, price, ingredient, or allergen without scanning a full menu.
- The dataset covers 7–11 September 2026 only.
- Items include Hot Food or Cold Food categories, prices, ingredients, and listed allergens.
- The interface returns short answers and must not imply access to menus outside the dataset.
- This unaffiliated educational prototype provides sample allergen information, not medical or food-safety advice.
From Menu Data to Chat Prototype
- 1Define the Five-Day Menu and Scope
- 2Model Days, Categories, Prices, and Allergens
- 3Design the Chat Interface
- 4Create the Next.js Chat Route
- 5Add Exact Price Filtering
- 6Connect and Stream Ollama Responses
- 7Handle Loading, Errors, and Reset
The workflow moved from typed menu data and interface design to exact filtering, local-model streaming, and error handling.
Question to Streaming Answer
No
Yes
Yes
No
Users select a weekday prompt or write a question; the answer streams into one visible assistant message.
Built with Next.js 15, React 19, TypeScript, and custom CSS. Typed menu data handles exact price queries, while Ollama and Web Streams support broader questions with progressive responses.
Hybrid Chat Architecture
Deterministic Path
Model Path
Both paths return newline-delimited JSON that the browser decodes into the active assistant message.
The React interface calls a Next.js route connected to typed menu data, exact filtering, and Ollama streaming.
Deterministic First, Model Second
No
Yes
No
Yes
A supported price phrase plus a day or date triggers exact filtering; every other request goes to Ollama.
The interface keeps chat behaviour simple and makes the prototype's scope visible.
- Weekday shortcuts reduce typing; Enter sends and Shift+Enter adds a line.
- Loading prevents duplicate sends, while typing and reset states provide feedback.
- The About dialog, focus styles, keyboard controls, and reduced-motion support improve accessibility.
- Visible dates and disclaimers communicate the fixed, educational scope.
The prototype still needs broader data, stricter grounding, automated tests, and production safeguards.
- Replace the hard-coded menu with an authorised CMS, database, or school-managed feed.
- Ground Ollama with a dedicated system prompt; local CPU responses may still be slow or inconsistent.
- Extend exact intent handling beyond price to allergens, ingredients, preferences, and availability.
- Add route and streaming tests, then production rate limits, logging, validation, and a reachable model service.