A hybrid computational method via CFD (computational fluid dynamics) and artificial intelligence was developed for studying heat transfer in nanofluid. The finite volume approach was used to solve the fluid flow equations through a pipe containing CuO nanofluid and the obtained temperature distribution was used to develop the artificial intelligence-based models. Optimization of tree-based ensemble models for predicting temperature values based on the CFD input features of x-coordinate and y-coordinate were carried out. The tree-based ensembles, i.e., Random Forest, Gradient Boosting, Extra Tree, and Adaboost Decision Trees, are optimized using the Fuzzy-based Bee Algorithm (FBA) to enhance their performance. The Extra Tree model achieved an excellent fitting with an R2 criterion of 0.99779, and RMSE of 1.7977E-01. The Random Forest model achieved slightly higher correlative accuracy, with an R2 criterion of 0.99865, and RMSE value of 1.4336E-01. The Adaboost Decision Trees model also demonstrated strong performance, with an R2 criterion of 0.99846, and RMSE of 1.5394E-01. However, the Gradient Boosting model exhibited slightly lower fitting accuracy, with an R2 score of 0.99258, and RMSE of 3.4090E-01.