The resulting file is almost 15GB. How can I efficiently test all of these passwords? The RAM on my device cannot even hold this file all at once
There is no reason you would need to keep the entire file in memory. Just read the file part by part. Achieving this and speeding it up is just a matter of how you code it.
In addition, if it's your own device then you can cut out the SSH client and server completely and simply perform the brute forcing directly on the password hashes in your shadow file.
Instead of reinventing the wheel, there are pre-existing solutions for brute-forcing hashes as quickly as possible. There are also pre-existing lists/generators so you can use what a real attacker might use to get a bit more of a real-world test.
It looks like you're trying to brute-force your own passwords using a generator tailored to your own password format. The usefulness of this is dubious. Are you just trying to get a sense of how brute-forceable your passwords are? The use of your custom generator would render the results fairly meaningless. Even if you switched to pre-existing brute-forcing tools with pre-existing wordlists/generators the results will be of limited use (unless you succeed of course!): you don't just want passwords that can't be brute-forced easily, you want it so that it has additional entropy spare even after that point so it's practically not achievable. You can get a general sense of how much entropy exists in your password by inspecting it and having a good understanding of how much you need.