As a preface I'm an ADHD DM and so I improvise a lot. My spellcasters are built with a few combat spells with refresh mechanics (i.e. so you just cast fireball roll a d4 and on a 4 you can use the ability again) and then a spellcaster level to guide access to the main spell list and a chunk of spell level points (usually twenty is a good range for mid level encounters) that they can use to cast any spell they want off the class spell list. Does the caster want to randomly cast banishment because the party brought summons? Well, let's deduct six spell points and give it a go.
I've also got a personal preference that good spell casters have a load of HP (no 3e elf wizards with 20 HP at level 10 please) but embarrassingly low AC. They usually have other tools in their box to make it annoying as fuck to hit them so don't put a statistically difficult roll behind a puzzle solution.