The article presents an exergy analysis of a district heating system (DHS) that incorporates a predictive model based on neural network algorithms. The study focuses on evaluating the thermodynamic efficiency of the DHS when these methods are applied, enabling the prediction of temperature changes and rapid adjustment of system parameters to enhance efficiency. The impact of increasing the number of connected consumers on the exergy efficiency of the DHS with the predictive model (DHPM) is examined. The use of neural network algorithms, such as LSTM, significantly enhances the system's ability to predict external temperature changes and respond promptly, resulting in optimized energy consumption and improved exergy efficiency, particularly at the beginning and end of the heating season. A comparative analysis of the exergy efficiency of traditional DHS and the system with the predictive model is included. The exergy analysis is based on modeling the system’s performance with varying numbers of consumers. The results indicate that an increase in the number of consumers leads to a rise in exergy efficiency due to better energy distribution management. The potential for significant thermal energy savings and reduced operational costs through the use of predictive methods is discussed. The study confirms that applying neural network algorithms in predictive models of DHS can substantially improve efficiency and reliability, leading to a more rational use of energy resources, cost reduction, and minimized environmental impact. The findings support the adoption of these methods in large-scale district heating systems for optimization and enhanced energy efficiency.