Keychange is a menubar app. It lets you assign an input source to each connected keyboard, and it switches the moment you start typing. Keyboards are identified per VID/PID and mappings survive unplugging.
I used autokbisw for years, which solves the same problem from the command line and solves it well. I wanted the mapping visible and configurably more easily. Keychange implements two things beyond that: it can optionally switch before the key press is delivered, so even the first character after a switch comes out right and it has strategies what to do when the input source is changed by other apps.
It needs Input Monitoring permission to detect which device a keystroke came from. Nothing is stored or sent anywhere. The only network request it makes is the update check. Free, MIT licensed.
https://keychange.dev https://github.com/dennistimmermann/keychange
It's a brand new app, so any and all feedback is welcome.