Melt the butter in a large pot over medium heat. Add the onion and garlic, cooking until they're soft and fragrant.
Add the diced sweet potatoes and stir in the broth, cumin, chili flakes, and ginger.
Bring the mixture to a boil, then reduce the heat to low. Let it simmer until the sweet potatoes are tender, about 20 minutes.
Use an immersion blender to puree the soup until smooth. For extra creaminess, stir in coconut milk.
Season with salt to taste.
Serve hot, garnished with a dollop of sour cream or a sprinkle of fresh cilantro if desired. Enjoy this spicy sweet potato soup with a slice of crusty bread or a side salad!