A device and a method for prevention of hypoglycemia are disclosed. In one aspect, the device and the method for prevention of hypoglycemia can comprise receiving a target blood glucose (TBG) level corresponding to a desired level of glucose in a patient's body during a fasting time period; receiving a bedtime blood glucose (BBG) level corresponding to a level of glucose in the patient's body substantially at a beginning of the fasting time period (e.g. before bedtime); receiving a first set of parameters corresponding to a medical state of the patient; determining a therapeutic course of action based on the levels of the TBG, BBG and the medical state of the patent; and administering the therapeutic course of action to the patient.