NCDiet AI Playground
Try my dietitian chatbot for people with hypertension, diabetes, dyslipidemia or obesity. It answers only from about 450 clinical guidelines, cites the passage behind every claim as [n], and writes recipes that respect halal or vegetarian diets. Everything runs on one GPU in my homelab, with no cloud APIs, so an answer can take up to half a minute.
Checking the server…A research demo, not medical advice. Questions are answered one at a time and are not stored.
Why I built it
Diet advice for chronic disease has to be right, has to fit the person's food culture, and should never leave the clinic's machine. General chatbots miss on all three: they state numbers with nothing behind them, suggest pork to a halal patient, and send patient questions to someone else's server.
- Grounded. the model may only use the passages it was handed, and must say when the guidelines don't cover a question.
- Culturally aware. halal and vegetarian rules are hard exclusions in the prompt, not suggestions.
- Local. retrieval, re-ranking and generation all run on one consumer GPU (16 GB), so no question leaves the machine.
How it works
Each question goes through four stages. The same pipeline produces the evaluation runs, so the numbers below come from the system you just used.
- Index the guidelines. About 450 documents (Malaysian MOH, ESPEN, ASPEN and others, some in Malay) are split into 1,000-character chunks. Scanned pages are OCR'd with Tesseract.
- Hybrid retrieval. 30 dense (bge-m3) and 30 keyword (BM25) candidates are merged with reciprocal rank fusion, then a cross-encoder re-ranks them and keeps the top 6.
- Grounded prompt. The 6 passages are numbered, and the prompt adds the patient's conditions and diet exclusions. For meal requests, a flavour-pairing graph suggests ingredients that work together.
- Generate. Factual questions go to my QLoRA fine-tune of Qwen3.5-9B. Recipe requests go to the base model, which still writes better recipes (76/80 vs 61/80 in a blind test).
What the numbers say
Every change had to beat the previous version on fixed question sets, graded blind.
Model choice came from a 30-question blind eval: Qwen3.5-9B scored 163/180 against 140 for Qwen2.5-14B. Thinking mode scored 169 but took about 56 s per answer, so it stays off.