Skip to main content
cuthbert logo

A JAX library for state-space model inference (filtering, smoothing, static parameter estimation).

Disclaimer: The name cuthbert was chosen as a playful nod to the well-known caterpillar cake rivalry between Aldi and M&S in the UK, as the classic state-space model diagram looks vaguely like a caterpillar. However, this software project has no formal connection to Aldi, M&S, or any food products (notwithstanding the coffee drunk during its writeup). cuthbert is simply a fun name for this state-space model library and should not be interpreted as an endorsement, association, or affiliation with any brand or animal themed baked goods.

Discord GitHub PyPI Docs

If you want to jump right in, check out our examples. Maybe a simple Kalman filter for tracking or a factorial state-space model for modelling international football.

Goals

  • Simple, flexible and performant interface for state-space model inference.
  • Decoupling of model specification and inference. cuthbert is built to swap between different inference methods without be tied to a specific model specification.
  • Compose with the JAX ecosystem for extensive external tools.
  • Functional API: The only classes in cuthbert are NamedTuples and Protocols. All functions are pure and work seamlessly with jax.grad, jax.jit, jax.vmap etc.
  • Methods for filtering: $p(x_t \mid y_{1:t}, \theta)$.
  • Methods for smoothing: $p(x_{0:T} \mid y_{1:T}, \theta)$ or $p(x_{t} \mid y_{1:T}, \theta)$.
  • Methods for static parameter estimation: $p(\theta \mid y_{1:T})$ or $\text{argmax} p(y_{1:T} \mid \theta)$.
  • This includes support for forward-backward/Baum-Welch, particle filtering/sequential Monte Carlo, Kalman filtering (+ extended/unscented/ensemble), expectation-maximization and more!

Non-goals

Codebase structure

The codebase is structured as follows:

  • cuthbert: The main package with unified interface for filtering and smoothing.
  • cuthbertlib: A collection of atomic, smaller-scoped tools useful for state-space model inference, that represent the building blocks that power the main cuthbert package.
  • docs: Source code for the documentation for cuthbert and cuthbertlib.
  • pkg: Packaging configuration for publishing cuthbert and cuthbertlib to PyPI.
  • tests: Tests for the cuthbert and cuthbertlib packages.

Installation

cuthbert depends on JAX, so you'll need to install JAX for the available hardware (CPU, GPU, or TPU). For example, on computers with NVIDIA GPUs:

pip install -U "jax[cuda13]"

From PyPI

pip install -U cuthbert

Installing cuthbert will also install cuthbertlib. You can also install cuthbertlib on its own:

pip install -U cuthbertlib

Local development (uv)

git clone https://github.com/state-space-models/cuthbert.git
cd cuthbert
uv sync --package cuthbert --extra tests

Local development (pip)

git clone https://github.com/state-space-models/cuthbert.git
cd cuthbert
pip install -e ./pkg/cuthbertlib
pip install -e "./pkg/cuthbert[tests]"

Ecosystem

  • cuthbert is built on top of jax and composes easily with other JAX packages, e.g. optax for optimization, flax for neural networks, and blackjax for (SG)MCMC as well as the PPLs mentioned above.
  • What about dynamax?
    • dynamax is a great library for state-space model specification and inference with discrete or Gaussian state-space models. cuthbert is focused on inference with arbitrary state-space models via e.g. SMC that is not supported in dynamax. However as they are both built on jax they can be used together! A dynamax model can be passed to cuthbert for inference.
  • And particles?
  • Much of the code in cuthbert is built on work from sqrt-parallel-smoothers, mocat and abile.

Contributing

We're always looking for contributions! Check out the contributing guide for more information.

Metadata

Release files for cuthbert 0.1.2

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

Source distribution (sdist)

Source distribution for cuthbert 0.1.2
File Size Uploaded Provenance Actions
cuthbert-0.1.2.tar.gz 43.6 kB With provenance Details for cuthbert-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 112.1 kB

Release files / cuthbert-0.1.2.tar.gz

Download URL cuthbert-0.1.2.tar.gz
Size 43.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eb9b2525b393b6845d49fd8315ddd196357217d1be326e5f880f1ac8dc36a1d3
BLAKE2b-256 checksum
How to use checksums
d949a4176652644f4dbd9419742ef61b8b6d330390ccf1e747201ee262351f1d
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 28, 2026.

Transparency log

Release files / cuthbert-0.1.2-py3-none-any.whl

Download URL cuthbert-0.1.2-py3-none-any.whl
Size 68.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e9885e7ea7c57eb5d7530aa08f5754e08bb61d7820e0cb45a5bc24ad207cd98
BLAKE2b-256 checksum
How to use checksums
cec79539b71b484f36d09cd29fbe4cf703f29734f00efadc0c1c8d49230c5f82
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 28, 2026.

Transparency log

Security for cuthbert 0.1.2

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 cuthbert-0.1.2.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 28, 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