Using pymc3 NUTS sampler for an "external model" having its derivatives with respect to its parameters

The general route is to wrap the external model in theano, and implement a grad method for it as well.
For example, this post shows you how to call an external model (from scipy) to do numerical integration:

And here is two more examples from @aseyboldt:

@aseyboldt is currently writing a blog post on the later one, but I think you should have enough information to give it a go :wink: