For the fast prototyping and without making much changes, you can use FiniteDifference.jl for derivatives and test it. I do not know much about JuMP, I have not used it personally.
For AD to work, hard typed type information should go and it should depend on inputs element type. It is only this 2 allocations, I think, should only change.