The gut microbiota has the potential to influence the efficacy of cancer therapy. Here, we investigated the contribution of the intestinal microbiome on treatment outcomes in a heterogeneous cohort that included multiple cancer types to identify microbes with a global impact on immune response. Human gut metagenomic analysis revealed that responder patients had significantly higher microbial diversity and different microbiota compositions compared to non-responders. A machine-learning model was developed and validated in an independent cohort to predict treatment outcomes based on gut microbiota composition and functional repertoires of responders and non-responders. Specific species, Bacteroides ovatus and Bacteroides xylanisolvens, were positively correlated with treatment outcomes. Oral gavage of these responder bacteria significantly increased the efficacy of erlotinib and induced the expression of CXCL9 and IFN-γin a murine lung cancer model. These data suggest a predictable impact of specific constituents of the microbiota on tumor growth and cancer treatment outcomes with implications for both prognosis and therapy.