Prep the pan and oven: Heat oven to 350°F (175°C).
Grease an 8-inch round cake pan and line the base with parchment. Grease the parchment and lightly dust with cocoa powder.
Melt chocolate and butter: In a heatproof bowl set over barely simmering water, melt the chocolate and butter, stirring until smooth. Or microwave in short bursts, stirring between each.
Remove from heat and let cool for 3–4 minutes.
Whisk in sweetener: Add the erythritol or allulose to the warm chocolate mixture. Whisk until the crystals start to dissolve and the mixture looks glossy.
Add eggs and flavorings: Whisk in the eggs one at a time until fully incorporated and silky. Stir in vanilla, almond extract, salt, and coffee if using.
Fold in dry ingredients: Sift the cocoa over the bowl, add almond flour, and gently fold until no dry pockets remain.
The batter will be thick and shiny.
Fill the pan: Scrape the batter into the prepared pan and smooth the top with an offset spatula. Tap the pan once on the counter to release air bubbles.
Bake: Bake for 22–28 minutes. The edges should be set and slightly puffy, and a toothpick inserted 2 inches from the edge comes out with moist crumbs.
The center should look just set but still soft.
Cool and unmold: Cool in the pan on a rack for 15 minutes. Run a knife around the edge, invert onto a plate, peel away parchment, then flip right side up. Let cool completely before slicing.
Serve: Dust with cocoa powder or powdered low-carb sweetener.
Add berries or a spoonful of unsweetened whipped cream for contrast.