Preheat oven to 350°F (175°C), grease a 9-inch round cake pan, and line it with parchment paper.
Mix ricotta, almond flour, and vanilla until smooth. Add sugar and eggs, beat until pale. Stir in flour, baking powder, and salt. Fold in chopped pistachios, saving some for topping.
Spread half the batter in the pan. Layer with cream or mascarpone, staying clear of the edges. Top with remaining batter.
Bake for 30–35 minutes until golden and a toothpick (avoiding the center) comes out clean. Cool for 10 minutes in the pan, then fully on a wire rack.
Whisk powdered sugar, vanilla, and milk until smooth. Adjust thickness as needed.
Drizzle syrup over the cooled cake and sprinkle with reserved pistachios. Serve warm or at room temperature.