Preheat your oven to 350°F (175°C) and line a cupcake pan with paper liners.
In a medium bowl, combine the flour, baking powder, baking soda, and salt. Whisk together until well blended.
In a separate large bowl, mix the applesauce, almond milk, vegetable oil, vanilla extract, and erythritol. Stir until smooth and well combined.
Gradually add the dry ingredients to the wet mixture, stirring until just combined. Be careful not to overmix; a few lumps are okay.
If making chocolate cupcakes, fold in the cocoa powder at this stage.
Divide the batter evenly among the cupcake liners, filling each about two-thirds full.
Bake in the preheated oven for 20-25 minutes, or until a toothpick inserted into the center comes out clean.
Once baked, allow the cupcakes to cool in the pan for 10 minutes before transferring them to a wire rack to cool completely.
While the cupcakes are cooling, prepare the frosting by beating the cream cheese and powdered erythritol together in a bowl until smooth.
Add the vanilla extract and continue to beat until fluffy and well combined.
Once the cupcakes are completely cool, frost them generously with the cream cheese mixture and top with sugar-free sprinkles.