I also rely on external functions a lot. In some cases, they’re not even Python, but rely on calling some old compiled Fortran code. I did find some issues in the example @JJR4 provided, but made it to work. A self contained examples is here.
I saw a post a few weeks’ from @_eigenfoo showing he had extracted the samplers from pymc. I now see his project is archived/discontinued. It’d be nice to have access to the population samplers etc without the rest of pymc for these kind of applications.