Pyroptosis plays a critical role in the immune response to immune checkpoint inhibitors (ICIs) by mediating the tumor immune microenvironment. However, the impact of pyroptosis-related biomarkers on the prognosis and efficacy of ICIs in patients with lower-grade gliomas (LGGs) is unclear. An unsupervised clustering analysis identified pyroptosis-related subtypes (PRSs) based on the expression profile of 47 pyroptosis-related genes in The Cancer Genome Atlas-LGG cohort. A PRS gene signature was established using univariate Cox regression, random survival forest, least absolute shrinkage and selection operator, and stepwise multivariable Cox regression analyses. The predictive power of this signature was validated in the Chinese Glioma Genome Atlas database. We also investigated the differences between high- and low-risk groups in terms of the tumor immune microenvironment, tumor mutation, and response to target therapy and ICIs. The PRS gene signature comprised eight PRS genes, which independently predicted the prognosis of LGG patients. High-risk patients had a worse overall survival than did the low-risk patients. The high-risk group also displayed a higher proportion of M1 macrophages and CD8+ T cells and higher immune scores, tumor mutational burden, immunophenoscore, IMmuno-PREdictive Score, MHC I association immune score, and T cell-inflamed gene expression profile scores, but lower suppressor cells scores, and were more suitable candidates for ICI treatment. Higher risk scores were more frequent in patients who responded to ICIs using data from the ImmuCellAI website. The presently established PRS gene signature can be validated in melanoma patients treated with real ICI treatment. This signature is valuable in predicting prognosis and ICI treatment of LGG patients, pending further prospective verification.