跳到正文
DEV Community· Abdul Khadar·· 3 小時前AI 評分46

DoseBuddy:為 Amma 設計的懶人服藥排程工具(貼上一次,之後毋須操心)

DoseBuddy: A lazy medicine scheduler for Amma (paste once, never think about it again)

AI 導讀

DoseBuddy 是一款離線服藥排程工具,用戶貼上處方內容後,便可整理早、午、晚藥物安排及提醒。它透過 Ollama 運行本地模型 qwen2.5:1.5b-instruct(亦可設定 gemma2:2b)解析處方,再以 Python 規則檢查藥物衝突;Ollama 未運行時會改用規則式解析器。健康資料保留在本機,藥物安排可在儲存前編輯,亦可列印或透過 WhatsApp 分享。

正文

Abdul Khadar

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

My Amma takes multiple daily prescriptions across different conditions—blood pressure, thyroid, and calcium supplements. Managing distinct pill timings, coordinating meals, and worrying about clashing interactions was a daily cognitive load.

DoseBuddy is an offline, private medicine companion with one goal: make the person managing prescriptions do the least possible work.

Instead of manual sorting, you simply paste the doctor's prescription note or instructions once. DoseBuddy handles the rest automatically:

  • Big-Print Compartment View: Organizes medicines cleanly into Morning, Afternoon, and Night compartments designed for easy readability.
  • Deterministic Safety Engine: Detects clashes and contraindications (e.g., thyroid tablets clashing with calcium or iron within 4 hours).
  • Spoken Multilingual Reminders: Speaks out reminders in English, Hindi, and Malayalam using the browser's speech synthesis engine.
  • Tap-to-Tick Daily Tracker: A straightforward daily checklist showing what was taken and what's next.
  • Printable Fridge Sheet & WhatsApp Share: One click generates an instant printable fridge card or a formatted WhatsApp summary for family.

Demo

Not medical advice. DoseBuddy does not replace a doctor or pharmacist. Its interaction list is short and hand-written, so always confirm with a pharmacist.

Why

Prescriptions are often written in English or medical shorthand, and several medicines taken at once are easy to mix up. DoseBuddy turns a typed note into a schedule one person can read at a glance, and keeps their health data on their own computer.

Features

  • Paste once, get the plan. Morning, afternoon and night compartments in large print.
  • Safety checks that are not AI. Plain, testable Python flags clashes such as thyroid with calcium or iron, duplicates, and missing doses or times.
  • Review before trust. Every extracted medicine can be edited before the plan is made.
  • Tick off doses. Tap a medicine when taken…

(Live local server: http://127.0.0.1:8000 — works offline with zero installation steps).

You can run it in seconds:

git clone https://github.com/AbdulKhadhar/dosebuddy.git
cd dosebuddy
python -m dosebuddy

Code

Not medical advice. DoseBuddy does not replace a doctor or pharmacist. Its interaction list is short and hand-written, so always confirm with a pharmacist.

Why

Prescriptions are often written in English or medical shorthand, and several medicines taken at once are easy to mix up. DoseBuddy turns a typed note into a schedule one person can read at a glance, and keeps their health data on their own computer.

Features

  • Paste once, get the plan. Morning, afternoon and night compartments in large print.
  • Safety checks that are not AI. Plain, testable Python flags clashes such as thyroid with calcium or iron, duplicates, and missing doses or times.
  • Review before trust. Every extracted medicine can be edited before the plan is made.
  • Tick off doses. Tap a medicine when taken…
  • GitHub Repository: AbdulKhadhar/dosebuddy
  • License: MIT
  • Architecture: Zero external dependencies (standard library http.server, sqlite3, vanilla HTML/CSS/JS).

How I Built It

The core architectural principle of DoseBuddy is: Open-Source AI parses the notes, but pure deterministic code makes all safety decisions.

  1. Local Open-Weight Model (Inference via Ollama):
    • Uses local SLMs (defaulting to qwen2.5:1.5b-instruct, or customizable via DOSEBUDDY_MODEL=gemma2:2b) running via Ollama to translate unstructured, messy prescription notes into structured JSON.
    • Built with a fallback rule-based regex parser: if Ollama is not running, the application continues to function seamlessly without breaking.
  2. Deterministic Safety Rules (rules.py):
    • Contraindications and schedule clashes are evaluated using pure, test-covered Python functions.
    • Medicine groups and interaction pairs live in groups.json, allowing anyone to audit or add medications without writing code.
  3. Review-First UX:
    • Before any schedule is saved, the user reviews and edits the extracted items. Human-in-the-loop ensures complete accuracy.
  4. Zero-Cloud Stack:
    • Single-file web interface with glassmorphic cards and high-contrast typography, served locally via standard library Python.

Why Does Open Innovation Matter?

  • Medical Privacy by Default: Prescriptions and health data should never be sent to third-party proprietary LLM APIs or cloud databases. DoseBuddy keeps all data 100% on the user's local machine.
  • Zero Cost & Resilience: No API subscription tiers or token limits. It functions reliably during power outages and spotty internet connectivity.
  • Transparent, Auditable Safety: In closed models, reasoning is an unpredictable black box. With open innovation, our rule sets and local models can be inspected, vetted, and improved by doctors, pharmacists, and community developers.
  • Model Freedom: Users are not vendor-locked; they can switch between lightweight models like Gemma, Qwen, or Llama with a single environment flag.

The Lazy Payoff

  • Before: ~15–20 minutes of squinting at blister packs, flipping through handwritten doctor notes, cross-checking morning vs. evening doses, and scribbling on pillbox labels.
  • Now: A 5-second paste. DoseBuddy extracts the medicines, flags known clashes, and renders the day's schedule instantly.
  • Real-World Impact: Amma tested the schedule this week—the clear visual compartments and the Malayalam audio prompt meant she never had to ask "did I take the thyroid tablet already?"

Prize Categories

  • Slow and Steady (Local First & Privacy)
  • Best Use of Open Source AI

Team: Just me, @AbdulKhadhar.

來源:DEV Community · dev.to