Chronic postsurgical pain (CPSP) after hepatectomy is highly prevalent and challenging to treat. Several risk factors have been unmasked for CPSP after hepatectomy, such as acute postoperative pain. The current secondary analysis of a clinical study sought to extend previous research by investigating more clinical variables and inflammatory biomarkers as risk factors for CPSP after hepatectomy and sifting those strongly related to CPSP to build a reliable machine learning model to predict CPSP occurring. Participants included 91 adults undergoing hepatectomy who was followed 3 months postoperatively. Twenty-four hours after surgery, participants completed numerical rating scale (NRS) grading and blood sample collecting. Three months after surgery, participants also reported whether CPSP occurred through follow-up. The Random Forest and Support Vector Machine models were conducted to predict pain outcomes 3 months after surgery. The results showed that the SVM model had better performance in predicting CPSP which consists of acute postoperative pain (evaluated by NRS) and matrix metalloprotease 3 (MMP3) level. What's more, besides traditional cytokines, several novel inflammatory biomarkers like C-X-C motif chemokine ligand 10 (CXCL10) and MMP2 levels were found to be closely related to CPSP and a novel spectrum of inflammatory biomarkers was created. These findings demonstrate that the SVM model consisting of acute postoperative pain and MMP3 level predicts greater chronic pain intensity 3 months after hepatectomy and with this model, intervention administration before CPSP occurs may prevent or minimize CPSP intensity successfully.