Smart grids help local distribution companies (LDCs) facilitate the communication between grid operators and residential prosumers. While the prosumers are striving to optimize their daily load profile by home energy management systems (HEMSs) deployment, the LDCs attempt to enhance the operation of the grid in an efficient way and decrease network losses. This paper attempts to develop a new bi-level probabilistic optimization framework wherein an HEMS optimizes its respective daily load profile, and determines its flexibility provision, which is communicated to an LDC. In the proposed framework, a decentralized approach is used to achieve the flexibility product, which is the modulation of energy, through the incentive-based demand response (DR) programs. Finally, the LDC applies the prosumer's flexibility' offers to optimize its operational performance. The twopoint estimate method (2PEM) is employed to model the uncertainties. The applicability of the framework is demonstrated by applying it to a system with one residential feeder.