Skip to main content
TVBO logo

The Virtual Brain Ontology

Lint & Test Ruff PyPI version PyPI - Downloads License Platform

tvbo is a semantic knowledge base, a metadata standard, and a Python toolbox for whole-brain network simulations. You describe a whole experiment (equations, network, coupling, integration, stimuli, observation, provenance) as one typed, ontology-grounded specification. From that single source, tvbo does two things:

  • Compiles it to runnable code across many backends and to a methods report, so a published study re-runs without drift between what the paper says, what the code does, and what the docs claim.
  • Grounds every entity in a four-domain ontology and knowledge graph, so models can be compared by what their parameters mean, not by what they are called.

One specification, two payoffs: a TVB-O SimulationExperiment (one typed object grouped by role) compiles to code and a methods report and runs across 14 backends (reproducible), and grounds into a knowledge graph where two models with different symbols meet at the same biology (comparable); the platform at tvbo.charite.de serves people and AI agents.

The hosted platform at tvbo.charite.de gives the same knowledge base and an experiment builder in the browser, with no local install.

Installation

pip install tvbo

Requires Python 3.11 or newer. The core install compiles any specification and runs it on JAX. Other simulation backends install as extras, listed in the Backends table.

Quick start

Specify a model and run it

from tvbo import Dynamics, SimulationExperiment

lorenz = Dynamics(
    parameters={"sigma": {"value": 10.0}, "rho": {"value": 28.0}, "beta": {"value": 8 / 3}},
    state_variables={
        "X": {"equation": {"rhs": "sigma * (Y - X)"}},
        "Y": {"equation": {"rhs": "X * (rho - Z) - Y"}},
        "Z": {"equation": {"rhs": "X * Y - beta * Z"}},
    },
)

# compile to JAX (core install) and run
SimulationExperiment(dynamics=lorenz).run("jax", duration=1000).plot()
The same model as a YAML specification
name: LorenzAttractor
parameters:
  sigma: {value: 10, label: Prandtl number}
  rho:   {value: 28, label: Rayleigh number}
  beta:  {value: 2.6666666666666665}
state_variables:
  X: {equation: {lhs: \dot{X}, rhs: sigma * (Y - X)}}
  Y: {equation: {lhs: \dot{Y}, rhs: X * (rho - Z) - Y}}
  Z: {equation: {lhs: \dot{Z}, rhs: X * Y - beta * Z}}

Load it with Dynamics.from_file("lorenz.yaml").

Inspect the generated code without running it

exp = SimulationExperiment(dynamics=lorenz)
print(exp.render_code("jax"))  # or "numpy", "julia", "tvb", "pyrates", ...

Load a curated model from the library

Models, networks, and studies ship with the package:

from tvbo import Dynamics, SimulationExperiment

exp = SimulationExperiment(dynamics=Dynamics.from_db("JansenRit"))
exp.run("jax").plot()
exp.report("pdf", outputfile="methods.pdf")  # provenance-aware methods report

Assemble a network model from curated components, referenced by semantic iri pointers:

exp = SimulationExperiment(
    dynamics={"iri": "tvbo:models/ReducedWongWangExcInh"},
    network={
        "iri": "tvbo:networks/tpl-MNI152NLin2009cAsym_cohort-HCPYA_rec-dTOR_atlas-DesikanKilliany_desc-SC_relmat",
        "coupling": {"c_glob": {"iri": "tvbo:coupling_functions/Linear"}},
    },
    integration={"method": "Heun", "duration": 10_000},
)

Anatomy of a SimulationExperiment

A specification captures everything needed to reproduce a run, not just the equations. Each section is written inline, loaded from YAML, or referenced by an iri pointer into the knowledge base.

Anatomy of a SimulationExperiment: Network, Dynamics, Coupling, Integration, Observation, Event/Stimulus, Exploration and Environment, each with its key fields.

What you can do

