The purpose of this study was to investigate the predictive value of Pan-Immune-Inflammation Value (PIV) combined with the PILE score for immunotherapy in patients with advanced non-small cell lung cancer (NSCLC) and to construct a nomogram prediction model to provide reference for clinical work. Patients with advanced NSCLC who received ICIs treatment in Qingdao Municipal Hospital from January 2019 to December 2021 were selected as the study subjects. The chi-square test, Kaplan-Meier survival analysis, and Cox proportional risk regression analysis were used to evaluate the prognosis. The results were visualized by a nomogram, and the performance of the model was judged by indicators such as the area under the subject operating characteristic curve (AUC) and C-index. The patients were divided into high- and low-risk groups by PILE score, and the prognosis of patients in different risk groups was evaluated. Multivariate Cox regression analysis showed that immune-related adverse events (irAEs) were prognostic factors for overall survival (OS) improvement, and ECOG PS score ≥2, bone metastases before treatment, and high PIV expression were independent risk factors for OS. The C index of OS predicted by the nomogram model is 0.750 (95% CI: 0.677-0.823), and the Calibration and ROC curves show that the model has good prediction performance. Compared with the low-risk group, patients in the high-risk group of PILE were associated with a higher inflammatory state and poorer physical condition, which often resulted in a poorer prognosis. PIV can be used as a prognostic indicator for patients with advanced NSCLC treated with ICIs, and a nomogram prediction model can be constructed to evaluate the survival prediction of patients, thus contributing to better clinical decision-making and prognosis assessment.