That doesn’t explain why a blackbox is needed.
It’s very rare for PyMC nodels to require a blackbox, usually you can write everything more easily with pymc primitives, so that’s why I am asking.
Usually you use a blackbox when there is some complex operation that can’t be expressed in PyMC (almost anything you can write in numpy you can write in PyMC) or very expensive that uses some optimized routine written in another framework.
If you really feel you need a blackbox I think you’ll need to share more details about what parts are you struggling to understand.
Note that there are two other spinoffs of the tutorial focused in JAX. They may give you further clues about how this is done: