Skip to main content

The easy way to ship Stan models

Project description

Strata

:mountain: The easy way to ship Stan models

Build Status

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 binaries
  • lib - TBB libraries
  • licenses - 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_TARGET to 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

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:

To get started with development:

git clone https://github.com/ankane/strata.git
cd strata
pip install -e .

# for tests
pip install -r requirements.txt
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strata_cli-0.3.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strata_cli-0.3.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file strata_cli-0.3.0.tar.gz.

File metadata

  • Download URL: strata_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for strata_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 63837002867094a0cf7963d164695ae28df8abf0a40ad5f0896eb20a09d67898
MD5 c4c374df54f243d9c8c41a64f3d2e3df
BLAKE2b-256 43f57ed924fe822737ac7c11ee2b7b65d801e7cdbe8964b662c58bed756c058c

See more details on using hashes here.

File details

Details for the file strata_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: strata_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for strata_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2e7f3100cd011713964707844cb9ec1cfe5e3e4f1007ec24bbde80d11c6703b
MD5 2c9343e6f088a650c157299635ebe8c9
BLAKE2b-256 e14107ca52ceb781682f159d7d38f7822115a6314e0e77f9ff4d51d52854de27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page