Bi-level programming offers a modeling approach for solving problems that involve two decision makers, each with their own objective. This research addresses a bi-level programming application to multihead, vertical, and diagonal double-layered machines. In these machines, hoppers are distributed across two levels: the upper level consists of weighing hoppers that weigh the product coming from the feeding hoppers. The weighed product is then deposited into the hoppers on the lower level, known as booster hoppers, located beneath them in a vertical or diagonal position, depending on the machine type. Simultaneously, they receive a new product to weigh. In the proposed model, weighing hoppers are associated with the leader’s decision variables and optimize the target weight, ensuring it is as close as possible to the weight stated on the label, while also being higher. Meanwhile, booster hoppers are assigned to the follower’s decision variables, optimizing hopper priority. Hopper priority is measured by the time elapsed from the moment the product arrives at the weighing hoppers until it is loaded onto a pack (measured in the number of processed packs). This model has been tested with different filling and combination strategies, considering factors such as the number of heads in the machine, product type (fusilli and ravioli), among others. The results demonstrate that the model successfully reduces the standard deviation of the produced packages for specific combinations of factors. Furthermore, it was observed that response times on each machine increase as the number of heads or the number of hoppers to be combined grows. This is a result of the increased number of combinations required to find the optimal solution. However, this heightened complexity leads to greater effectiveness and more accurate results in terms of the precision of the content delivered to the customer. The proposed solution methodology identifies the optimal machine configuration for minimizing weight deviation in each package. Additionally, it prioritizes the utilization of machines in the lower level of decisions. Consequently, we achieve optimal operating conditions that minimize package overweight, material overcost, and appropriately select the weighing machines. Managerial insights are provided to underscore that customer satisfaction and improved business performance are outcomes of this study.