Run Stan locally in your browser—no server or 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 .
Surprised it was that quick?
Look ma, no compiles! Other Stan interfaces all lower your model to C++ and then use a system C++ compiler to build it,
which takes several seconds even for small models after the precompiled headers have been built.
Stanli has its own lowering and optimization passes that run in tens of milliseconds and then just interprets that high level result rather than using a compiler.
How
it works
How does it perform? In the
2026-09-21 native run,
315 of
319 models produced paired gradient
measurements. The median CmdStan/Stanli ratio was
1.72x, with
302 at or above parity.
See the current full benchmark
for the protocol, complete model inventory, failed or capped runs, and numerical checks.
The biggest architectural win is that Stanli analyzes the model graph and pre-allocates a linear array for gradient storage for everything except for ODE UDFs and conditionals on parameters.
The other graph optimizations are explained here .
This tab runs WebAssembly. The figures above and the model-card
ratios measure the native build; browser performance depends on your device
and browser. For heavy work, pip install stanli to run the native build.
Checked against CmdStan. The shared corpus contains
329 models with recorded CmdStan
references at three fixed inputs. The replay checks log densities, full
gradients, and available per-draw output references, including generated
quantities. See the numerical
checks and documented exceptions , and per-model coverage in
corpus
status .
Interested in learning more, or even contributing? Check out hacking.md :)