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.13.0.tar.gz (7.0 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.13.0-cp313-cp313-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.13.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.0 MB view details)

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

bngsim-0.13.0-cp313-cp313-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.13.0-cp313-cp313-macosx_10_15_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.13.0-cp312-cp312-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.13.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.0 MB view details)

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

bngsim-0.13.0-cp312-cp312-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.13.0-cp312-cp312-macosx_10_15_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.13.0-cp311-cp311-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.13.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.0 MB view details)

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

bngsim-0.13.0-cp311-cp311-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.13.0-cp311-cp311-macosx_10_15_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.13.0-cp310-cp310-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.13.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.0 MB view details)

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

bngsim-0.13.0-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.13.0-cp310-cp310-macosx_10_15_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for bngsim-0.13.0.tar.gz
Algorithm Hash digest
SHA256 09d9f2b847676b86a30daeff0a3491e55715ee98bded8b2319846300de3bd494
MD5 37dbd0818e695056a463197ea4880032
BLAKE2b-256 520ae8cbcd4118181150be19c7909764f5a0964540b5066b1dc36f4b93ce0681

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.13.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.0 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.13.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d3f84180a7f35fefe85a096f9dfd4cdc9f790fd584f582da3d25de7ac8cf4abc
MD5 ee79705183d2339dd8caf74993c98573
BLAKE2b-256 85d8d9f8fcd56219bef5f7beddb4fa657d31c5e8bd428f62ddd2bb6a9eccb153

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 92070f11293235af4cbb35dc1ca8c7f2a106ef97af8d475698beeccb0a0a6d29
MD5 0bf0bc5e9ef3cbaefad7cd5b759f58db
BLAKE2b-256 08d8f17cabfe4e7ba34a29741b95fcc197e359ca07ddae172879419379bf0992

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1609029bdf1f3e9f93a4ed10230d13c840f382e8b3a925fc9bf515b413f175ce
MD5 abb84525d79ff3f3634efe8987e9a9cf
BLAKE2b-256 3cf48efe4ecdf992596400370db1f0e6e79a389eadc03f254681d0080b74c485

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 285e75cd6fe44e776e9d3032882464a8a71b0dc312f6504e63f996bc478c7c6a
MD5 777f121d94e449093bb1fc036822c666
BLAKE2b-256 a73f95610f67b77a7c67f20aaffa27e1b764ca3d1f8754ec1939367dcd703c0a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.13.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.0 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.13.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ef0391a2276810119d32d84924344dcb2a5c43fa30ab3aaee4e1a55c3bc19936
MD5 78fe561adb2b2a5d6ccacf885fb503b8
BLAKE2b-256 a7ad27549b6ec342117a0f613f9c87028b2a73eba74cc9a23c0ce80cf22c34c2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 278417da0cbf79bb27356fb214725c454c77a27ca02460b7e5a27a3d50c6957a
MD5 f9a377ed1d1993efc7fced3eab81970c
BLAKE2b-256 71b29b861a1b70c723a12c5a60d28f519d210a2f0202ebc5eeec28dbfd132507

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0de245f74a1cb2fe4f75437f13a59b856e0103493d5dbf3fd934931f2ca7bd5
MD5 22088496c7f93b076002563055ff52e9
BLAKE2b-256 0fb5ffb81dd565d4673337fee473f24a95fe580a002c6e3b1e2d2f3b0703c9e8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6169cb3d8d737de275f6fdde8d02279f96a677da72d3b0c494281b3074abcd82
MD5 e6cbdb4e1d971c9dc0e643de7b13f944
BLAKE2b-256 a8a1b32f97e0a94025e6352146e70578b9eecfd4452c87a641670ccfb5e59098

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.13.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.9 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.13.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aa2e88abdfc6ecf90f7c555d21229a1dca8463bbb6885b1574e60c8cd8b1a883
MD5 14898f7589c8ad008e342432e4c28e5b
BLAKE2b-256 9755fb10e418f3ef733b3d6f44d251d0f9cffb1de9b7382571e7ceb8c496763d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e358ea53e6d0d0ecf193c8e3b230df0d1d14b9d878b7bba347f236d3eb61054d
MD5 34f8d890f6f1149df7c8d856003a3e76
BLAKE2b-256 0d0468d1ea55b5fe95bf4b379541fa4c86ab2c2cdd58a03a80852797b19987e2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f8e2f8f7b425ea09b592248dc7e5a1e69d458a4b568e37d8f40b3e270d1c5df
MD5 18df6f9444603a0c282a06d4df1fc524
BLAKE2b-256 99823f46d5d182faa819a59f9acb1d6960afe48f7ff2ecbea2ee3532f6588afa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 42394f6c59b7e2c3c4b4a73ab26fa0a268a891f9a0eb73c09b278cc76cb45f80
MD5 9777be8ed9b671e2a0d4088d1047bf85
BLAKE2b-256 47d71f42021dde874cfdf78f4e95282d3416c7cb33e30078e406cae7b35012b1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.13.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.9 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.13.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 92450a74ed63fe35ddb40b2bee87b33ee80b4cb3c70f59c24ef9f57abc228384
MD5 cda859d7db25e115e4ccb2cd27546e1b
BLAKE2b-256 3368290c884057fa3cdda74b8542554babaf87df5bc2c2f32bccb659ebd69a5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 af599ff2916bcd412539dd34ab6a4756eb66ac3048b86a55e2e5b715c7ccfeb4
MD5 8b276db9980ac0aec171390297594ade
BLAKE2b-256 c13d02de3a4fa931997ea17e0f09bb3f2ddc9b3c0bec9e7df2108c08fbb6c83b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e71ee5ee8c156c505f81b4beb98a15dc4e6a8c34f3cb4ecd54385fe6d2a307b8
MD5 744f11ef5e245a59870480cc4e8e7be1
BLAKE2b-256 b96f17cb5d202e57fc3f0c88bd9d31256577d5ad4ed8ab90709f28563299e979

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.13.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6f68f888f255706ec8525e0bd59f4be7406ee46a9396e84d9d29ca00ba304c05
MD5 498c086b02b307ce224282e758cc97a3
BLAKE2b-256 f47f9c1a5976fd64c52a0c5efa1d0535f00e8ebf2952abf8e773d1f55659cbfe

See more details on using hashes here.

Provenance

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

This release

0.13.0 This release

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