Preheat your oven to 350°F (175°C). Grease a 9-inch round cake pan or line it with parchment paper.
In a large mixing bowl, combine almond flour, baking powder, baking soda, cinnamon, nutmeg, and salt. Whisk until well mixed.
In another bowl, beat the eggs and then add the erythritol, applesauce, and vanilla extract. Mix until smooth.
Gradually add the wet ingredients to the dry ingredients, stirring until just combined. Fold in the grated carrots and nuts or coconut if using.
Pour the batter into the prepared cake pan and spread it evenly.
Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Let it cool in the pan for 10 minutes before transferring it to a wire rack to cool completely.
Optional: Frost with a keto-friendly cream cheese frosting once cooled.