This cross-sectional study in Tanzania identified three dietary patterns among adults with and without HIV: a vegetable-rich pattern (VRP), a vegetable-poor pattern (VPP), and a carbohydrate-dense pattern (CDP). Higher adherence to VRP was associated with lower odds of diabetes but higher odds of prediabetes, while CDP was linked to increased prediabetes risk. The findings highlight that dietary patterns affect prediabetes and diabetes differently in this population, with implications for nutrition counseling in sub-Saharan Africa.