Heat a drizzle of olive oil in a large pan over medium heat until just shimmering. Add the sweet potato, onion, garlic, and rosemary. Season with salt and pepper. Cook, stirring occasionally, for 15 minutes, until the sweet potato is softened and browned. Remove from the heat and let cool.
Preheat the oven to 350˚F (180˚C). Grease a 12-cup muffin tin with nonstick spray.
Make the batter: In a large bowl, stir together the whole wheat flour, baking powder, baking soda, salt, pepper, and sugar. Set aside.
In a medium bowl, whisk together the eggs, buttermilk, and butter.
Add the cooled sweet potato mixture to the egg mixture and stir to combine.
Pour the egg mixture into the dry ingredients and fold to combine, being careful not to overmix.
Using an ice cream scoop, divide the batter between the muffin cups, filling almost completely.
Bake for 18 minutes, rotating the muffin tin halfway through baking, until browned on top and a toothpick inserted in the center of a muffin comes out clean.
Let cool for 10 minutes before removing the muffins from the tin. Serve or store in the refrigerator for up to 5 days.
Nutrition, per muffin - Calories: 159, Total fat: 8 grams, Sodium: 393 mg, Total carbs: 18 grams, Dietary fiber: 3 grams, Sugars: 2 grams, Protein: 5 grams