Aid agencies implement food aid programs to alleviate chronic hunger. These agencies can choose direct, in‐kind distribution of food commodities, or they can provide cash or vouchers. To determine which aid modality to use for distributing aid, organizations currently use decision trees or other guidelines. In this study, we present a novel mathematical formulation to determine the optimal approach for allocating modalities and quantities of aid to beneficiaries, while also considering the beneficiaries’ needs and preferences. This also enables aid agencies to estimate the benefits of their programs for all stakeholders (i.e., beneficiaries, local retailers, and the organization) and help them design more tailored programs. The proposed model has three objectives to assess potential solutions: program costs, beneficiaries’ nutrition levels, and economic contributions to the local economy. The beneficiaries’ consumption behavior is incorporated into the model through a bilevel optimization structure to capture and prevent inefficient cash use by beneficiaries. We validate the model using data from the World Food Programme’s operations in Garissa County, Kenya. We analyze how robustly our solution handles possible variations in different cost parameters, including food commodity prices and operational costs. Finally, we demonstrate how to use the model to evaluate policies intended to improve program outcomes, such as educating beneficiaries about nutrition or fortifying grains available locally. Our results show that a modality’s effectiveness depends on the population and market characteristics, and no modality should be presumed superior to another without in‐depth analyses.