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.14.0.tar.gz (7.3 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.14.0-cp313-cp313-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.14.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.14.0-cp313-cp313-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.14.0-cp312-cp312-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.14.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.14.0-cp312-cp312-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.14.0-cp311-cp311-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.14.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.14.0-cp311-cp311-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.14.0-cp310-cp310-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.14.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.14.0-cp310-cp310-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.14.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.14.0.tar.gz.

File metadata

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

File hashes

Hashes for bngsim-0.14.0.tar.gz
Algorithm Hash digest
SHA256 02a0fb19afd9dd208f3118295bee84148c5f80336c6f3b6e34e5f15ee7427438
MD5 e19dedbaa1248da43aa1114014017453
BLAKE2b-256 6d20da95e381d6a7e986f391eddee90899e1553f5eea369ae40892ff9cc6d6ed

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.14.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.1 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.14.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c5eea24e581ea5888d964e0893cfa524b84a5ba462a6bab9a5d22d3ebf74d4ff
MD5 d7e2f45ee30e942bb1bc65964df55ecc
BLAKE2b-256 4832d764ad65bb054f10df9d496fd036604bb5c3929978a26aefbf3bf9009aaa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 387ba45d88768796eb44b2e33da381892ad7539898c0ab669d168111d75ac149
MD5 a4170530c8f3aaa41312f6641fa90bef
BLAKE2b-256 e5cca406c648869cf97ea81a78eafb033531225bb454984df61558e5cf6e327d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89309086122c192c7bf76e9d6a7876b05e52a74fa831192d67c0dc9f5eda5e20
MD5 70d968500127559e1b68885d9c56d258
BLAKE2b-256 d7c7c56fb00d0dc9d189909b628e2f9ce4fffd63cb64add2f99c419580f0ed8b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 af4be392a1f0e3c6d6931b30dc501b029f741dc30d8203fb7c70a46ad9c3e442
MD5 be1341beadd0ba07d730c0a90f1e8e7e
BLAKE2b-256 241435af58aad9680561a0a2d4a726c424ede940233a05832c1193cfa7fa9fb6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.14.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.1 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.14.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d58a11e685487f4ff95d3dfb4789b62580be40a8233ed07a70a444ebdd1aec49
MD5 e948725a663989755d397843eb420c4e
BLAKE2b-256 7357269883c65ab0a957fd8e7815dc3e79269b67b8ae26b8aa6d16c353d987f4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 12bc44d953837a0da38ab365c6fbc63cab05c33bf8e2401fcc25a84646570376
MD5 b52fa671d881308720c087cf78ef648a
BLAKE2b-256 fb49977173400c62ade6d60d4deabf93850e29073afd37dd825d9c7ca8e7f48c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efcdc3c99715471d98f79570f765dce9657523b7e6d6b3eea0b2ec5463be2137
MD5 3bc43271105142990366fb69e73f9df7
BLAKE2b-256 552301a06ba83ca5ab1abd77e33350110b4fe56096359081a4421dc9b9f821d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 206eb71f66071bc980fea947c5c1c171c356b188fce0ef9375567d5053178b00
MD5 9c64f15051a5237c9bc97fde1940d08f
BLAKE2b-256 720c8e197535371fafec93f7c3226af61bc187b3ac81ac671c2de4451a665dd3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.14.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.1 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.14.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd48b998a85a1b2780989a4fcf1e36a33deeb30b18cbd50a0eda2fdf4fc75214
MD5 80cbe0bee67bfe2e70e2b8372947c3ba
BLAKE2b-256 ee3ed1adfc8cee130b9ab889cfd735875a474891f5e06fc1588ccd0ddf4641da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 343c9cf798c0d88e307a9e8e72156a784a9e7caa68b4a549536b322e208260ea
MD5 1e285407b05c2d9c5eb6f8c62c29eb18
BLAKE2b-256 3b54cab0935a27e453173b691ec1c5f500fe929dce2c0fe8af1dfa39654a228b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a487d00a52564c38f172c20f08f603d8ce8197f2bdae81736f8f101d3be2bac0
MD5 f5004f4cb3f605ddaad00780df96ba17
BLAKE2b-256 94a1f94f9179801a851ee409cb27084c82f0980b9ccb9ed7ce0dada2d1189c03

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 935f01331a7ca010cd2f54ffcf92c5873eb4a0790189f13a1b02527ed78c723e
MD5 e8e8a494011da5a3c0b97d0755ce8472
BLAKE2b-256 9f2ad1766ff10fecd1c4de878c099684ff2938ea8cb6382071c625b51ea29afc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.14.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.1 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.14.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1ea77039726783650cf14588ef208a489964c46d421416eeb7518ab116f61bbd
MD5 b24d3c909bd51111b4701fdcea0b7e22
BLAKE2b-256 284442a86e936e6398d8c462be887e1900b60203792ef5c88c3e6f65f78e0f0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3dc458a24f87f84f99ad54995d13c1c78b2f0fc790382bf4ca96109908ad4cd2
MD5 061f60a8e28609cb5e198e7a12fd6b10
BLAKE2b-256 7c50c1af0e30e2341a60d4973872b3c49bf585bcc16a884bfb33acf53ae85e82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3ccbce7dc324fbdee2c80ff81c8b2e8389c22418f59cafbb03958e0e15430a7b
MD5 f723f0feedc0d0793a2f5a2c381ab19d
BLAKE2b-256 2f686214392af24806fe7045464b71be7fe9d924595677a5a7c2278097f38a26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.14.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bb11b63292187b8ff7bd88e68073086f79623d98dd0389bdee768a819323f062
MD5 ddafa8b2290f38ff581acf6df403f19e
BLAKE2b-256 594b1a8ae12034ac3426b7224cc735306eb5f333b4e81ea1733c699689357f28

See more details on using hashes here.

Provenance

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

This release

0.14.0 This release

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