Community assembly involves two antagonistic processes that select functional traits in opposite directions. Environmental filtering tends to increase the functional similarity of species within communities leading to trait convergence, whereas competition tends to limit the functional similarity of species within communities leading to trait divergence. Here, we introduce a new hierarchical Bayesian model that incorporates intraspecific trait variation into a predictive framework to unify classic coexistence theory and evolutionary biology with recent trait-based approaches. Model predictions exhibited a significant positive correlation (r = 0.66) with observed relative abundances along a 10 °C gradient in mean annual temperature. The model predicted the correct dominant species in half of the plots, and accurately reproduced species' temperature optimums. The framework is generalizable to any ecosystem as it can accommodate any species pool, any set of functional traits and multiple environmental gradients, and it eliminates some of the criticisms associated with recent trait-based community assembly models.