Heat the oven to 350°F. Line an 8 1/2 x 4 1/2-inch loaf pan with parchment paper.
Melt 1 tablespoon butter in a skillet over medium-low heat. Add the onion and 1/4 teaspoon sea salt, then cook for 12 to 15 minutes until soft and deep golden; stir in the thyme and cool for 5 minutes.
Whisk the almond flour, whey protein isolate, baking powder, and 1/2 teaspoon sea salt together. In another bowl, whisk the eggs, sour cream, and melted butter until smooth.
Stir the wet mixture into the dry ingredients. Fold in the caramelized onion and 3/4 cup of the Gruyere, then spread the batter in the loaf pan.
Scatter the remaining 1/4 cup Gruyere over the top. Bake for 42 to 48 minutes, until the center is set and the cheese forms a golden crust.
Cool in the pan for 15 minutes, then transfer to a rack. Let the bread cool another 20 minutes before serving so the onion-rich crumb stays moist but cleanly set.