--- id: httpstan version: "4.17.0" license: ISC license_treatment: permissive maintenance: active --- # httpstan — HTTP-based interface to Stan, a package for Bayesian inference. License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does httpstan is a shim that exposes the Stan C++ library's Bayesian inference capabilities through an HTTP 1.1 REST API. It runs as a local server (by default on port 8080) and accepts HTTP requests to compile Stan probabilistic models and draw samples from them. The package is designed primarily for developers building frontends or tools that need to call Stan functionality over the network without direct C++ integration. The package provides model caching, sample caching, and parallel sampling capabilities beyond what a basic command-line interface offers. It depends on aiohttp, marshmallow, webargs, numpy, appdirs, and setuptools. Installation requires a C++ compiler and is supported on Linux and macOS with x86-64 CPUs; Python 3.12 or later is required. Use it for: - Building web-based Bayesian analysis tools that need to offload Stan computations to a backend server - Creating language-agnostic frontends to Stan by wrapping HTTP calls instead of requiring C++ bindings - Running Stan models in containerized or distributed environments where HTTP communication is preferred - Caching compiled models and samples to avoid recompilation and resampling in iterative analysis workflows - Enabling parallel sampling across multiple cores through the HTTP interface without manual threading code ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. httpstan provides an HTTP REST interface to the Stan C++ library for Bayesian inference, allowing clients to compile Stan models and draw samples via HTTP requests rather than direct C++ calls. Yes, if you need to expose Stan's Bayesian inference capabilities over HTTP or are building a tool that requires remote Stan access. The package is actively maintained, has no known vulnerabilities, and uses a permissive license. Install friction is moderate due to C++ compiler requirements and platform-specific wheels, but prebuilt binaries exist for common configurations. Not suitable if you need Windows support or non-x86-64 architectures without building from source. ## Install pip install httpstan uv add httpstan poetry add httpstan ## Installing httpstan Before you install: Medium install friction due to compiled wheels for specific Python versions (3.12, 3.13, 3.14) and platform combinations (macOS ARM64, Linux x86-64). Requires a C++ compiler (gcc ≥9.0 or clang ≥10.0) on the system. Package is actively maintained with recent releases. License in practice: ISC License is permissive, allowing commercial and private use with minimal restrictions. No notable licensing constraints for typical use. Quickstart: $ python3 -m pip install httpstan $ python3 -m httpstan # In another terminal: $ curl -H "Content-Type: application/json" \ --data '{"program_code":"parameters {real y;} model {y ~ normal(0,1);"}' \ http://localhost:8080/v1/models Requires Linux or macOS, x86-64 CPU, and C++ compiler (gcc ≥9.0 or clang ≥10.0). Python 3.12 or later. Verify before relying: - Whether prebuilt wheels cover all common deployment targets or if source builds are frequently needed - Performance characteristics and typical latency for model compilation and sampling operations - Concurrent request handling limits and scalability under load ## Package facts - License: ISC (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bayesian inference REST API, stan HTTP interface, remote bayesian sampling, stan model server, HTTP stan backend, bayesian MCMC REST, stan compilation service, bayesian-inference, rest-api, stan-backend [View on SkillFed](https://skillfed.io/packages/httpstan) · [View on PyPI](https://pypi.org/project/httpstan/)