# Stanli: Stan language interpreter, embedded in Python, or it can run in the browser and is often faster than CmdStan!

**URL:** <https://discourse.mc-stan.org/t/stanli-stan-language-interpreter-embedded-in-python-or-it-can-run-in-the-browser-and-is-often-faster-than-cmdstan/41504>\
**Category:** General\
**Tags:** performance\
**Created:** [August 11, 2026, 12:37am UTC](https://discourse.mc-stan.org/t/stanli-stan-language-interpreter-embedded-in-python-or-it-can-run-in-the-browser-and-is-often-faster-than-cmdstan/41504 "2026-08-11T00:37:22Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![StaffanBetner](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/staffanbetner/32/11056_2.png) [@StaffanBetner](https://discourse.mc-stan.org/u/StaffanBetner)\
**Post date:** [October 2, 2026, 2:00pm UTC](https://discourse.mc-stan.org/t/stanli-stan-language-interpreter-embedded-in-python-or-it-can-run-in-the-browser-and-is-often-faster-than-cmdstan/41504/21 "2026-10-02T14:00:19Z")

</div>

FWIW, I put together a repo with helper functions for fitting `brms` models with `stanli`.

Since `stanli` now has a helper function for converting the output object to a `stanfit` object, it works very well to just plug that into an empty `brms` fit object. My main motivation for the helper functions was getting moment-matched LOO to work without `rstan` recompilation, and it works fine now.

Link to repo: [GitHub - StaffanBetner/brm\_stanli: Helper functions to fit and diagnose brms models with stanli (LOO with moment matching and/or refit works) · GitHub](https://github.com/StaffanBetner/brm_stanli/)

---

<div class="post-metadata">

**Author:** ![seantalts](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/seantalts/32/32_2.png) [@seantalts](https://discourse.mc-stan.org/u/seantalts)\
**Post date:** [October 2, 2026, 2:14pm UTC](https://discourse.mc-stan.org/t/stanli-stan-language-interpreter-embedded-in-python-or-it-can-run-in-the-browser-and-is-often-faster-than-cmdstan/41504/22 "2026-10-02T14:14:16Z")

</div>

Very cool, thanks! Let me know if you need anything fixed or upstreamed into stanli.

[Previous page](https://discourse.mc-stan.org/t/stanli-stan-language-interpreter-embedded-in-python-or-it-can-run-in-the-browser-and-is-often-faster-than-cmdstan/41504.md?page=1)
