Abstract Recent optimization methods have demonstrated the potential to maximize marginal profits in beef (Marques et al., 2020) and dairy (Campos et al., 2023) by optimizing diet formulation. These methods present an opportunity to explore how diets could be optimized for individual dairy cows, such as in a closed-loop precision feeding system. Therefore, our objectives were to 1) compare individual income over feed costs (IOFC), calculated with observed dry matter intake (DMI), milk yield (MY), milk protein and milk fat, with a predicted IOFC for the same diet and cows using the NASEM (2021) model, and 2) optimize the inclusion rate of ingredients in the diet to maximize predicted IOFC. Previously, 20 multiparous (lactation 2 through 4) and 9 primiparous cows, ranging from 22 to 472 d in milk (DIM), were housed in a free-stall pen at the Ontario Dairy Research Centre (Canada) equipped with sensors to record DMI, body weight (BW; walk-over-weight) and body condition score (BCS; DeLavel 3D camera), in addition to daily MY, weekly milk component tests, and 4 X/d respiratory gas exchange measurements (GreenFeed, C-Lock Inc, USA) for estimation of daily energy flows (Kedzierski, 2020). Weekly means for each cow were used to evaluate IOFC in this study (n = 116). Each IOFC was calculated as milk revenue minus total feed cost. Milk revenue was calculated from milk fat, protein and other solids, consistent with pricing on Canadian dairy farms. The observed IOFC was calculated using the observed MY, milk components and DMI, and the same diet formulation and costs for all cows, whereas the predicted IOFC estimated these values using the NASEM (2021) model with all available observed animal inputs (e.g., BW, BCS, DIM). However, the observed DMI and MY had to be provided initially for the model, as the DMI prediction equation requires a target MY, but the prediction of MY requires DMI. Final predicted DMI and MY values were used in the calculation of predicted IOFC. The differential evolution algorithm from the ‘SciPy’ package (v 1.11.4) in python (v 3.12.0) was used to maximize IOFC by adjusting the inclusion of wheat straw, alfalfa silage, corn silage and high moisture corn grain, while fixing minerals to their original proportions. Overall, the concordance correlation coefficient (CCC) indicated moderate agreement (0.62) between the predicted IOFC and observed IOFC and good agreement (0.99) between the predicted IOFC and the optimized IOFC, suggesting the optimization method was able to select diets to meet a similar objective. Results indicate that a strategy is needed to minimize the residual error between predicted and observed values for individual cows, such as algebraic reparameterization of the NASEM model, before using an optimization method to automatically formulate diets.