Nonribosomal peptide synthetases (NRPSs) generate the core peptide scaffolds of many natural products. These include small cyclic dipeptides such as the insect feeding deterrent peramine, which is a pyrrolopyrazine (PPZ) produced by grass-endophyticEpichloëfungi. Biosynthesis of peramine is catalyzed by the 2-module NRPS, PpzA-1, which has a C-terminal reductase (R) domain that is required for reductive release and cyclization of the NRPS-tethered dipeptidyl-thioester intermediate. However, some PpzA variants lack this R domain due to insertion of a transposable element into the 3′ end ofppzA. We demonstrate here that these truncated PpzA variants utilize nonenzymatic cyclization of the dipeptidyl thioester to a 2,5-diketopiperazine (DKP) to synthesize a range of novel PPZ products. Truncation of the R domain is sufficient to subfunctionalize PpzA-1 into a dedicated DKP synthetase, exemplified by the truncated variant, PpzA-2, which has also evolved altered substrate specificity and reducedN-methyltransferase activity relative to PpzA-1. Further allelic diversity has been generated by recombination-mediated domain shuffling betweenppzA-1andppzA-2, resulting in theppzA-3andppzA-4alleles, each of which encodes synthesis of a unique PPZ metabolite. This research establishes that efficient NRPS-catalyzed DKP biosynthesis can occur in vivo through nonenzymatic dipeptidyl cyclization and presents a remarkably clean example of NRPS evolution through recombinant exchange of functionally divergent domains. This work highlights that allelic variants of a single NRPS can result in a surprising level of secondary metabolite diversity comparable to that observed for some gene clusters.