Preheat the oven to 350°F (175°C). Grease or line a 9-inch round cake pan with parchment paper.
Mix dry ingredients: In a medium bowl, whisk together the almond flour, cinnamon, nutmeg, baking powder, and salt.
Prepare the wet ingredients: In a large bowl, beat the eggs and stir in the grated carrots.
Combine wet and dry ingredients: Gradually add the dry ingredients to the wet ingredients and mix until just combined.
Add walnuts (optional): If using, fold in the chopped walnuts for added texture.
Pour into pan: Transfer the batter into the prepared cake pan and smooth it out evenly.
Bake the cake: Bake for 25-30 minutes or until a toothpick inserted into the center comes out clean.
Cool the cake: Let the cake cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.
Frost (optional): Once the cake has completely cooled, frost it with sugar-free cream cheese frosting, if desired.
Serve and enjoy: Slice and enjoy your keto-friendly carrot cake!