stanli: The Stan Language Interpreter (browser edition)
Run Stan right here in your browser, with no server and no C++ toolchain.
stanc3 (OCaml→JS) compiles the model, then stanli.wasm lowers it to an op
graph and runs Stan Dynamic HMC,
WALNUTS , or
Pathfinder .
The Python and R packages are
2.31x faster than CmdStan on a typical model.
Surprised it was that quick?
Look ma, no compiles! Other Stan interfaces turn your model into C++
and then build it with a C++ compiler, which takes several seconds even for a small model.
Stanli optimizes your model in tens of milliseconds and then interprets the result.
How
it works
And it's fast! For a typical model, the native Python and R packages compute gradients
2.31x faster than CmdStan .
Stanli analyzes your model before it runs and lays out its gradient storage as one flat array.
You can read about that and the other optimizations
here .
This tab runs WebAssembly. The speed numbers on this page come from those native packages.
For bigger models, pip install stanli and run them at full speed.
Checked against CmdStan. We compare Stanli's log densities and gradients with CmdStan's on
416 models.
See how we test .
Want to learn more, or even contribute? Check out hacking.md :)