You could simply ask the carpet installer/supplier to provide you with a portion of the carpet with a 'bound edge'.
This finished carpet edge would not require any other 'trim' molding at all and be easily flexed over those steps where you would still wish to see some exposed wood.