shimano 6400

is the shimano 6400 groupset 7 or 8 speed or either…?

6400 was originally 7sp, then 6401 to 6403 (I think) was 8sp. I’m not sure if any 6400 stuff was 8sp.

640x derailleurs work fine with either 7sp or 8sp. But there some different variations in freehubs - Ultraglide was replaced by Hyperglide and some freehub bodies are threaded on the outside and inside so they can take either HG or UG cassettes, but I can’t remember whoch ones are which.

that suites