We consider the problem of allocating demand arising from multiple products to multiple production facilities with finite capacity and load-dependent lead times. Production facilities can choose to manufacture items either to stock or to order. Products vary in their demand rates, holding and backordering costs, and service-level requirements. We develop models and solution procedures to determine the optimal allocation of demand to facilities and the optimal inventory level for products at each facility. We consider two types of demand allocation, one in which we allow the demand for a product to be split among multiple facilities and the other in which demand from each product must be entirely satisfied by a single facility. We also consider two forms of inventory warehousing, one in which inventory locations are factory based and one in which they are centralized. For each case, we offer a solution procedure to obtain optimal demand allocations and optimal inventory base-stock levels. For systems with multiple customer classes, we also determine optimal inventory rationing levels for each class for each product. We use the models to characterize analytically several properties of the optimal solution. In particular, we highlight eight principles that relate the effects of cost, congestion, inventory pooling, multiple sourcing, customer segmentation, inventory rationing, and process and demand variability.production/inventory systems, queueing systems, generalized assignment problem, multi-item/multifacility systems