The prediction of medication nonadherence among patients with T2DM can be improved in accuracy and speed using machine learning (ML). This study aimed to develop an ML model to predict the risk of medication nonadherence among patients with T2DM. Methods, inclusion criteria comprised English-language, open-access journal articles published between 2020 and 2025 that developed and validated ML–based prediction models, including ensemble methods, gradient-boosting models, SVMs, and neural networks. Exclusion criteria included review articles, non-English papers, studies published before 2020, studies lacking prediction model development or validation, and studies using only traditional statistical methods, such as logistic regression. The article search was conducted in PubMed, Scopus, ScienceDirect, and Google Scholar. Prediction Model Risk of Bias Assessment Tool (PROBAST) to assess the methodological quality and usefulness of the qualified studies. This narrative synthesis examines the characteristics of ML-based prediction models, their performance, and the factors that predict adherence among patients with T2DM. The papers were sourced from various scientific journal databases. The results show that cross-sectional and cohort studies were among the research designs used in the five papers reviewed. The AUROC of the internal test was 0.782, and the AUROC of the external test was 0.771. The learned-feature classification model achieved an average accuracy of 79.7%. Among these algorithms, the AUC of the best-performing algorithm was 0.866 ± 0.082. The SVM classifier outperformed the others, achieving a recall of 0.9979 and an AUC of 0.9998. The conclusion indicates that predictive capacity is influenced by clinical metrics and the number of prescribed medications.