bngsim
Embeddable simulation engine for biochemical reaction networks.
bngsim is a high-performance C++ simulation kernel with Python bindings that replaces
BioNetGen's subprocess-based run_network driver. The library also includes two network-free simulators. It loads BioNetGen .net and .xml files, runs deterministic
and stochastic simulations in-process, and returns results as NumPy arrays —
no file I/O, no subprocess spawning, no Perl dependency.
Highlights
- Fast — in-process execution with the GIL released during simulation; thread-parallel batch sweeps
- No toolchain at runtime —
import bngsim; no compilers, noBNGPATH, no Perl - Modern SUNDIALS — v7.x CVODE/CVODES with re-entrant
SUNContext - Multi-format — loads BioNetGen
.netand.xml, Antimony (.ant), and SBML (.xml) models SBML Test Suite results, plus rule-based BNGL (.bngl) via BNG2.pl withbngsim[bngl] - Rich results — NumPy arrays, named observable access, pandas/xarray, HDF5 save/load
- Standards interchange —
.net/cBNGL ⇄ SBML and SED-ML + OMEX packaging, every conversion verified faithful - Gradient-ready — CVODES forward sensitivities, Fisher information
- Validated — matches
run_networkto ~10⁻¹² (ODE) and cross-checked against RoadRunner and the SBML semantic test suite
Installation
pip install bngsim
Prebuilt wheels ship for common platforms; large models may benefit from the optional sparse (KLU) solver. See the installation guide for source builds, the KLU dependency, and optional extras.
Quickstart
import bngsim
# Load a model (BioNetGen .net/.xml, Antimony, or SBML) and run an ODE simulation
model = bngsim.Model.from_net("model.net")
sim = bngsim.Simulator(model, method="ode")
result = sim.run(t_span=(0.0, 100.0), n_points=1001)
result.time # (1001,) NumPy array of time points
result.observables["A"] # trajectory of observable "A"
result.dataframe # pandas DataFrame of time + all observables
Other formats load through the sibling constructors — Model.from_sbml,
Model.from_antimony, and their *_string variants.
Stochastic (method="ssa" / "psa"), network-free (NFsim / RuleMonkey), sensitivity
analysis, steady-state, and events are all covered in the quickstart
and user guide.
Documentation
Full documentation is hosted at bngsim.readthedocs.io
and lives in docs/:
- Installation · Quickstart
- User guide — loading models, simulation, network-free, results, events, sensitivities, steady state, compiled RHS and its artifact cache, SBML/SED-ML/OMEX interchange
- Reference — API · expression language
- Architecture · benchmarks & validation
The package ships one console script, bngsim-cache (equivalently
python -m bngsim.cache): it reports on and prunes the compiled-artifact cache that
codegen fills, which nothing empties on its own. See
managing the artifact cache.
Benchmarks & validation
bngsim beats run_network on every SSA/PSA model measured (geometric-mean speedup
~8.7× SSA), agrees with libRoadRunner across the full BioModels ODE corpus, and scores
1577 Match on the SBML semantic test suite with zero wrong-but-plausible answers.
The numbers, methodology, and reproducible harnesses are in
benchmarks & validation, with the committed cross-engine
snapshots under parity_checks/. To re-run the suites and reproduce the
numbers — the pinned-fetch model, corpus provenance, tool versions, and a no-download smoke
path — see REPRODUCING.md. The supported-construct matrix is in
SUPPORT_MATRIX.md.
Contributing
Build-from-source, test, and CI instructions are in CONTRIBUTING.md
and the development docs. Release history is in
CHANGELOG.md.
License
MIT. See LICENSE for the full text and the Triad/LANL copyright notice.
Third-party code and model/test-data corpora that BNGsim redistributes are listed, with their licenses, in NOTICE.
© 2026. Triad National Security, LLC. All rights reserved. This is a Los Alamos National Laboratory open-source release; LANL software release reference O5098.
Citation
If you use bngsim in your research, please cite:
Preprint coming soon!
Acknowledgments
BNGsim was developed and validated against RoadRunner, AMICI, COPASI, BioNetGen, and the SBML/DSMTS test suites. See ACKNOWLEDGMENTS.md for citations.
Metadata
Release files for bngsim 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bngsim-0.16.0.tar.gz | 7.6 MB | Details |
Built distributions (wheels)
Total release size: 76.8 MB
Release files / bngsim-0.16.0.tar.gz
| Download URL | bngsim-0.16.0.tar.gz |
|---|---|
| Size | 7.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e03cf16e81247f666d8274ca38af5675272a17071930d33ab09154e35e13b6f
|
|
BLAKE2b-256 checksum How to use checksums |
827ff0a0057c55c3bcc56ae2745a9a5d2b506ae42f7e320c87251104072ab680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp313-cp313-win_amd64.whl
| Download URL | bngsim-0.16.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
af89638df027602fa8989d2840abaaf73a8df3c3e933468ddaf21d9123458170
|
|
BLAKE2b-256 checksum How to use checksums |
604a873536ba3e7ad2d9649dbc78d9aea7c38438d00dc7670c1ebad1d79def56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | bngsim-0.16.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e26d74574ce079411a4c2054004b8c99fa850ec7e403f84fa10eab4eb224a55a
|
|
BLAKE2b-256 checksum How to use checksums |
ee5e5f7e07015c16d22979b9cf1a56b1b756d82640467c6f8f9b9b7da80b3862
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | bngsim-0.16.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3f71dabef42d5f370cb71ffa908272246142ba7866bedf59ec7d2eec0891c861
|
|
BLAKE2b-256 checksum How to use checksums |
6995274fccbd4c767a5fb57548067ae172a1ac6c23a8c7718536b66849705b6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp313-cp313-macosx_10_15_x86_64.whl
| Download URL | bngsim-0.16.0-cp313-cp313-macosx_10_15_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.13 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
706f92920d0c26dbf0d708c3e87438ab12418e68d4733942b03ff3c1ff1a44b2
|
|
BLAKE2b-256 checksum How to use checksums |
4d49605379d4de6c4521087a7e004be02d08a2c6fb25b6da8896bef2b02e4c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp312-cp312-win_amd64.whl
| Download URL | bngsim-0.16.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
33327746ee8993b4104824bfa05dec7093b8acb76afb1901b9d0ab70ab1083bd
|
|
BLAKE2b-256 checksum How to use checksums |
c547ac81ed5a61ce2d2f6dabb94f247f389a52bae10a2f83bc256823b890db61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | bngsim-0.16.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ba02d76abfcd47abb15b4a9168913f95569a5045c1c339e94740c0061ec1f8ed
|
|
BLAKE2b-256 checksum How to use checksums |
32a2c31dad4d576e56bb5c87d705b9a9aed0a64fc67af05fee0715c14a6d4bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | bngsim-0.16.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
572747e9fbe74eaaf69eff0314b6293f46cad4d609ad5cf7ac444d1fc60b5f70
|
|
BLAKE2b-256 checksum How to use checksums |
dbe99810db8eaf9ac1a95c4675eb9dae1e8d50392a48fcfa2af47917f1b1b083
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp312-cp312-macosx_10_15_x86_64.whl
| Download URL | bngsim-0.16.0-cp312-cp312-macosx_10_15_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.12 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
f0ae069400eaed59de245911fe9b2f5da5afd833136265da7b64deed533f9e95
|
|
BLAKE2b-256 checksum How to use checksums |
9ce15b6a53fb19841d430d36fd81a06b35755cd9927de4b4c83624b86a65e37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp311-cp311-win_amd64.whl
| Download URL | bngsim-0.16.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
bc5bf54d84618425a6e0a82c9d41671fddbfe3f0bd5fd4bd9ffb3823e778643b
|
|
BLAKE2b-256 checksum How to use checksums |
ccf5e954fb782411342c1d114c4f2e36d4401917eee1b77ec887c76d35c396ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | bngsim-0.16.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bf2d5910fb2cc8c4dca9297001ec9550ede1f2ddd4786e021ed3a6ca9b162d2a
|
|
BLAKE2b-256 checksum How to use checksums |
e66a3c88a5d88ccc62c30706012d78d591f0badad104e94d3ae7c6242a03e8db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | bngsim-0.16.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
00b0d321e54b34a3fac537b140e81c5f53d038213472eb688ce91ae882ee0741
|
|
BLAKE2b-256 checksum How to use checksums |
d65e2c5e45316001256997e1bdc3f4a7efca0773445bace4095832be36229abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp311-cp311-macosx_10_15_x86_64.whl
| Download URL | bngsim-0.16.0-cp311-cp311-macosx_10_15_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
330ca069c4107600c6e9c694e270985bc7bc07d7214e5fbd01c4eab7b7a2a7d9
|
|
BLAKE2b-256 checksum How to use checksums |
61ef42a263c895bd007a3613e615e3b76963598172a7b417bedd75d69afd690e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp310-cp310-win_amd64.whl
| Download URL | bngsim-0.16.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3b533710a8bb6d5a107151566d75ab04ab7b796485911991d6763a6acf82a0cc
|
|
BLAKE2b-256 checksum How to use checksums |
3ff6fabd498e71bea9de1d00bed031b1fef8ab405df4c76dfd0a7a6b3e27c03b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | bngsim-0.16.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
788fbfa86f79852722f0ada67243afdf3567fad7b934bdfe9ee30c63273aadbc
|
|
BLAKE2b-256 checksum How to use checksums |
68b7eaf672afc294d674d1fe0c5cbf907e7c02b929286ee9f6b2ac68528e9cd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | bngsim-0.16.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a07d05c0226f0b4734fc3555350c7b60d3a36ea19284817f82ca088dfd9f24d1
|
|
BLAKE2b-256 checksum How to use checksums |
5198638faeaec5f7871b92ef1ef388e491603e1fac7fbf05c35fd4545c77bc2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bngsim-0.16.0-cp310-cp310-macosx_10_15_x86_64.whl
| Download URL | bngsim-0.16.0-cp310-cp310-macosx_10_15_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
d7e6ff8701621d0ff1c10439590ada59b8fe948198f532a1129257f81b948f50
|
|
BLAKE2b-256 checksum How to use checksums |
8034d8cc47b3342c24a94988717eca236ecef57ebe4c69a6ca7ecbd6d8493d88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log