BackgroundCoronary atherosclerotic heart disease (CHD) is highly prevalent in Northwest China; however, effective preventive measures are limited. This study aimed to develop metabolic risk models tailored for the primary and secondary prevention of CHD in Northwest China. MethodsThis hospital-based cross-sectional study included 744 patients who underwent coronary angiography. Data on demographic characteristics, comorbidities, and serum biochemical indices of the participants were collected. Three machine learning algorithms—recursive feature elimination, random forest, and least absolute shrinkage and selection operator—were employed to construct risk models. Model validation was performed using receiver operating characteristic and calibration curves, and the optimal cutoff values for significant risk factors were determined. ResultsThe predictive model for CHD onset included sex, overweight/obesity, and hemoglobin A1c (HbA1c) levels. For CHD progression to multiple coronary artery disease, the model included age, total cholesterol (TC), low-density lipoprotein cholesterol (LDL-C), and HbA1c levels. The model predicting an increased coronary Gensini score included sex, overweight/obesity, TC, LDL-C, high-density lipoprotein cholesterol, lipoprotein(a), and HbA1c levels. Notably, the optimal cutoff values for HbA1c and lipoprotein(a) for determining CHD progression were 6 % and 298 mg/L, respectively. ConclusionsRobust metabolic risk models were established, offering significant value for both the primary and secondary prevention of CHD in Northwest China. Weight loss, strict hyperglycemic control, and improvement in dyslipidemia may help prevent or delay the occurrence and progression of CHD in this region.