skillfed

diffrax

GPU+autodiff-capable ODE/SDE/CDE solvers written in JAX.

diffrax v0.7.2 357.1K downloads/30d#7,275 on PyPI2,084
Permissive license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) Active released

What it is and what it does

Diffrax is a JAX-native library for solving differential equations—ODEs, SDEs, and CDEs—with full automatic differentiation and GPU support. It unifies the treatment of different equation types under a single internal architecture, making it compact and composable. The library is designed for researchers and practitioners working with neural differential equations, dynamical systems, and scientific computing where gradient-based optimization through the solver is needed.

The package integrates tightly with the JAX ecosystem (equinox, jaxtyping, lineax, optimistix) and supports advanced features like vmappable solvers, PyTree state representations, dense solutions, and multiple adjoint methods for backpropagation. It includes a range of solvers from standard choices like Dopri5 to specialized symplectic and implicit methods, all callable from a unified interface.

Use it for:

  • Training neural differential equations where gradients flow through the solver during backpropagation.
  • Solving systems of ODEs/SDEs on GPU for large-scale scientific simulations with automatic differentiation.
  • Implementing controlled differential equations for sequence modeling and time-series tasks.
  • Research prototyping of dynamical systems where vmappable solvers enable batched integration over parameter ranges.
  • Combining differential equation solving with JAX's functional programming model in end-to-end differentiable pipelines.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Diffrax provides numerical solvers for ordinary, stochastic, and controlled differential equations in JAX, with automatic differentiation and GPU acceleration built in.

Yes, if you work with differential equations in JAX or need autodiff through a solver. Low install friction, active maintenance, permissive license, and no known vulnerabilities. The Alpha status and tight coupling to the JAX ecosystem mean it's best suited for research and projects where you can tolerate API changes; for production systems requiring long-term stability, verify that the specific solver and adjoint method you need are stable.

Install

diffrax on PyPI

pip

pip install diffrax

uv

uv add diffrax

poetry

poetry add diffrax

Installing diffrax

Before you install

Low friction install with a pure-Python wheel. Requires Python 3.11+ and depends on established JAX ecosystem packages (equinox, jax, jaxtyping, lineax, optimistix). Repository is active with recent commits and 2084 stars.

License in practice

Apache 2.0 permissive license allows commercial and derivative use with minimal restrictions—you must include a copy of the license and note any modifications, but there are no copyleft obligations.

Quickstart

pip install diffrax

from diffrax import diffeqsolve, ODETerm, Dopri5
import jax.numpy as jnp

def f(t, y, args):
    return -y

term = ODETerm(f)
solver = Dopri5()
y0 = jnp.array([2., 3.])
solution = diffeqsolve(term, solver, t0=0, t1=1, dt0=0.1, y0=y0)

Requires Python 3.11+; JAX must be installed and functional (may require GPU/TPU drivers for hardware acceleration).

Verify before relying

  • Whether all solver types (Tsit5, Dopri8, symplectic, implicit) are production-ready or still experimental given Alpha status.
  • Performance characteristics and numerical accuracy compared to other differential equation libraries.
  • Specific GPU/TPU compatibility and performance gains in practice.

Package facts

License Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 7 — equinox, jax, jaxtyping, lineax, optimistix, typing-extensions, wadler-lindig
Maintenance actively maintained — 177 days since the last release
Last repo commit
First released
Downloads 357,141/month — #7,275 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: diffrax-0.7.2-py3-none-any.whl

Keywords: deep-learning, differential-equations, diffrax, dynamical-systems, equinox, jax, neural-differential-equations

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: Mathematics

Tags

differential equation solver jaxode sde cde solversneural differential equationsautodiff gpu differential equationsjax numerical integrationdynamical systems solverstochastic differential equations jax
jax-ecosystemneural-odesautodiff

More Artificial Intelligence packages