Using SQM on multiple devices

I have 3 routers and 1 modem, all have OpenWRT installed.
All 3 routers use modem's internet.
Should I install SQM on all routers or only on the modem?

If you put sqm on the routers you should make sure that the summed shaper rates are smaller or equal to the true rate.
E.g. if you have a 100/100 link then setting each router to 33/33 would work. However thst means that even if routers 2 & 3 have no traffic, router 1 will not be able to use your full link.

My question was whether should I put SQM on the routers or the modem.
I have no intention to run SQM on the routers unless it's required to do so

The answer is it really depends on what you want to achieve here... both options come with different trade-offs, so it sort of matters what your goal is before giving recommendations.