You can use Baritone as a Forge mod. --- Baritone Site ---
The most popular CLIENT with Baritone is Meteor Client and/or Impact Client (It tells you that it has Baritone packaged in, here, "The Impact client is an advanced utility mod for Minecraft, it is packaged with Baritone and includes a large number of useful mods")
If you are using an anarchy forge mod, you can use baritone with it if it is not already included.
For the "1.17" part - Meteor is 1.17x.
For the "change versions" - there is a mod called ViaVersions which allows you to change the versions in game.
Hope this helps!