Gestational diabetes mellitus (GDM) is associated with an increased risk of developing type 2 diabetes mellitus (T2DM). The inflammatory potential of diet is crucial in GDM development. This study compares dietary inflammatory indices (DII) in females with and without a history of GDM and constructs a predictive model for prediabetes risk. Cross-sectional data from NHANES cycles (2011-2014) were analyzed using the DII. Independent t tests, chi-square test, and Mann-Whitney U test examined DII scores in relation to GDM history. Multivariate logistic regression assessed DII's association with prediabetes in females with GDM history. Restricted cubic spline (RCS) and LASSO regression modeled non-linear relationships and predicted prediabetes risk. 971 female participants were included. Those with GDM history had lower DII scores (1.62 (0.58, 2.93) vs. 2.05 (0.91, 2.93)). Higher DII scores in females with GDM were linked to prediabetes, remaining significant after adjusting for confounders. RCS analysis found no non-linear correlation (non-linear p = 0.617). The prediabetes model for GDM history had strong predictive performance (AUC = 88.6%, 95% CI: 79.9-97.4%). Females with GDM history show lower DII levels, potentially reflecting improved diet and health awareness. Higher DII scores correlate with increased prediabetes risk in this group, emphasizing diet's role in diabetes risk. Further studies are needed to confirm these findings.