Heat the oven to 175°C fan.Line a 20 x 30cm slice tin with baking paper.
Beat together the butter or nuttelex, peanut butter and both sugars until smooth and creamy.
Beat in the eggs one at a time, followed by the vanilla.
Fold in the gluten-free flour, almond meal, baking powder, bicarbonate of soda and salt until just combined.
Press about two-thirds of the dough into the prepared tin.
Spread the cooled raspberry filling evenly over the base, leaving about a 1cm border around the edge.
Crumble the remaining dough over the top. It doesn’t need to completely cover the raspberry layer.
Sprinkle over the chopped peanuts if using. Bake for 30–35 minutes, until lightly golden around the edges and just set in the centre.
If using, sprinkle lightly with flaky sea salt while still warm.Cool completely in the tin before slicing into bars.