The Energy Performance of Buildings Directive (EPBD) has set a target to achieve carbon-neutral building stock and generate 80% of its electricity from renewable sources by 2050. While Model Predictive Control (MPC) can contribute significantly to energy flexibility in buildings, its remote implementation remains relatively unexplored, especially in the residential sector. The purpose of this research is to demonstrate the reliability, robustness, and computational efficiency of a cloud-based application of an MPC called Smart Energy Management (SEM) on a multi-family residential building. The SEM was tested on a virtual building model in TRNSYS using an open-source distributed event streaming platform for data exchange and synchronization. Simplified models for thermal behavior prediction, including an R3C3 model of the building, were developed in C++. The SEM was evaluated in eight scenarios with varying weather conditions, optimization criteria, and runtime periods. The results demonstrate that the SEM maintains stability and robustness over a 2-week period with a 15-minute planning resolution while ensuring thermal comfort. The C++ implementation of the optimization algorithm enables SEM deployment on low-spec servers, supporting cost-effective applications in real buildings with minimal intervention.