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 import make

env = make("EI")

env.apply_model_defaults()
env.record_spikes()
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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livn-2.0.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

livn-2.0.0-py3-none-win_amd64.whl (451.2 kB view details)

Uploaded Python 3Windows x86-64

livn-2.0.0-py3-none-pyemscripten_2026_0_wasm32.whl (353.7 kB view details)

Uploaded PyEmscripten 2026.0 wasm32Python 3

livn-2.0.0-py3-none-manylinux_2_28_x86_64.whl (369.6 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

livn-2.0.0-py3-none-manylinux_2_28_aarch64.whl (368.0 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

livn-2.0.0-py3-none-macosx_11_0_universal2.whl (387.4 kB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

livn-2.0.0-py3-none-any.whl (338.6 kB view details)

Uploaded Python 3

File details

Details for the file livn-2.0.0.tar.gz.

File metadata

  • Download URL: livn-2.0.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c67fd23155ef0cbc20bb22149e8205b4332adc9b9ed769b28547f999c6502167
MD5 575ad5c7284be3fd3c462ed06866c5ce
BLAKE2b-256 608eee660db22136314dfe98a5a9bd9332dfdc460b4b61a41b6027baae4a7c5f

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 451.2 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fba4d295a21cb06ad3ede79e960e8f3766e3333ba2dc388144d36d0f52948b44
MD5 772b71f698e1481d5a1e9daeee15808a
BLAKE2b-256 3b14162ecc7e43f837cce864f56d9b326286c6224bce11d5eb18f8acfc1bd7f5

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-pyemscripten_2026_0_wasm32.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-pyemscripten_2026_0_wasm32.whl
  • Upload date:
  • Size: 353.7 kB
  • Tags: PyEmscripten 2026.0 wasm32, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 2f2aa29c3db22edb261dd8655a32881db269a0418906d7cf9ef62ac3d4ae0f55
MD5 4b5bd3fbad97cea4d37f838b46893db4
BLAKE2b-256 86b4d87c4313535dd3a372d5ddc8e357b6bcf1b321c2b3d532c8d81aa2f05a23

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 369.6 kB
  • Tags: Python 3, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0680d659cea874f1e3861f86dade35510dac74b6a9c56f3f5e1b473738e1dbb
MD5 82b9d145cdc2664cf23cdfd62f00369d
BLAKE2b-256 07451ea33510adad9efd7251f97ced57ee2c3b2a79abeca6d39161045db7ecb0

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 368.0 kB
  • Tags: Python 3, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 49b6e7eee619f4aab5d1de89d11b3a715579e9986dc0d4afc1765e1d1e43128c
MD5 e6ed3c07e541ebebc689d4df27fdc502
BLAKE2b-256 c7bbca70c58e9b789988e2abd9563448c6592aeb9f3437ee8667c816b21804a4

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-macosx_11_0_universal2.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 387.4 kB
  • Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 d2f5ae1951a9a65867280f63d93a1ae47136162e1da72ee8cf089eeaf40d3188
MD5 59cb055e57e1df7ed3d90ae60327213e
BLAKE2b-256 d918a5aa8f75aa4e1f954c057526e5085ae7836d82202477fa8e20303ef1af14

See more details on using hashes here.

File details

Details for the file livn-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: livn-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 338.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for livn-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 711b07586216bbec048443b2597aca3dff6009845c7f6ea686b44112fdbc9ffb
MD5 7e9c5879e9663b7f6aba7d853b6504a9
BLAKE2b-256 7289b2ba7cce620f832a15ae8ea8498ab67d87f8bed296b961dbb296926b11c4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

7 files

1.0.0

2 files

0.1.0

1 file

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