Predicting ecosystem function from environmental conditions is a central goal of ecosystem ecology. However, many traditional ecosystem models are tailored for specific regions or ecosystem types, requiring several regional models to predict the same function. Alternatively, trait-based approaches have been effectively used to predict community structure in both terrestrial and aquatic environments and ecosystem function in a limited number of terrestrial examples. Here, we test the efficacy of a trait-based model in predicting gross primary production (GPP) in lake ecosystems. We incorporated data from >1000 United States lakes along with laboratory-generated phytoplankton trait data to build a trait-based model of GPP and then validated the model with GPP observations from a separate set of globally distributed lakes. The trait-based model performed as well as or outperformed two ecosystem models both spatially and temporally, demonstrating the efficacy of trait-based models for predicting ecosystem function over a range of environmental conditions.