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.

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

For Mac, models run on macOS 10.14+ by default. You can set MACOSX_DEPLOYMENT_TARGET to override.

For Linux, compile on the oldest platform you support.

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 output directory

strata -o dist ...

Show build output

strata --debug ...

Create a static build (Mac only, experimental)

strata --static ...

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 .

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

strata_cli-0.1.0-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file strata_cli-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: strata_cli-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.12

File hashes

Hashes for strata_cli-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ea23a53265dc2d39a651d361b95d3586d1e1f4b5e1ba00dec972c421eceabc5d
MD5 7942435072c3c80c1e6c807b1e3ee972
BLAKE2b-256 dfb05f1edde6a9a3023706039e32bf5abe0d2b642ac7c51a6e5a12c234c5800f

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