AIMS: To develop a machine learning model for predicting weight loss response to metformin in Chinese patients with type 2 diabetes. METHODS: Data were obtained from three Chinese randomized controlled trials (RCT) screening newly diagnosed diabetes patients who received metformin monotherapy. Multiple machine learning methods, including gradient boosting regressor (GBR), were used to predict weight loss at the end of treatment based on baseline clinical characteristics and weight data collected at baseline and after up to weeks 4, 8, or 12. GBR was identified as the optimal model on the validation set according to minimum Mean Absolute Error (MAE) for subsequent analyses. Model performance on predicting categorical weight loss at 3% or 5% was measured using classification metrics, including the area under the curve (AUC), accuracy, sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV). RESULTS: Three trials with a total of 1325 individuals with diabetes were pooled in the final analysis. We randomly selected 1126 individuals for the training and the validation group and 119 for the test group. In the test set, all AUC values exceeded 0.71 (with a maximum of 0.83). Additionally, the precision improved when weight data from the 4, 8, and 12-week time points were included in the training group. An online web-based tool was constructed based on the machine learning prediction model. CONCLUSIONS: The developed machine learning model can be used to predict the individual weight loss responses to metformin and provide new insights for clinical practice regarding weight management in Chinese patients with diabetes.