If you want to see how something like this might work, I made a fun project where I added a single board computer (SBC) into a keyboard. When you press the 'AI' button, the SBC would send inputs to the LLM on the SBC and output keystrokes to the PC. Demo below if you're curious.