In this paper, the ELEKTRA framework is introduced, a novel community energy management system that organizes the prosumers into autonomous communities and determines the prosumers’ optimal energy procurement in a distributed manner. Our motivation stems from the increasing complexity of the energy procurement for prosumers and the need for more efficient and decentralized approaches to optimize their energy consumption. The first element of the ELEKTRA framework implements an autonomous hedonic game-theoretic model at the prosumers’ home energy management controllers, considering the prosumers’ individual energy consumption and generation patterns, as well as the utility-provided rewards for proactive participation. Specifically, the prosumer grouping is modeled as a hedonic game, demonstrating the existence of a Nash-stable and individually-stable prosumer grouping. The second element of the ELEKTRA framework employs a distributed non-cooperative game-theoretic approach. This addresses how prosumers strategically consume energy to meet their needs while maximizing their payoff by procuring additional energy from the utility company. Also, utilizing the theory of n-person concave games allows for a thorough evaluation of accuracy, performance, and complexity in determining optimal energy consumption for prosumers. A comprehensive evaluation of the ELEKTRA framework is conducted using real data from the southwest region of USA. The results demonstrate the operational effectiveness of the ELEKTRA framework, showcasing its superiority in optimizing prosumer payoff compared to existing models. The performance assessment, grounded in real-world data, provides valuable insights into the efficacy of the ELEKTRA framework in contrast to current state-of-the-art.