The goal of sustainable coffee production requires multiple functions from agroforestry systems. Many are difficult to quantify and data are lacking, hampering the choice of shade tree species and agronomic management. Process-based modelling may help quantify ecosystem services and disservices. We introduce and apply coffee agroforestry model CAF2021 (https://doi.org/10.5281/zenodo.5725277). The model allows for complex systems with up to three shade tree species. It simulates coffee yield, timber and fruit production by shade trees, soil loss in erosion, C-sequestration, N-fixation, -emission and -leaching. To calibrate the model, we used multivariate data from 32 different treatments applied in two long-term coffee agroforestry experiments in Costa Rica and Nicaragua. Without any further calibration, the model was then applied to agroforestry systems on 89 farms in Costa Rica and 79 in Guatemala where yields had been reported previously in farmer interviews. Despite wide variation in environmental and agronomic conditions, the model explained 36% of yield variation in Costa Rica but only 15% in Guatemala. Model analysis quantified trade-offs between yield and other ecosystem services as a function of fertilisation and shading.