We proposed a modeling framework that combines NIRS and LCA to improve the environmental sustainability of feed production. Our framework overcomes the drawbacks of seasonal and other variability in agricultural ingredients when designing feeds, as it enables the optimization of mixture ratios for ingredients under real-time variability. Additional goals, such as social sustainability or customer demand, may be further implemented. The approach presented here may be ultimately leveraged for diverse commodities, including food and other biobased commodities, providing a unique opportunity to increase sustainability throughout the agri-food system.