Skip to main content

livn

A testbed for learning to interact with in vitro neural networks

Documentation Paper

livn is an open-source interactive simulation environment for learning to control in vitro neural networks. It generates synthetic neural data with ground truth at scale, enabling the development and testing of ML models in interactive settings that mimic experimental platforms such as multi-electrode arrays. By providing an extensible platform for developing and benchmarking machine learning models, livn aims to accelerate progress in both ML-driven understanding and engineering of in vitro neural systems and fundamental understanding of computation in biological neural networks.

pip install livn

Read the full documentation →

Features

  • Multiple backends — Run simulations using Brian2, NEURON, or JAX (diffrax) depending on your needs
  • Multi-electrode arrays — Observe neural activity through realistic MEA configurations with stimulation and recording
  • Differentiable — Differentiate through the full simulation environment (including IO) when using the JAX backend
  • RL integration — Standard Gymnasium interface for reinforcement learning experiments
  • Curated datasets — Access pre-generated datasets on Hugging Face for training and evaluation
  • Parallel execution — Scale up with MPI-based parallel simulations for large-scale experiments on CPU and GPU

Quickstart

Running a simulation

from livn.env import Env
from livn.system import Monolayer

env = Env(Monolayer(total_cells=650)).init()

env.apply_model_defaults()
env = env.record_spikes()
env = env.record_voltage()

it, t, iv, v, *_ = env.run(100)

print("Initial voltages: ", v[:, 0])

Backends

livn supports four simulation backends:

export LIVN_BACKEND=native     # default; ships with livn, no further dependencies
export LIVN_BACKEND=brian2     # point-neuron models
export LIVN_BACKEND=diffrax    # JAX-based, differentiable
export LIVN_BACKEND=neuron     # MPI-parallel, multi-compartment

See the documentation for details.

Documentation

Full documentation at livn-org.github.io/livn covering:

  • Getting started — installation, first simulation, using datasets
  • Concepts — environments, systems, models, IO, encoding, decoding, stimulus
  • Systems — generating, tuning, and sampling custom systems
  • Examples — dataset usage, differentiable simulation, reinforcement learning

Full installation

Clone this repo and install with uv:

uv sync --all-packages --all-groups --all-extras

Citation

If you use livn in your research, please cite:

@article{GressmannLIVN2025,
	author = {Gressmann, Frithjof and Raikov, Ivan Georgiev and Pham, Hau Ngoc and Coats, Evan and Soltesz, Ivan and Rauchwerger, Lawrence},
	title = {livn: A testbed for learning to interact with in vitro neural networks},
	elocation-id = {2025.12.16.694706},
	year = {2025},
	doi = {10.64898/2025.12.16.694706},
	publisher = {Cold Spring Harbor Laboratory},
	URL = {https://www.biorxiv.org/content/early/2025/12/19/2025.12.16.694706},
	eprint = {https://www.biorxiv.org/content/early/2025/12/19/2025.12.16.694706.full.pdf},
	journal = {bioRxiv}
}

License

MIT, see LICENSE.txt.

Metadata

Release files for livn 3.0.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 livn 3.0.0
File Size Uploaded Provenance Actions
livn-3.0.0.tar.gz 2.3 MB Without provenance Details for livn-3.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for livn 3.0.0
File Actions
livn-3.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for livn-3.0.0-py3-none-win_amd64.whl
livn-3.0.0-py3-none-pyemscripten_2026_0_wasm32.whl Python 3 none PyEmscripten 2026.0+ WebAssembly Details for livn-3.0.0-py3-none-pyemscripten_2026_0_wasm32.whl
livn-3.0.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for livn-3.0.0-py3-none-manylinux_2_28_x86_64.whl
livn-3.0.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for livn-3.0.0-py3-none-manylinux_2_28_aarch64.whl
livn-3.0.0-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details for livn-3.0.0-py3-none-macosx_11_0_universal2.whl
livn-3.0.0-py3-none-any.whl Python 3 none any Details for livn-3.0.0-py3-none-any.whl

Total release size: 6.0 MB

Release files / livn-3.0.0.tar.gz

Download URL livn-3.0.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1502790d52ecef6cf81e8bd53e8f2517de57deb3b80b424210464724f911a330
BLAKE2b-256 checksum
How to use checksums
62e286a31e66b72cfeadc746e1db6836177d0642065099df1ae578586f47c6a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-win_amd64.whl

Download URL livn-3.0.0-py3-none-win_amd64.whl
Size 701.5 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a4ea7d3342508c22cfec440d94a9731b98dcc5d6d63ebf1cbda458eee24368f4
BLAKE2b-256 checksum
How to use checksums
3093e9d467a69298c915fb49e42c729299f7d870af598b145d61bb80bdca698e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-pyemscripten_2026_0_wasm32.whl

Download URL livn-3.0.0-py3-none-pyemscripten_2026_0_wasm32.whl
Size 587.9 kB
Tags PyEmscripten 2026.0+ WebAssembly Python 3
SHA-256 checksum
How to use checksums
1ebd81a48becfa937f5b1c297e5a1f11499358b94532dd4f84e9b2fcfa644fc8
BLAKE2b-256 checksum
How to use checksums
320af1d36906d8b2dfa39c3c47d19fdd85d1e407b1ad421603d5272ac260e02f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-manylinux_2_28_x86_64.whl

Download URL livn-3.0.0-py3-none-manylinux_2_28_x86_64.whl
Size 611.2 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
dcf85a4d425178e2b4264881d3ce2e58529d8610fa6d7a380b076bd29c3466dc
BLAKE2b-256 checksum
How to use checksums
97b3dfd46bad9ef4e6f0fc1a363580b6c3abf40f32191a38f3c78381fe441b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-manylinux_2_28_aarch64.whl

Download URL livn-3.0.0-py3-none-manylinux_2_28_aarch64.whl
Size 608.6 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
1dd53f90e64d4bf5c20cc959751a02fa7d72af6cd8abba6d4cc4802ac4d74c60
BLAKE2b-256 checksum
How to use checksums
54da163729b9b6bb8ec6e79bce4e3f82113e7a04be826279595e00450158a78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-macosx_11_0_universal2.whl

Download URL livn-3.0.0-py3-none-macosx_11_0_universal2.whl
Size 639.6 kB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
0a3dc1e6af7f138273568582422e72e2e4dd5e18c014a96fbce2481c9c94621b
BLAKE2b-256 checksum
How to use checksums
dc40b8fad59cdcb3fc6dfa77d082a4110616be1716c4bcda823c12c50b32deb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / livn-3.0.0-py3-none-any.whl

Download URL livn-3.0.0-py3-none-any.whl
Size 565.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e23b713178b8f7c896583d964c9b4e01a18769dbe09e4a198f4145c75948239d
BLAKE2b-256 checksum
How to use checksums
d0eedd77ea88d37c4823b6f2193696a3748ecea3e707d6728d9974fd70ff0140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for livn 3.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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