Preheat the oven to 400 degrees.
Grease a 9x9" or an 8x8" baking dish; set aside.
Pour the coconut milk into a large bowl. If your coconut milk has a lot of solids at the top, put the contents of the can into a microwave-safe bowl and microwave for 30 seconds.
To the milk, add the cumin, salt, cardamom, turmeric, coriander, chili powder, garlic, ginger, hot chile pepper. Set aside.
Heat the oil in a medium saucepan over medium to medium-high heat. Once the oil is hot, add the sliced onions. Lightly caramelize, stirring often, for 15 minutes. Cook longer if more caramelization is desired.
Scrape the onions into the milk-spice mixture. Whisk to combine all the ingredients. Taste the mixture for seasoning and adjust as desired.
Peel the sweet potatoes and slice them on a mandoline using the "thin" attachment. Add them to the coconut milk-spice mixture. Using your hands or a spoon, combine everything so all the slices are coated. Disposable gloves are helpful for this.
Using a silicone spatula, scrape all that wonderfully-spiced mixture into your baking dish.
Cover the dish with foil and bake for 30 to 35 minutes for a 9x9" dish, or 40-45 minutes for an 8x8" dish. (Be aware that baking times are approximate. Length of baking time also depends on the thickness of your sweet potato slices. Adjust as needed.)
Remove the foil and continue to bake for another 15 minutes.
Once bubbly and the sweet potatoes are easily pierced with a fork, remove the dish from the oven and allow it cool slightly.
Sprinkle the cilantro and peanuts on top and serve very warm. Naan bread is wonderful here to soak up all that delicious sauce!