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, plus rule-based BNGL (.bngl) via BNG2.pl with bngsim[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_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("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/:

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.

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.15.1.tar.gz (7.4 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.15.1-cp313-cp313-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.15.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.2 MB view details)

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

bngsim-0.15.1-cp313-cp313-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.15.1-cp313-cp313-macosx_10_15_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.15.1-cp312-cp312-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.15.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.2 MB view details)

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

bngsim-0.15.1-cp312-cp312-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.15.1-cp312-cp312-macosx_10_15_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.15.1-cp311-cp311-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.15.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.2 MB view details)

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

bngsim-0.15.1-cp311-cp311-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.15.1-cp311-cp311-macosx_10_15_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.15.1-cp310-cp310-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.15.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.2 MB view details)

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

bngsim-0.15.1-cp310-cp310-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.15.1-cp310-cp310-macosx_10_15_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for bngsim-0.15.1.tar.gz
Algorithm Hash digest
SHA256 5cf6e62645e8bbb062feb56b094aeb0529bf1e801a19b07b558587a1fd426c2e
MD5 1856059b176a852afcdaafcbe6bfb8c0
BLAKE2b-256 3a25c90abf62f32ef3ad512cb80edc58dbdff93870800de6b4dcbb9987d4c6b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1.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.15.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.15.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.15.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe49a127165049d8e95c4d69e036ba7646fb6b8d1309e8823359cc0bef820369
MD5 9f77c83ad2731efe9790da7356446cd6
BLAKE2b-256 1f95c29cc781221f6a2958e334a06308d59b96b3dfe8e68138b90a36bcf09ad2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8151d84270e3d2d13bcc23139e083c2cd4314d025d87221a00bfee77be110090
MD5 d65ced277f1d61ca5218f8c5be276d0a
BLAKE2b-256 7e9935d47e15bfc32f31dc6d42e8481a47fd7276c2230d35bc43cf4131983b87

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81fdd1a554244af2a1091f2ca51ce246b368b88fc15c11f2f09aba41f859b556
MD5 8e5b62511b864bb5a393b18c4241195c
BLAKE2b-256 35167e4bd394ddf961210f65ee5835bc63fc2861274b162c5d200d2e2907fe29

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0ac960c9b00ad996d8bcc1a3fdd2fb68947c1a4e5bf2e84502cdf495728a00b8
MD5 affb410c749b63e861d92e275138345c
BLAKE2b-256 6b590baa3dc4c79116b8982004af1c31591362f8dda7106e7f9b495bda2e514c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.15.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.15.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0bf900ab5e85724f95778c9ba713ff5a30974947d3261c69290385d5fd221ed6
MD5 31218af611ad91884303fbf200413549
BLAKE2b-256 d7b90e2147421688b247e754e445cb71444a2edc0000ff09298a46f5fbbc02c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b486104965957255c83b1d1582f15221c50d7aad3975ac91b2738bd83f159f1
MD5 a7d84049d57c4fe24890b8557dea5bd9
BLAKE2b-256 7b3960ba0a4875ace9442cdd09987cd80f9635f20b2f2747c2b90fa39f2b54c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b4307f6ea157fa99d5edcd577eba3b544112c9eb5a6ce3dd46a2a21ebc495e7
MD5 6a9ec7056bb10927720334aea11557ae
BLAKE2b-256 7fe93ade4a0aaa37425d0e2f8d398019cb9a6001c4094804591c592dde8e7965

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 37db8c0c4d1098880e8856d56fd8fded9e1c79b217f8f50b8078968b04cc05f6
MD5 94d177f99008bc8431402056df61f964
BLAKE2b-256 22c05ebfe7168e47b2ea30fe50ea1d768bf032f2efad79bf37d1d0063c8db03a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.15.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.15.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c08883d5e04c6ae99a70c4673670f23b5f08f1e946cd64535733733bd19df36
MD5 76d146d742c132aa4fb5534c97186598
BLAKE2b-256 26f01240777bb30c0fc708ee38bdd59a624894797710c2a091b72fe87298856d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65a7f96224b5ba68dc263e8f4cd16593d4720762ba163aa24d4b42f8fb6a78ff
MD5 f9628ae2910671f339a0b392115bc106
BLAKE2b-256 bfcd3995f3d414a83fb3de7b156d9ad0097089b433d1131c533262282b2033d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad65714879763a15af822ec0210c812069fd3dc3c614240c6dca0371f25b537b
MD5 c8f9d208bce0888d788267a34111ff78
BLAKE2b-256 bf7ad4fae5ab549d8ba28f2dae676f0df0122ba64a1b95c42385052538325ccc

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 19dce45ce8b4d1d38d5f7d5e6d9859976acc6b3f56d9b74aab6754dfe73b0f94
MD5 a89bedc09a1475a018e3b9a6d69d352b
BLAKE2b-256 b6026249cd371d30ad7954a59f76f39b7b1532f9a209164b68b2942067736781

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.15.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.15.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5d2e30397a159a52bebe19e6bac4c38b204a7b391875de1ea1b8b406ab36f4f9
MD5 ff361b6486ad92026e43d54f9c9979f9
BLAKE2b-256 e947d302c403f2855bdf8edb702bfa23b8841bdb448cc67dfbf60a5c8bd32641

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f9cd9295f1ef538d4a121b8caf69973ec584f40e231d47d524aefbb282c69d9
MD5 92eb2ff975e8ef7cae3303c56c6356fa
BLAKE2b-256 3f5806add44d4f2fa23b1f93378a81281ff6e143bbaa6aa26af566336324abb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23ff5497ee9b503fa1098c65ee159c9c855a8c7870544624826582035dcf906b
MD5 fa82e78852d4a97f7676593dd2d02c7d
BLAKE2b-256 cd0b60e86477d37077d2b407e622b492a1b59dca74d6c29ebdc122e715309fa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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.15.1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.15.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 eadc1cc3c0eaef64af59c20ec76d31c2fe60c83e66d6c1d0184df164053bb530
MD5 7a0f59165a1234dff988069de275ee3b
BLAKE2b-256 21d7b9be04869cb83844d1ebc0e842f9fdf0b65f47126a2d61b0084b3f8e2f0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.15.1-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

This release

0.15.1 This release

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

0.12.0

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