The built environment currently represents the largest sector in terms of final energy consumption, both in Switzerland and the European Union. Most of the associated energy services, such as space heating and potable hot water preparation, are mainly satisfied by the combustion of fossil fuels, typically oil and natural gas. Hence, within the current context of national energy transition towards a sustainable and environment-friendly service provision, the building sector is facing a major challenge to integrate both efficient conversion technologies and additional renewable energy sources. Nevertheless, an increasing penetration of the latter is not a straightforward task; solar power, a typical resource available in urban areas, is indeed intrinsically volatile which renders a full exploitation of the generated electricity highly compelling. The implementation of advanced mathematical modelling methods during the phases of both design and operation represent a promising cornerstone to successfully reach the objectives targeted by the transition program. Using a model-based approach, the following thesis therefore attempts in contributing to the latter challenge through three main targets. The first aims at the development of a holistic and modular modelling framework to optimally size and operate building energy systems. In order to provide multiple good trade-off system solutions to the various stakeholders, the proposed method relies on an epsilon-constraint multi-objective optimisation techniques and ad hoc defined key performance indicators. A systematic implementation of the thus developed framework finally allows the large-scale analysis of modern and efficient building energy systems, both in view of future market opportunities and national environmental targets. The second topic focuses on the study of multi-building energy systems and analyses the potential benefits from involving multiple end-users during the sizing process. Through an extended system scope, potential synergies of neighbouring building types arise and hence, the initial modelling framework is further developed accordingly. Additional shared unit technologies, such as inter-day storage and heating networks become interesting elements for buildings interaction and therefore are also integrated in the modelling framework. Finally, the third target addresses the quantification of potential ancillary services performed by different energy system configurations to power network operators. Using a representative set of flexibility request profiles, the modelling framework is systematically solved to assess the associated temporal load shifting potential in comparison to standard electrical battery energy storage systems.