Skip to main content

Differentiable neuron simulations on CPU, GPU, or TPU

PyPI version Contributions welcome Tests GitHub license

Documentation | Getting Started | Install guide | Reference docs | FAQ

What is Jaxley?

Jaxley is a differentiable simulator for biophysical neuron models, written in the Python library JAX. Its key features are:

  • automatic differentiation, allowing gradient-based optimization of thousands of parameters
  • support for CPU, GPU, or TPU without any changes to the code
  • jit-compilation, making it as fast as other packages while being fully written in Python
  • support for multicompartment neurons
  • elegant mechanisms for parameter sharing

Getting started

Jaxley allows to simulate biophysical neuron models on CPU, GPU, or TPU:

import matplotlib.pyplot as plt
from jax import config

import jaxley as jx
from jaxley.channels import HH

config.update("jax_platform_name", "cpu")  # Or "gpu" / "tpu".

cell = jx.Cell()  # Define cell.
cell.insert(HH())  # Insert channels.

current = jx.step_current(i_delay=1.0, i_dur=1.0, i_amp=0.1, delta_t=0.025, t_max=10.0)
cell.stimulate(current)  # Stimulate with step current.
cell.record("v")  # Record voltage.

v = jx.integrate(cell)  # Run simulation.
plt.plot(v.T)  # Plot voltage trace.

Here you can find an overview of what kinds of models can be implemented in Jaxley. If you want to learn more, we recommend you to check out our tutorials on how to:

Installation

Jaxley is available on PyPI:

pip install jaxley

This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX Github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run

pip install -U "jax[cuda13]"

Feedback and Contributions

We welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct.

License

Apache License Version 2.0 (Apache-2.0)

Citation

If you use Jaxley, consider citing the corresponding paper:

@article{deistler2025jaxley,
  title={Jaxley: differentiable simulation enables large-scale training of detailed biophysical models of neural dynamics},
  author={Deistler, Michael and Kadhim, Kyra L and Pals, Matthijs and Beck, Jonas and Huang, Ziwei and Gloeckler, Manuel and Lappalainen, Janne K and Schr{\"o}der, Cornelius and Berens, Philipp and Gon{\c{c}}alves, Pedro J and others},
  journal={Nature Methods},
  pages={1--9},
  year={2025},
  publisher={Nature Publishing Group US New York}
}

Metadata

Release files for Jaxley 0.14.1

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

Source distribution (sdist)

Source distribution for Jaxley 0.14.1
File Size Uploaded Provenance Actions
jaxley-0.14.1.tar.gz 206.5 kB Without provenance Details for jaxley-0.14.1.tar.gz

Built distribution (wheel)

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

Total release size: 461.3 kB

Release files / jaxley-0.14.1.tar.gz

Download URL jaxley-0.14.1.tar.gz
Size 206.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5114ae1c6a6dbbfc623719b175a23a962195f1ba673c22df352b2bdfe10d3f8c
BLAKE2b-256 checksum
How to use checksums
90dd5f0d8615eb17980f67e266b5e6cfaa89bb84f0a0b83951c7b995d8157655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / jaxley-0.14.1-py3-none-any.whl

Download URL jaxley-0.14.1-py3-none-any.whl
Size 254.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03e013716467e9888346bb2314dcaeab2c97839e5bb5509a1d0bd1b119926d12
BLAKE2b-256 checksum
How to use checksums
69887324014ca26a28e4531642324324fbfefb33980e842bc56b95ba2379f79d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for Jaxley 0.14.1

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