Bacteriocins, toxic peptides involved in the competition between bacterial strains, are extremely diverse. Previous work on bacteriocin dynamics has highlighted the role of non-transitive ‘rock–paper–scissors’ competition in maintaining the coexistence of different bacteriocin profiles. The focus to date has primarily been on bacteriocin interactions at the within-host scale (i.e. within a single bacterial population). Yet in species such as
Streptococcus pneumoniae
, with relatively short periods of colonization and limited within-host diversity, ecological outcomes are also shaped by processes at the epidemiological (between-host) scale. Here, we first investigate bacteriocin dynamics and diversity in epidemiological models. We find that in these models, bacteriocin diversity is more readily maintained than in within-host models, and with more possible combinations of coexisting bacteriocin profiles. Indeed, maintenance of diversity in epidemiological models does not require rock–paper–scissors dynamics; it can also occur through a competition–colonization trade-off. Second, we investigate the link between bacteriocin diversity and diversity at antibiotic resistance loci. Previous work has proposed that bacterial duration of colonization modulates the fitness of antibiotic resistance. Due to their inhibitory effects, bacteriocins are a plausible candidate for playing a role in the duration of colonization episodes. We extend the epidemiological model of bacteriocin dynamics to incorporate an antibiotic resistance locus and demonstrate that bacteriocin diversity can indeed maintain the coexistence of antibiotic-sensitive and -resistant strains.