Preheat oven to 375ºF.
In a medium-size skillet, melt the butter over medium-high heat. Add the leeks, garlic and thyme to the pan, and sauté 5-6 minutes, until very soft.
Sprinkle the flour over the veggies and cook about a minute. Whisk in the stock and bring up to a bubble to thicken the mixture up. Season with salt and freshly ground black pepper and reserve.
While the leeks are cooking, spray the insides of a 6-cup muffin tin with nonstick cooking spray. Line each cup with a slice of ham or prosciutto folded in half.
Spoon a heaping tablespoon of the cooked leeks into each lined cup and top with a little shredded cheese. Press the leeks and cheese down a little with your finger to make room, then crack an egg into each one, making sure it stays whole.
Season the tops of the eggs with salt and freshly ground black pepper, and place the muffin tin on a baking sheet. Transfer sheet to the oven and bake 15 minutes, until the eggs set.
Remove tin from the oven and allow the baked eggs to cool in the muffin cups for a couple of minutes before removing them from the pan. Serve a green salad alongside.