Skip to main content

bngsim

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 runtimeimport bngsim; no compilers, no BNGPATH, no Perl
  • Modern SUNDIALS — v7.x CVODE/CVODES with re-entrant SUNContext
  • Multi-format — loads BioNetGen .net and .xml, Antimony (.ant), and SBML (.xml) models SBML Test Suite results
  • 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_network to ~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_file("model.net")
sim = bngsim.Simulator(model, method="ode")
result = sim.run(t_end=100.0, n_steps=1000)

result.times          # (1001,) NumPy array of time points
result["A"]           # trajectory of observable "A"
result.to_dataframe() # pandas DataFrame of all observables

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/:

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.

Download files

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

Source Distribution

bngsim-0.12.0.tar.gz (6.7 MB view details)

Uploaded Source

Built Distributions

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

bngsim-0.12.0-cp313-cp313-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.12.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.12.0-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.12.0-cp313-cp313-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.12.0-cp312-cp312-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.12.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.12.0-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.12.0-cp312-cp312-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.12.0-cp311-cp311-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.12.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.12.0-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.12.0-cp311-cp311-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.12.0-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.12.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.12.0-cp310-cp310-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.12.0-cp310-cp310-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

Details for the file bngsim-0.12.0.tar.gz.

File metadata

  • Download URL: bngsim-0.12.0.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.0.tar.gz
Algorithm Hash digest
SHA256 e38124545dab3164d1b1a471e3420140af56d1252962373ce3cd19c525b6cdd9
MD5 27f61f0fe036b8bdf3d4d35b759e6b54
BLAKE2b-256 2f81c3d9c8d0341be3246506154099593038f358b3bf761cd6026656cd4732b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0.tar.gz:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.12.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4cea6f1e46ce2fdb8b2feb8a6a3d577048309675290330fc4ca47f8f145c7aee
MD5 1805714fce7d487cbf513a74197dce16
BLAKE2b-256 36f2dd62898dcb91e1155c365e63a2ac2d93a91dfa51f254138578a8525cd715

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f65cd4b10819f71b60589f86359c704b8b3f3dc78db341192b5538d94bb79ff
MD5 2feb8db403eee6f08840a33f98e008f5
BLAKE2b-256 3d0735d2417ccd882c2d47051dfe3a0cd3068ab2e01674330ca27bce31020a3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed6c4c90e85c13d6b8b545a2b4136e8fda57c2c2c2a1d0147f598c9e9e9ae180
MD5 54c9391a8923335802de166927e7dc20
BLAKE2b-256 e81c09d4aa7abcae0bb5f69a99ee92882d098cde5024c26fe9a753d5f33e0a16

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e0fb2ba0601d5fb285fe0df314f9ba1cbdeeb1aecf5d6a0dbc525672df08e074
MD5 033b73a43b21d0f4679aae9177cc7404
BLAKE2b-256 d62947d874b537ea637b9be852989a2013126a5a177ff3f4e5f19524495f640f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp313-cp313-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.12.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6d52b802d68c10cc4363e8e59071e8c5fb3d1d74cd147eb9457959c249f2cbe1
MD5 b632b30d1ba55cfa77d70d2379affde0
BLAKE2b-256 2fa5be41e9525fca69acdb565cece154e2c2980b14ab81e4f74e9c4b05e2865d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e474ae03576be1fcd97e86b65e39ae13e47424631a20624c7bbe6406aad20a5
MD5 c3e4ea631e10eb588e193515a527e9d6
BLAKE2b-256 95e404e361e87bd6e309b2fe347ac8775542c969a72b99971161df6080294e92

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 476017c74db7ec1678543e608f4eed181b00088055ca0e212e7558e448725128
MD5 ce27d2fa6d429bd5f1f79ba1858a255e
BLAKE2b-256 247e08cdcae42df5a347d7872df5d19fa5f3bebfcac7ee88eabf9802d744cafa

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 544c240c93ffe1332ce6440bcf275e387dbe49f74089207eb8b56f92d361356f
MD5 5a68a2c0e3b69424a939a416c2c66b08
BLAKE2b-256 83c2163eef96d0d074a5258b0e4dfe4960c3b81f9c65ba2ff3e0dfd298bae555

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp312-cp312-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.12.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1df507cf2eaacdb93469af43b4753f117399e890328e61c347565398d16abdb3
MD5 36314f41ce2bd3f2cc48a598bb0fdf1a
BLAKE2b-256 37d979d9d8da3140f27fb0e1891f9d903bacb04fd2bf0bb0257d8dd849a13bcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e57def8af60c4e17474fb5b90e828d7e8148f071fad55be059f92a32daa7a9e6
MD5 3bd4cc3038cef79ae56aa72ea4241f29
BLAKE2b-256 ae15f11bfeef69c389b4aee7aa90d15247dfd6bbeb26fea8519c3f7fd2914315

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c79cb84d5f1c3faf165dab8d643fc05350d4bb050c6fed36b3613201136e1c1
MD5 7ab3f9bf133fb2d443f36d952c6c0977
BLAKE2b-256 c9ec40aa89b84f4c69e514b52d7919fae7b36ba1cb0acb2a927eab7a052b3d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4a26ff38f8c16e8b47f248c1720c3d703b07b15977c07e9e56e69939afef6c3c
MD5 2b2751e93d7bd6ace5d69fdb68fcebc2
BLAKE2b-256 2e915b99cfb704d317a981c13dd8ca451a10ba91d6f23d3a72dfa77272c37cc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp311-cp311-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.12.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7f7ab1c691c617a2dc6bf4e816fc2e039bb22610b179941954c2a0da82e2a549
MD5 d27a988a468638d846f37902ab7466b1
BLAKE2b-256 faae8817e68a95b08f44b8140b46c0c091ffeef238c4c8236fca4d8fd80ceae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5076031ba86f8dae3f6ebfca1ada60e285be72e424192d98fe0f840ee8ae6634
MD5 f35d516fa7d41ae00f85a796da38e8ee
BLAKE2b-256 82639c61da6dd59349dbbee055b8a22514347b789001038f63a5c91e1316ee37

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2391ef6bae6c4aedc6aaee296ff5e88fb0ce0bebfe5f9dcc7dde10d1824e3a15
MD5 82d41c7659b56066c14805fb9a518b78
BLAKE2b-256 1b3a97bdbec6c71d7dfd290245d94f910a0c80e2b762da160b3c4226b683c685

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.12.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.12.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 44b1c56d81cb195f561a14b1a17140205a50046e5fb583608ba52c7085e8c6ea
MD5 779b79ea38d91c4c3a6f46f973b1f240
BLAKE2b-256 7fa33c22ed38fd1c0bc003fc8d0087fa2c95705fe1874e73886bfd1ea8d5bfa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.12.0-cp310-cp310-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.15.1

17 files

0.15.0

17 files

0.14.0

17 files

0.13.0

17 files

0.12.2

17 files

0.12.1

17 files

This release

0.12.0 This release

17 files

0.11.35

17 files

0.11.34

17 files

0.11.33

17 files

0.11.32

17 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page