Specialty coffee (SC) production enables farmers to earn premium prices for high-quality coffee. In Bolivia, some coffee-based agroforestry systems (CAFS) produce SC. However, while many Bolivian families' livelihoods depend on coffee, studies on SC-producing CAFS remain scarce. Yet, research on tree diversity, CAFS management and the factors affecting tree diversity can offer novel insights on agroforestry. We sampled 24 farms in three villages located in the Caranavi municipality. We analyzed farms main characteristics, biophysical variables, shade tree diversity, tree uses, management practices and farmers' socioeconomic background. Additionally, we surveyed 50 coffee farmers to collect information about their preferences for shade tree species and tree characteristics. Then, we investigated if farmers' socioeconomic and farm biophysical variables affect CAFS tree species richness and tree density using generalized linear models (GLM). Our results showed that studied farms are small and certi ed properties (average: 2.6 ha) managed by families; we observed that CAFS provide farmers with valuable products besides SC. We identi ed 85 tree species that provide principally shade for coffee and fruits, timber, lumber and medicines. Moreover, farmers prefer mostly shade tree species that offer them useful and marketable products, while tree characteristics are preferred according to their bene ts to coffee and farmers. GLM revealed that socioeconomic and biophysical variables related to management and landscape composition affect: tree species richness and density. These results suggest that management and landscape are in uential factors driving CAFS tree diversity. Hence, factors fostering farmers' ability to manage their CAFS for biodiversity and household wellbeing should be promoted.