This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend.
If you have ever shared an apartment with someone managing Type-1 Diabetes, you know the sound.
It is 3:15 in the morning. The apartment is dead quiet. Suddenly, a high-pitched, warbling siren pierces through the drywall. It is not a smoke detector and it is not an alarm clock. It is the urgent low siren from a Continuous Glucose Monitor (CGM).
My roommate and close friend, Liam Vance, has lived with Type-1 Diabetes since middle school. He wears a Dexcom G7 sensor on the tricep of his left arm. Every five minutes, like clockwork, the tiny subcutaneous filament measures the interstitial glucose in his tissue and beams a number over Bluetooth to his phone.
They sound their alarm only after blood glucose has already tumbled past the critical safety floor of 70 mg/dL.
By the time Liam wakes up at 3:18 AM, he is already experiencing acute neuroglycopenia. His brain is literally starved of glucose. He sits up drenched in cold sweat, his heart pounding at 135 beats per minute, his hands shaking so violently he can barely grip a spoon. In that state of fog and disorientation, he has to stumble into our kitchen, open the refrigerator, and calculate how many grams of fast-acting carbohydrates to swallow.
Guess too low, and he slips into a seizure. Guess too high, and he triggers an agonizing rebound spike past 300 mg/dL that wrecks his body for the entire next day.
Last week, after a late-evening workout triggered a brutal 46 mg/dL crash that kept us awake until dawn, Liam leaned against the kitchen counter and whispered something that never left my mind:
"The injections and the carb counting are fine. What wears you down is turning off the bedside lamp every night, never knowing if your body is going to betray you while you are asleep."
I asked him why he didn't feed his historical Dexcom CSV exports into an AI model to catch these patterns before going to bed.
He was right. Liam's blood sugar logs, his bolus insulin doses, his meals, his workout heart rates, and his alcohol consumption are his most sensitive biometrics. Uploading his daily medical history to a closed cloud LLM endpoint is an unacceptable invasion of personal privacy.
Besides, large language models are autoregressive text tokenizers. They cannot compute exact non-linear pharmacokinetic lag times or calibrated Bayesian probabilities from tabular columns.
I decided to build the guardian Liam needed. An algorithm that runs 100% locally on his machine, looks at his evening metrics at 10:00 PM before he turns off the light, and forecasts whether he will crash at 3:00 AM with zero cloud exposure.
To understand why simple threshold alarms fail, you have to look at the delayed biological dynamics of diabetes.
When Liam checks his Dexcom app at 10:00 PM, he might see 120 mg/dL with a flat trend arrow (→). To any casual observer, 120 mg/dL is a textbook "in-range" bedtime reading.
Yet underneath the skin, three invisible physiological time-bombs might be ticking simultaneously:
A standard CGM cannot connect these dots because it only looks at the immediate derivative of current blood sugar. Linear regression cannot handle the exponential decay of active insulin combined with delayed glycogen repletion.
Worse, Liam only has 90 days of structured daily logs. In machine learning terms, that is a tiny tabular dataset of roughly 90 rows.
