Gastric cancer can lead to excessive catabolism in patients. After undergoing gastric surgery, patients may experience additional unintended weight loss, resulting in severe malnutrition and potentially cachexia. We selected and incorporated patients from two centers. Cohort 1 (n = 1393) served as the development cohort, while cohort 2 (n = 501) was designated as an external validation cohort. Within cohort 1, 70% of the patients were utilized for model training, with the remaining 30% reserved for internal validation. The training set initially underwent univariate logistic regression, followed by multivariate logistic regression. The factors ultimately incorporated were used to construct the model and create nomograms. The discriminative ability was assessed using ROC curves in all three datasets, calibration curves were used to evaluate consistency, and decision curves analysis was performed to assess the clinical application value. The model incorporated 12 factors, specifically: age (OR = 1.07), preoperative BMI (OR = 0.89), surgery type (Total Gastrectomy (TG), OR = 1.83), chemotherapy (yes, OR = 1.52), stage (III, OR = 1.40), anastomotic obstruction (yes, OR = 6.85), Postsurgical Gastroparesis Syndrome (PGS) (yes, OR = 2.27), albumin (OR = 0.95), hemoglobin (OR = 0.98), triglycerides (OR = 0.36), CRP (OR = 1.07), and Neutrophil to Lymphocyte Ratio (NLR) (OR = 1.05). The model demonstrated robust performance in ROC with AUC values of 0.805 in the training set, 0.767 in the validation set, and 0.795 in Cohort 2. Calibration curves in all three datasets exhibited a high degree of concordance between actual and predicted probabilities. Decision curve analysis (DCA) indicated that the model holds substantial clinical utility across all three datasets. We have developed a predictive model for cachexia in patients undergoing gastric cancer surgery. This model enables healthcare professionals to accurately estimate the risk of cachexia in postoperative patients with nutritional deficits, allowing for timely nutritional interventions to enhance patient quality of life and prognosis.