Skip to content
0xdeadf1shPublic

Latest commit

 

History

525 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

T1DMDROID

An Android testbed for biohackers and researchers who run and test machine-learning models on blood glucose. It reads up to four CGMs at once (AiDEX X / LinX, Anytime CT5, Libre 3) over Bluetooth LE and runs your ExecuTorch models on their live output, on the phone. Android 12+, arm64 and x86_64, sideloaded.

Caution

Research use only. It is not a medical device and not clinically validated. Its forecasts and calculators may be wrong and must not be used for medical or dosing decisions, nor to replace a real CGM, its official app, or professional care. No warranty, no liability.

Video Gallery

tall_blood_sugar_graph_that_shows_iob_and_cob.mp4

Readings, the forecast band, and carbohydrate and insulin curves on one graph.
read_from_multiple_sensors_at_once.mp4

Up to four CGMs read at once and recorded side by side.
paint_on_the_blood_sugar_graph.mp4

Freehand drawing on the graph.
drive_on_your_blood_sugar_curve.mp4

Minigames played on the glucose trace.
autoregressive_rolling_for_long_horizon_predictions.mp4

Extends the forecast past the model's horizon by feeding it back in.
see_previous_predictions_with_hindsight_mode.mp4

Scrub through past forecasts against the readings that followed.
test_infilling_capabilities_of_prediction_models.mp4

The model fills gaps in the sensor record.
visualize_model_time_output.mp4

The model's estimate of the hour of day, against the local clock.
advanced_model_evaluation.mp4

Backtests, accuracy, calibration, and Clarke and DTS error grids.
lora_finetuning.mp4

Train LoRA adapters on the phone for forecasting, infilling or backcasting.
log_carbohydrates.mp4

Meals, with a carbohydrate appearance curve you can draw.
log_insulin.mp4

Insulin doses, with an action curve you can draw.
advanced_blood_sugar_statistics.mp4

Time in range, GMI, CV, LBGI/HBGI, ADRR and MAGE.
advanced_settings_panel.mp4

Targets, alarms, dose rails, display and backups.

More

  • Alarms: out-of-range and loss-of-signal.
  • Nightscout: uploads readings.
  • Watch link: pushes readings and forecasts over encrypted BLE to T1DMKDE (desktop) and T1DMAUTO (car head unit).
  • Backup: export and restore as one gzipped JSON file.

Your own model

Export an ExecuTorch .pte for the XNNPACK backend and its descriptor, as T1DMAI does, and push both:

adb push my.xnnpack.pte my.descriptor.json /sdcard/Android/data/com.t1dm.app.pub/files/models/

Each descriptor in that folder loads as one model. Its artifact key names the .pte; without it, <id>.xnnpack.pte.

Building

Android SDK 36 and the NDK, JDK 21, and Rust with the aarch64-linux-android and x86_64-linux-android targets and cargo-ndk on PATH.

./gradlew :app:assemblePublicRelease

Running on Xiaomi HyperOS / MIUI

  • Settings → Apps → T1DMDROID: Autostart on, battery No restrictions, Pause app activity if unused off.
  • System Bluetooth app: battery Unrestricted.
  • Recents: lock the app's card.
  • Lock-screen glucose: adb shell settings put secure lock_screen_show_silent_notifications 1

Related projects

  • T1DMSIM: the simulator whose synthetic traces pretrain the model.
  • T1DMAI: trains the model and exports it to ExecuTorch.

License

MIT. See LICENSE.

Contributors

Languages