Processing domestically available materials for export has intuitive appeal, e.g. if transport costs are reduced. Uncertainty in the supply of the raw material can be a crucial factor. The theoretical model of this paper shows how to choose the optimal processing capacity and, relatedly, the optimal price to pay producers of the input. Issues include: decision makers' preferences; sources and nature of uncertainty; availability of inputs to produce the raw material; and technology and costs of processing. Econometric estimates of the climate-yield relation are used to simulate these decisions for the case of Senegalese groundnut processing. There is an intuitive appeal to industrial strategies based on processing domestically available raw materials for export. For instance, relative to export of the raw material for processing abroad, domestic processing often achieves cost savings based on certain locational advantages, such as the opportunity to decrease the product's weight prior to transport.' In this paper, I analyse the costs and benefits of investing in processing capacity under particular conditions, and the related question of the appropriate domestic pricing of the raw material. The second part of the paper presents an application of the theory to Senegalese groundnut culture and processing. Especially for agricultural inputs, the domestic supply of the raw material is likely to be uncertain. This uncertainty interacts with locational advantages in important ways affecting both the optimal choice of agro-industrial processing capacity and the optimal choice of the price to be offered agricultural producers of the input. From the viewpoint of the processing mills, the locational advantage means that stochastically low availability of the raw material cannot be (fully) compensated by imports. Thus, the problem of idle processing capacity arises. Similarly, harvests of the input above the level that can be processed imply some loss of the locational advantages, assuming that the input cannot be stored costlessly. To illustrate these basic notions, consider the simplest case of a single input with a given world price, pj, transformed at a constant unit cost, r, into an output with a given world price, p. Let the size of the crop also be certain, say of magnitude m. So long as (p -pI) _ r, optimal processing capacity is m. Now consider a situation of uncertainty with two equiprobable states of nature faced