In this study, we show how NIRS and LCA can be combined to integrate environmental impacts in a transparent optimization framework that can be used to formulate feed mixtures that meet the desired livestock feed quality while minimizing monetary and environmental costs. Predictive machine learning models can be used to link chemical information to relevant feed ingredients properties, such as ingredient-specific nutritional compositions and geographical origin . Having both quality information and origin as intrinsic properties of the feed ingredients allows us to optimize the performance of industrial feed production in economic, environmental and quality terms in real time.