The full instructions and source code are found here. In this post I’ll give the slimmed-down basics.
- If python3, pip, or curl are not already installed, install them:
sudo apt install python3 python3-pip curl
- Now install via pip:
python3 -m pip install httpstan
- Now do a quick check to verify the install:
python3 -m httpstan &
curl -H "Content-Type: application/json" --data \'{"program_code":"parameters {real y;} model {y ~ normal(0,1);}"}' \
http://localhost:8080/v1/models > output.txt
- The file output.txt should contain the text representation of a JSON object with a “name” field, a “compiler_output” field that will be a long string, and a “stanc_warnings” field that should have the value “”.
- Now shut down the server:
fg
^C