Specify Write dynamics, networks, coupling, stimuli, and observation as symbolic, typed objects in Python or YAML. Equations are stored symbolically, independent of any language or simulator.
Compile and run Generate synchronized code for 14 backends from one spec, then execute it (see the table below).
Explore and fit Declare parameter sweeps. The JAX-based tvboptim backend turns any experiment into a differentiable simulator for gradient-based fitting, Bayesian calibration, and large sweeps.
Analyze Run bifurcation analysis and numerical continuation of model regimes.
Ground Link every entity to a four-domain ontology: physics (QUDT/UO units), biology (Gene Ontology, ChEBI), anatomy (UBERON, openMINDS/SANDS), clinical (MeSH, ICD). Query the resulting knowledge graph.
Report and share Export FAIR metadata (LinkML YAML, openMINDS JSON-LD), W3C PROV-O provenance graphs, and methods reports (Markdown/PDF) from the same spec.
Scale out Emit self-contained SLURM, Snakemake, or Nextflow kits from the CLI (tvbo workflow submit) to run large sweeps on a cluster.
Assist agents tvbo skills install gives AI coding assistants (Claude, Cursor, Copilot) the spec format and a knowledge graph to query instead of guessing.

Backends

One specification, many targets. render_code(format=...) exports; run(format=...) executes.

Backend Extra For
JAX core Fast, differentiable, GPU/TPU; runs out of the box
tvboptim (default for run()) tvbo[tvboptim] JAX-based fitting, Bayesian calibration, large sweeps
NumPy / Python core Readable reference implementations
TVB tvbo[tvb] The Virtual Brain's curated neural-mass library
PyRates tvbo[pyrates] Rate-coded network models and numerical continuation
Julia (DifferentialEquations.jl, ModelingToolkit.jl, NetworkDynamics.jl, BifurcationKit.jl) tvbo[julia] Stiff solvers, symbolic modelling, bifurcation
NeuroML / LEMS tvbo[neuroml] Run via jNeuroML, NEURON, Brian2, NetPyNE, EDEN

Install a backend with pip install tvbo[<extra>]. The compiler also emits surface PDE-FEM fields and RateML/CUDA GPU kernels.

Backends are designed to agree within each integrator's numerical tolerance, not to be bit-for-bit identical. Deterministic runs of jax, tvboptim, and tvb match to tolerance; noise RNG does not transfer across backends.

The platform

The Python package is the engine. tvbo.charite.de puts the same knowledge base in the browser, with no install:

  • Knowledge Graph — search dynamics, networks, couplings, integrators, observation models, atlases, and studies as list and node-link views, with a SPARQL endpoint.
  • Experiment Builder — assemble and run an experiment in the browser, with a live schema-validated YAML panel, and export it as YAML or ready-to-run Python.
  • Save, share, publish — keep your own models and experiments private, share them with named colleagues, or submit them for review into the public gallery.
  • Round-trip to Python — pip install tvbo[api], mint an API key, then load a shared experiment back with the tvbo.platform client and run it.

Every experiment built on the platform runs on this open-source tvbo package.

Curated knowledge base

tvbo ships with a versioned library grounded in the ontology:

  • 39 canonical neural-mass models (106 database entries including per-backend variants)
  • 120 literature-derived studies with provenance
  • 63 brain networks spanning 19 to 1000 nodes
  • 9 coupling functions and 5 brain atlases

Load it from Python (Dynamics.from_db(...), SimulationStudy.from_db(...), Network.from_db(...)) or browse it at tvbo.charite.de.

How tvbo relates to existing tools

tvbo extends and aligns to existing standards rather than replacing them. It delegates execution to simulators and supplies the semantic layer that keeps results interoperable. SBML established the declarative, annotated pattern for biochemical networks; NeuroML/LEMS covers the cellular layer; BIDS and SONATA standardize data and cellular-resolution networks; PyRates compiles one model to several backends. What none of them provide is the grounding: a whole-brain model and its full experiment as one typed object that is executable, biologically grounded, and queryable at once. tvbo fills that gap and treats the others as backends or alignment targets.

Tool coverage matrix: seven capabilities (declarative single-source spec, compiles and runs on many backends, whole-brain network scope, four-domain grounding, curated queryable knowledge base, format interoperability, fitting and inference in the spec) across SBML, openMINDS, NeuroML, SONATA, PyRates and TVB-O. Only the TVB-O column is complete.

