Constant RPM with varying voltage

Perhaps you can explain what you mean by "input rpm"? Motors produce rpm output not input.

But what it sounds like you want to do is impossible. No DC motor can maintain a fixed rpm with input voltage varying from 0 to 12V.

Steve