Type 2 Diabetes (T2D) is a major public health concern. We have previously shown that the biochemical functions of the gut microbiome contribute to the postprandial glucose response and built a machine learned (ML) model that can personalize dietary choices using a stool metatranscriptomic test. We integrated this data-driven personalized nutrition process into the Viome Precision Nutrition Program (VPNP), which includes sample collection kits (capillary blood and stool), an AI/ML nutritional recommendation engine, and an app for digital delivery of dietary recommendations. To test the efficacy of VPNP, we conducted a decentralized, blinded, randomized, placebo-controlled trial in a prediabetic and diabetic adult population in the USA, with HbA1c as the primary endpoint. For this pilot trial, we recruited 27 participants and randomized them into two arms. The placebo arm included sample collection, digital delivery of the USDA dietary recommendations, and physical delivery of supplements filled with inert material. The VPNP (interventional) arm included digital delivery of data-driven and personalized dietary recommendations, and physical delivery of precision supplements. The nutritional intervention lasted ~90 days. The ANCOVA analysis method was employed to control for potential confounders measured at baseline. VPNP intervention (n=12) reduced HbA1c more than the placebo (n=15) in a clinically significant manner (HbA1c difference of 0.42%, p = 0.028). We demonstrate that a precision nutrition program based on stool and blood metatranscriptomic data and AI/ML analyses can significantly reduce HbA1c relative to USDA recommended nutrition in a prediabetic and diabetic population. These results suggest that integrating data-driven precision nutrition into the healthcare system could reduce the burden of T2D.