Make the knafe: Preheat the oven to 375°F (190°C).
Put the butter in a small saucepan and crumble the saffron between your fingers into the pan. Melt the butter over medium heat (you can also do this in the microwave). Give it a good stir; the saffron should dissolve into the butter and give it a deep golden color.
Unwrap the shredded phyllo and transfer about one-third to a food processor. Pulse for a few seconds to separate the dough into smaller strands. Transfer the phyllo strands to a large bowl and repeat with the rest of the shredded phyllo. Stir in the melted butter, season with about 2 teaspoons of the salt, and toss thoroughly but with a gentle hand—you want to make sure that all the strands are coated with butter, but you don’t want to mash them.
In a separate bowl, combine the goat cheese, ricotta, rosemary, thyme, lemon zest, the remaining 1 teaspoon salt, and the black pepper, or to taste. Mix until smooth.
Arrange half the phyllo strands in a 12-inch (30 cm) cast-iron skillet or in a round baking pan (but not a springform pan, which could allow the butter to leak out). Add the cheese mixture in dollops and smooth the top with a spatula. Cover with the remaining phyllo, patting down the strands to make sure you have a smooth and uniform layer. Bake until the phyllo is deep golden brown, 40 to 45 minutes.
While the knafe is in the oven, make the sauce: Put all the ingredients for the sauce in a food processor or blender and puree until smooth. Taste and adjust the seasoning. The sauce should be bright red and quite spicy. Set aside.
To serve: Let the knafe cool for a few minutes to set up a bit, then flip it onto a large serving plate and top with the pistachios. Cut into wedges using a bread knife. Serve with the red pepper sauce on the side.
Tips
Flipping knafe is optional—it will make the dish look more attractive, because the beautifully golden brown underside will be exposed, but if it makes you nervous, you can skip it and serve the pie right out of the pan.
If you don’t have a 12-inch (30 cm) round pan or skillet, use a 9-by-13-inch (23-by-33 cm) rectangular pan. Cut the knafe into squares rather than wedges to serve.
Variations
Individual knafe pies: Divide the shredded phyllo and the cheese filling evenly among six 5-inch (12.5 cm) tartlet pans. The baking time will be considerably shorter, about 20 minutes.
Classic dessert knafe: Follow the recipe above, but omit the thyme, rosemary, salt, and pepper from the cheese mixture. As soon as you remove the knafe from the oven, drizzle it with about 1 cup (240 ml) cold sugar syrup. Top with chopped toasted pistachios. And of course you won’t need the red pepper sauce.