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.0.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.0-cp313-cp313-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.15.0-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.0-cp313-cp313-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.15.0-cp313-cp313-macosx_10_15_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

bngsim-0.15.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.15.0-cp312-cp312-macosx_10_15_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

bngsim-0.15.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

bngsim-0.15.0-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.0-cp310-cp310-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.15.0-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.0.tar.gz.

File metadata

  • Download URL: bngsim-0.15.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d1e3a3a03049e1133ee99c5034893347b7c2835297c8386840ad708abf36a2a9
MD5 278a584ee234294dfafa9de4695ec8e8
BLAKE2b-256 73ea59e0f5d362e79fad35ff3de5406621e7cf3c9c31dc7ee048f993ba6faecc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.15.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 23dcc1d590c34e475fcd1cef06e418bb3d57a7508cb18647fa94fa2bf8eb4ef0
MD5 fc14f9e5499dfff0d5b30ca41cb20a41
BLAKE2b-256 35a04c633c10929ac0356b59c897936c50182710fb69fdd74e4607e9423750aa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 abcf65e41bae9bb786cf8fc5da17027a5fa069bf96378e98cf99a565127ce38b
MD5 066e272a06592006f038f3cb01afa7a8
BLAKE2b-256 e0defbd67a4ffb588f4e172d8c4e3133333325220a578382bbbda262c437ba1b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3018d06efb34bf79391b5cc3b08892c91799eb079fa1b5735bcf4f806d72f5ac
MD5 7e1d02ab7b6a1b6b6944ca3924cd1baa
BLAKE2b-256 2a3ad59840acda18ae600d9e4adf21cc3897c8c0c19be5439736c0cea476b61f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f2e4f8394f675f46e737725422134b5114895878cebf36b0040a52618bef9eb0
MD5 360d4a4307d30d43b2f1761a0eedb168
BLAKE2b-256 8c1203ab2a6f1341106aeb711b43eb528803697aad4e0012f351088f0311a0be

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.15.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 805a0097e81c2ca782204fdb237db251843307ec2a4daebcfa0038c51ad902de
MD5 ceeb3c65e0394dd260700965b31b6931
BLAKE2b-256 ada56bdffada418adec3a759c3366cca1fd7d9874fd025b3f7975759fb1bda0f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c30d4be53239e1283796906cae80354472b343b0965810395219145c91451c3
MD5 5d3484372d36f7ce588fc8a25ba276a1
BLAKE2b-256 ad202e96206192dad86cfd1c193481e5c7c8b3580f154af4cf8f9fb2bcd2576c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51de095605d5bf10b685ba8a2c6549f57dd6ee6ec2ba1d0a118475554cc25e48
MD5 46d8469ed89bd90e0fef28cab4f00e03
BLAKE2b-256 b2cdc365aa0b56ad6a39b07ec0efbcfa7dce204e9f2b1f771587694e2e517402

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0e4c01f4fa7ea5069b9dcfeb065ea265a7a620de913d00e0a6aae9aa9bbf9d6f
MD5 98e8407098db628536c851a15a923a28
BLAKE2b-256 140540be182391bc1dfa13cb393cb619966ebef8024e0527b417161f66336d46

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.15.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5df6cad510d3c374084e3b99d5781478b049cec7914b8e3d724a49343c016e98
MD5 2c34adaa50896efc978bf79e6344acbc
BLAKE2b-256 88fb5850f3d0f0836d3bdb3568c5267529a8b8f7510e94a58b6d12baf769c223

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea64c1b3ce7c3ea8b792a9f8334642714860d7ff0ea042b29948a978fa9b16d0
MD5 51afeaf89bbbb231ece9c31bd3d309ea
BLAKE2b-256 ec9cfe99b3b2a6a84cb4a7d9108bfeec5dbc52f6b6ad5f8da8974a205477e566

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7800ac84198f37c67965dd83124fd8ec3af7da915913df59db2d88297cc30091
MD5 8aad522e71206a6580534239dea85064
BLAKE2b-256 051a5a7d76ee2944df696c7077177ab7b965eddcd8d87d269b1fac950c74e712

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0ea22226b8896936cb831f3782b7e6b588cdfabbeae014be349465c733edb80c
MD5 8dcb1f27690c0fddd23101b8dac9c0b9
BLAKE2b-256 db3d735cc112e307f10474f0c21813f00c4ddd685722941b206ceaecc61decea

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.15.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 825f4f53d38e037f35decc76c481b56f7bb28c8ddace5a25b01c2b1f86d2e096
MD5 1c643ad14e3fde25588dd73ded4e4942
BLAKE2b-256 51234d736e02bad69fa21dc64a2a8e74d2476fe6676c1b6f1361554e8c340117

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 35a4f4b5710229b17c11960a39fdcfdc5d827c856c0a9be308182b8232e36c59
MD5 f09ad0efdfa258ed0825d962baf90533
BLAKE2b-256 b5da1c853614fa4563c2054763e307985747691a9d721fb7ac5815e9e665caea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4371c6a16963efd77f4581131c87a474da68d530fa123c95e6eec639f89d2b6
MD5 0600c9597359bb5534b81160e6a65214
BLAKE2b-256 59edee7e3116419858e75e7de017311359b295c9169df2e85345861f7cdcebf5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.15.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5387e26ae4fd802b1b507189e786a2f32b04369f675c356a775a708180862ad9
MD5 3a6adcbb78bbb544a6d7b24d84314c67
BLAKE2b-256 2e72a9273d94fac28ecf2a2bfb71acaa4fac08508439c18cfb4ecb1515c8a594

See more details on using hashes here.

Provenance

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

This release

0.15.0 This release

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