Preheat oven to 350 degrees. Grease a 1½-quart baking dish.
In a large bowl, stir together mashed sweet potatoes, sugar, butter, eggs, vanilla extract, spices and sour cream. Add baking soda and salt, mixing well. Stir in raisins, if desired.
Spread mixture into prepared baking dish. Bake uncovered in preheated oven for 35 to 45 minutes until the center is no longer jiggly.
Prepare topping by combining melted butter, brown sugar, flour, coconut and pecans, if desired, in a bowl.
Remove gluten free casserole from oven and sprinkle topping over the top. Return casserole to the oven for 10 more minutes or until lightly browned.
Notes
TIP: Pressed for time? Use 3 cups canned sweet potatoes, drained and mashed.