All the patches for YT Music say they work on any version, so I'd just use the latest. I personally am using 6.21.51 simply because that was latest supported version when I patched and it hasn't broken yet.
I'll repatch with the latest version soon and update this comment with how that goes.
Update: I used YT Music 6.41.54 with Revanced Manager 18.0, applied all 12 patches and it works so far. I didn't get ads or premium prompts, and was able to do background play. I couldn't find the new codecs in the settings, the "compact header" is still there, and there is still a "Get Music Premium" option in the accounts menu.
Update 2:
YT-Music 6.41.54
Revanced Manager 18.0
Patches version 4.2.0
Un-rooted Google Pixel 4a (5G)
Stock Android 14
Patches confirmed working:
- Background play
- Exclusive audio playback
- Music video ads (none so far)
- Remove upgrade button in pivot bar
- GmsCore support
Don't work:
- Codecs unlock
- Compact header
- Hide get premium (in account menu)
Unknown:
- Bypass certificate checks (for Android Auto)
- Minimized music playback on kids menu
- Permanent repeat (didn't test)
- Permanent shuffle (didn't test)