What do you mean by multithreading? Not map_rect
?
Theading things are done in Stan side, so you would need to touch Stan source. For this I recommend that you clone our repo and install in place.
git clone --recursive https://github.com/stan-dev/pystan
cd pystan
pip install -e .
For threading discussion, please read other discussion going on this forum.
Ps. PyStan 3 uses threading to run chains parallel, but that is not probably the thing you are looking for.
Edit. You get cpp code with stanc
and you can edit this after saving. Then you can read the modified cpp code and replace in stanc output that can then go to StanModel
init.