Strata
⛰️ The easy way to ship Stan models
Installation
Strata is a command line tool. To install, run:
pip install strata-cli
This will give you the strata command. You can also install it with Homebrew.
Getting Started
Package a model
strata bernoulli.stan
This creates a dist directory with:
bin- Stan binarieslib- TBB librarieslicenses- license files
You can also package multiple models
strata bernoulli.stan regression.stan
Running Models
Run a model directly
dist/bin/bernoulli sample data ...
Or load it into CmdStanPy
from cmdstanpy import CmdStanModel
model = CmdStanModel(exe_file='dist/bin/bernoulli')
CmdStanR (not on CRAN yet)
library(cmdstanr)
model <- cmdstan_model(exe_file="dist/bin/bernoulli")
Or CmdStan.rb
require "cmdstan"
model = CmdStan::Model.new(exe_file: "dist/bin/bernoulli")
Portability
- Linux: package on the oldest platform you support
- Mac: models run on macOS 10.14+ by default (set
MACOSX_DEPLOYMENT_TARGETto override) - Windows: not supported yet
Cross-Compiling
Cross-compile for a different architecture (on the same OS)
strata --cross-compile ...
On Ubuntu, this requires:
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
# or
sudo apt install gcc-x86-64-linux-gnu g++-x86-64-linux-gnu
Reference
Specify the output directory
strata -o dist ...
Show build output
strata --debug ...
Create a static build (experimental, only working on Mac)
strata --static ...
Homebrew
On Mac, you can use:
brew install ankane/brew/strata
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/strata.git
cd strata
pip install -e .
# for tests
pip install --group dev
pytest
Metadata
Release files for strata-cli 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| strata_cli-0.3.1.tar.gz | 10.8 kB | Without provenance | Details for strata_cli-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| strata_cli-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for strata_cli-0.3.1-py3-none-any.whl |
Total release size: 21.0 kB
Release files / strata_cli-0.3.1.tar.gz
| Download URL | strata_cli-0.3.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4679298c7c0b60961e1a1279aa00c2a287c84388da5799fd36734f18451ebe10
|
|
BLAKE2b-256 checksum How to use checksums |
3c7b9c34451490fef24b2c6c3d3ff5a694e12a8c333263a03ae7ecbf0f7429b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / strata_cli-0.3.1-py3-none-any.whl
| Download URL | strata_cli-0.3.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ca6ef888b67555183263fcfecfb2a37bd48d38548c66a0148ce5d79e2cba3dd
|
|
BLAKE2b-256 checksum How to use checksums |
1206bd90cd0a4f16f0974b522d6a8ad03143e1f2628642e26b110b69cd56b692
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for strata-cli 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.