Documentation

Installation options

Each simulation backend installs as an extra listed in the Backends table. The other extras:

pip install tvbo             # core: specify, compile, run on JAX/NumPy
pip install tvbo[api]        # REST client for the platform
pip install tvbo[all]        # every backend and optional feature

On Intel Macs (x86_64), the [tvb] and [audio] extras pin numba<0.60 and llvmlite<0.44, because newer llvmlite has no macosx_x86_64 wheels for Python 3.12+, and JAX is capped below 0.5, since jaxlib 0.4.38 is the last release with a macosx_x86_64 wheel. Apple Silicon gets the latest compatible JAX automatically.

The knowledge extra needs a manual install:

pip install git+https://github.com/neurommsig/neurommsig-knowledge.git

The auto7p extra (bifurcation continuation, pulled in by pyrates) installs the pycobi wrapper, but the AUTO-07p engine is a Fortran program that is not on PyPI: build it separately, set AUTO_DIR, and link its python/ front-end onto your environment. See Installation → AUTO-07p continuation.

Citation

A manuscript describing tvbo is in preparation. Until it appears, please cite the software via this repository and tvbo.charite.de.

License

Copyright © 2025 Charité — Universitätsmedizin Berlin. The code and documentation are licensed under the European Union Public Licence (EUPL) v1.2 or later (LICENSE); the ontology, the LinkML schema and the curated records under CC BY 4.0. Third-party data files, and records that inline third-party labels, coordinates or values, carry their sources' licences as well, which REUSE.toml states file by file; the licence texts are in LICENSES.

Funding

P.R. acknowledges support by EU Horizon Europe program Horizon EBRAINS2.0 (101147319), VirtualBrainTwin (101137289), EBRAINS-PREP 101079717, AISN 101057655, EBRAIN-Health 101058516, EIC grant PHRASE 101058240, by the Digital Europe Programme TEF-Health (101100700), Shaiped (101195135), CoordinaTEF (101168074), German Research Foundation SFB 1436 (project ID 425899996), SFB 1315 (project ID 327654276), SFB 936 (project ID 178316478), SPP Computational Connectomics RI 2073/6-1, RI 2073/10-2, RI 2073/9-1, DFG Clinical Research Group BECAUSE-Y 504745852, Berlin University Alliance OpenMake, the Virtual Research Environment at the Charité Berlin, EBRAINS Health Data Cloud, and the Berlin Institute of Health and Foundation Charité. P.R. and J.M. acknowledge additional support by the Deutsche Forschungsgemeinschaft (DFG) — Project-ID 424778381 — TRR 295.

Metadata

Release files for tvbo 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tvbo 0.9.0
File Size Uploaded Provenance Actions
tvbo-0.9.0.tar.gz 24.4 MB With provenance Details for tvbo-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tvbo 0.9.0
File Interpreter ABI Platform Actions
tvbo-0.9.0-py3-none-any.whl Python 3 none any Details for tvbo-0.9.0-py3-none-any.whl

Total release size: 49.2 MB

Release files / tvbo-0.9.0.tar.gz

Download URL tvbo-0.9.0.tar.gz
Size 24.4 MB
Tags Source
SHA-256 checksum
How to use checksums
549e6e92131e2436f19bcdaf8a28761a29646c3e76dbb02caa1fe1983731c937
BLAKE2b-256 checksum
How to use checksums
47c9dad7fcfd91de30ad9f4cc9169f9da6a67b3bd4a3c9633e88b969486ec9bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tvbo-0.9.0-py3-none-any.whl

Download URL tvbo-0.9.0-py3-none-any.whl
Size 24.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
591d7306f1bce9d4ed759acaa927b4d67827db30e5d77f0cd81d0ecd2d8193a5
BLAKE2b-256 checksum
How to use checksums
cdb388194d2ad97d70d21656228a82b6f715ac69866fd976d2d5eb072191de84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for tvbo 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tvbo-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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