# CmdStanPy

> Lightweight Python interface to CmdStan

Source: https://talira.ai/catalog/cmdstanpy-tdkjcbhm
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / math / statistics](https://talira.ai/categories/libraries/math/statistics), [languages / python](https://talira.ai/categories/languages/python)
- Licence: BSD-3-Clause[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Stan Development Team](https://talira.ai/orgs/stan-dev.md)

CmdStanPy is a lightweight, pure [Python](https://talira.ai/catalog/python-tgjs08pq.md) interface to CmdStan, giving access to the [Stan](https://talira.ai/catalog/stan-rerqryze.md) compiler and all of its inference algorithms. Python never talks to C++ directly: it compiles models and runs the CmdStan executables, tracking their input and output files, with only numpy and pandas as dependencies. Defaults suit development (output on a temporary filesystem), and every option can be set for production runs across machines; it installs CmdStan itself with `install_cmdstan()`.

## Links

- GitHub: https://github.com/stan-dev/cmdstanpy
- Docs: https://mc-stan.org/cmdstanpy/

## Problems it solves

- fit a Stan model from Python
- run MCMC for a Bayesian model in a Python pipeline
- install and use CmdStan from Python

## Features

- compile Stan models and run every CmdStan inference method
- pure Python, depends only on numpy and pandas
- development-friendly defaults with full control for production
- installs CmdStan for you

## Trust

Overall: 0.53 out of 1.
Signals: maintenance 0.87, adoption 0.46, momentum 0.15, community 0.71, backing 0.30, extensibility 0.00.

- last commit 5 days ago
- 41 commits in the last 90 days
- latest release v1.3.2 26 days ago
- 198 GitHub stars
- 59 contributors
- accepts sponsorship (Github, Custom)
- backed by Stan Development Team

## Related

- Works with [Stan](https://talira.ai/catalog/stan-rerqryze.md)

## Alternatives

- [PyMC](https://talira.ai/catalog/pymc-r67zqyr4.md): Bayesian modeling and probabilistic programming in Python
- [Stan](https://talira.ai/catalog/stan-rerqryze.md): Probabilistic programming language for Bayesian statistical modelling
- [CmdStan](https://talira.ai/catalog/cmdstan-0kddshy5.md): Command-line interface to Stan for compiling and running Bayesian models
- [PyStan](https://talira.ai/catalog/pystan-s7s7mbvj.md): Python interface to Stan for Bayesian inference

## Sources

[^1]: https://github.com/stan-dev/cmdstanpy/blob/develop/LICENSE.md (checked 29 Nov 2026)
[^2]: https://github.com/stan-dev/cmdstanpy/blob/develop/README.md (checked 29 Nov 2026)
