Diabetes-
Diabetes-
A bilingual (English / বাংলা) diabetes companion for the months between doctor visits. AI explains. Rules decide.
Built for Hacktoberfest Hack Day Dhaka by Farhan Bin Mir Hassan.
Challenges entered: Best Open-Source AI Project and Best Use of Gemma.
- Live app: https://diabetesminus.streamlit.app/
- Code (public, MIT license): https://github.com/farh4n-30/Hacktoberfest-Hackday-26
- Model:
gemma-4-26b-a4b-it, through the Gemini API
The problem
Your doctor gets about five minutes with you. Diabetes gets 365 days.
The dangerous complications start quietly: nerve damage in the feet, night-time low sugar, kidney and eye damage. Diabetes doesn’t hurt, and that is the problem.
Most people don’t realise that the tingling in their feet, the thirst, the tiredness, or the sweaty nights they have been putting up with could be symptoms, or that those things are connected to their diabetes at all. Numbness without pain feels like good news. It is not: a person who cannot feel an injury cannot notice it. Patients don’t forget to ask their doctor. They never knew it was a question.
And most health tools speak only English.
The most dangerous moment of the day
Taking insulin and going to sleep without a meal.
Insulin is dosed by a doctor to match the food a person eats. If the meal does not come, the insulin still works, and sugar can fall too low. At night, a person may not wake up to feel it. Eating less, skipping a meal, delaying a meal, or being too sick to eat all change the balance, and that is exactly when guessing is dangerous.
So the first thing Diabetes- does is protect that moment. The safety screen on the dashboard asks what is happening: skipping a meal, took medicine but not eating, going to sleep after insulin, feeling low now, or sick and unable to eat. Then it:
- looks at the latest sugar reading, and sends the person straight to emergency help if it is severely low or they are confused, cannot swallow, had a fit or fainted
- gives safe general steps (check your sugar first, tell someone near you, never take extra medicine)
- explains the rule of 15 if sugar is low
- shows the person’s own doctor’s instruction, exactly as they entered it after their visit
- if there is no plan yet, says so plainly: don’t guess, check your sugar, ask your doctor. It even gives the exact question to take to the doctor.
The app never suggests, calculates or changes a dose. It would rather say “I don’t know, ask your doctor” than guess.
The design rule
AI explains. Rules decide.
Gemma helps the app understand what a person writes. Every safety decision (what counts as an emergency, which tier a symptom falls in, what to say to someone who skips a meal) comes from fixed, auditable rules. We let AI do the listening, not the judging.
What we track every day, and why
A few seconds of logging a day gives the app something a five-minute visit cannot: the pattern.
| Daily input | Why it matters |
|---|---|
| Sugar reading (with when it was measured) | Shows time in range, highs, lows, and the night-time lows people sleep through. Every reading is checked on the spot: a low gets treatment steps, a very high gets a check for emergency signs |
| Food (typed in Bangla or English) | Gives a heads-up on sugar-heavy foods and listed allergens, and warns that a light meal plus sugar-lowering medicine is a risk. Never a ban, always a heads-up |
| Medicine taken or missed | Missed doses are one of the most common reasons sugar stays high. The app uses them to avoid blaming a plan that was never followed |
| Water and thirst | Thirst that does not go away is an early sign of high sugar. The glass counter hides itself for people with kidney or heart conditions or a fluid limit |
| Exercise | Activity changes sugar, and the doctor’s own exercise instruction is shown right there |
| Energy and mood | Diabetes is tiring. Repeated low mood gets a gentle prompt to talk to someone |
Each of these feeds the report, so the doctor sees what actually happened between visits and not what the patient remembers on the day.
Reminders that carry the patient between visits
On a new profile, the app sets reminders for the checks that quietly matter most: HbA1c, a foot check, blood pressure, an eye exam, kidney tests and cholesterol. When a test is marked done, the next reminder is scheduled automatically, so nothing falls off the list. After each doctor visit the patient records the tests the doctor ordered and the next visit date, and those become reminders too.
The dashboard shows what is overdue, due today and due this week, and says clearly that the doctor’s own schedule comes first.
Symptom guide and report: the questions patients never knew they needed
A person describes what they notice in their own words. Gemma routes it to the right set of fixed screening questions (feet and nerves, low sugar at night, thirst and high sugar), and the app asks “I understood: … Is that right?” before anything else.
Every question is written in advance, never generated, and each has a “Why am I asked this?” explanation, so the patient learns something even before the report.
The report then sorts what it noticed into three tiers (self-care, raise at the next visit, see the doctor this week) and, for every item, shows:
- why it was flagged
- other possible reasons: fasting, illness, a new medicine, steroids, stress, or low vitamin B12 after long-term metformin
- questions to ask the doctor
That last part is the heart of it. The report hands the patient questions they would never have thought to ask:
- “Should my vitamin B12 level be tested?” (tingling feet after years of metformin)
- “Could my evening medicine or meal timing be linked to night-time lows?”
- “What should I do with my medicine if I miss a meal?”
- “What is my plan for days when I am sick and cannot eat?”
- “Does my medicine plan need a review?” (when sugar stays high even though most doses were logged)
One tingly toe is not a crisis, and the app is built not to panic anyone: before it blames the feet, it asks whether the person was fasting. The report can be downloaded and brought to the appointment, so the five minutes count.
Learn: awareness and myth-busting, one chapter at a time
Awareness is half of care, so Diabetes- includes a Learn section:
- A dozen short guides: daily foot checks, why walking barefoot is risky, wounds and nails, choosing shoes, silent heart problems, stroke warning signs, the yearly eye exam, kidney warning signs, insulin and meals, sweets and extra insulin, low sugar and the rule of 15, and sick days
- Myth and fact boxes that answer the beliefs that hurt people, for example “No pain means no problem” (nerve damage can hide pain, so injuries go unseen), “I see fine, so I do not need an eye exam” (early damage often shows no symptoms), and “extra insulin will cancel out chocolate” (it can cause a dangerous low)
- Explainers with everyday comparisons: insulin as a key and a sticky lock, HbA1c as a three-month report card, nerves as wires, low sugar as an empty fuel gauge
- A plain-language glossary that appears inside the report too, so a new word never blocks understanding
Chapters are added gradually. Every chapter carries the date it was added, new ones are marked New, and the dashboard tells the patient when new chapters are waiting. Guides are also marked For you when they match the patient’s profile (insulin users, kidney or heart conditions, foot symptoms) and are listed first. A patient learns a little at a time instead of facing a wall of information.
Emergency
One button, always visible, in the same place on every screen. It calls first and asks questions after. Red-flag checklists cover heart signs, stroke signs, severe low sugar, very high sugar and serious foot signs. Emergency or self-harm words typed into any free-text box go straight to the emergency screen. A trusted person can be called, messaged on WhatsApp or texted in one tap.
In an emergency there is no model. Just rules, and a button that says 999.
How Gemma is used, and what for
Gemma gemma-4-26b-a4b-it is called through the Gemini API. It has four narrow, text-only jobs, all about understanding people who write the way they speak, in Bangla or English:
| Job | What Gemma does | What keeps it safe |
|---|---|---|
| Symptom routing | Reads a free-text description and picks the one matching symptom module | Output must be one of our module keys, otherwise it is discarded and a keyword fallback runs |
| “Other” answers | Maps a free-text answer to the closest fixed option | Same validation. If nothing maps, the text is kept verbatim and never interpreted |
| Food parsing | Finds which foods from our list a person ate | Local matching runs first. Gemma is used only when nothing matched, and only ids from our list are accepted |
| Plain-language explanations | Rephrases a static fact sheet for people with low health literacy, in Bangla or English | It may use only that text. No new facts, numbers, doses or diagnosis. The screen labels it as AI-rephrased |
Guardrails around every call:
- The prompt states the safety rules and treats user text as data, not instructions.
- Input is capped, output is validated against allowed values, results are cached, and failures trigger a cooldown.
- A quota error pauses AI features for a few hours and shows a clear message. Everything else keeps working.
- If Gemma is unavailable, the app still works end to end with rule-based fallbacks.
- No safety decision depends on the model.
Why open innovation matters here
- Auditable. You can’t audit a black box. You can audit a repo. The rules, thresholds and prompts are readable, and every clinical constant is marked for a clinician to review.
- Private by design. Open weights mean a clinic can host the model itself. The app stores nothing between sessions: data stays in the session, and users export or import their own profile file.
- Adaptable. Clinics, NGOs and community health workers can change the language, content, thresholds and modules without asking anyone’s permission.
Impact
- Health guidance in Bangla, with Bangla script and numerals throughout, not a translation layer.
- Protects the riskiest moment (insulin without a meal) with a screen that refuses to guess.
- Turns vague worries into specific written questions, so the doctor’s five minutes count.
- Less panic, more useful conversations: the app names alternative explanations before suggesting a cause.
- Built for low health literacy: short sentences, everyday comparisons and a glossary.
Safety and honesty
- It does not diagnose, and does not suggest, calculate or change any medicine or insulin dose.
- It never decides an emergency with AI.
- It is a prototype: not clinically validated and not a substitute for a doctor. The in-app disclaimer says so on every screen.
Tech stack
Python and Streamlit, Google Gemma through the Gemini API (google-genai), and plain-Python rule engines. Content lives in data files, separate from logic, so it can be translated or reviewed independently.
How this maps to the challenges
Best Open-Source AI Project
- Open-weight Gemma is central to how input is understood.
- Public repository with an open-source license, with the model, provider and dependencies documented.
Best Use of Gemma
- Gemma is the only AI model in the project, called through the Gemini API.
- Four purpose-built uses, each validated, cached and degradable.
- Bangla-language understanding is a core use, not an add-on.
We’re not replacing the doctor. We’re making sure the five minutes count.
Author
Farhan Bin Mir Hassan, student at United International University, Bangladesh.
Built with
AI tools
Prize Categories Entered
- Submitted
Best Use of Gemma 4
- Submitted

Best Open-Source AI Project