Skip to main content

Tesseract Core

Universal components for differentiable scientific computing 📦

Read the docs | API reference | Demos & tutorials | Blog | User Forum | Report an issue | Contribute


DOI SciPy

Optimize, calibrate, and train through solvers in any language or framework. Tesseract wraps any software behind a typed interface with derivative endpoints, runs it in its own process, and hands it to jax.grad or torch.autograd as a single differentiable operation.

How it works

  • Define a component in tesseract_api.py: Pydantic schemas for its inputs and outputs, an apply function, and optional derivative endpoints, computed however you like (autodiff, adjoints, finite differences).
  • Run it in its own process and environment, build it as a container image, or serve it remotely. Each way exposes the same endpoints.
  • Differentiate through it with Tesseract-JAX and Tesseract-Torch, so one gradient can cross languages and frameworks. Overhead is typically a few milliseconds per call (see the performance guide).
  • Check every derivative endpoint against finite differences with check-gradients.

Built with Tesseract

Optimized dopant layout around a silicon waveguide core PRISMO
A Julia semiconductor solver and a FEniCS optics solver in one JAX gradient, reaching more than five times the optical phase shift of the starting design.
Simulated and observed streamflow in a held-out basin δSnowSac
A PyTorch network learns to calibrate NOAA's operational Fortran models, Snow-17 and SAC-SMA, with gradients flowing through the untouched Fortran.
Optimized rocket grid fin geometry Rocket grid fins
Ansys SpaceClaim geometry and PyMAPDL structural analysis in one optimization loop, giving a design 24% stiffer than the baseline at the same mass.
Transistor transfer curves and fabrication parameters during optimization Differentiable Silicon
Sentaurus TCAD, a closed-source binary driven over SSH, differentiated with finite differences and Broyden updates to tune a transistor for a spiking network.
Recovered brain source location inside a head model NeuroLocate
A PyTorch network proposes EEG sources, and JAX refines them with gradients through OpenMEEG, a C++ boundary element solver with no autodiff of its own.
Channel flow around a cylinder before and after gradient-based inflow optimization Mosaic
Solvers in C++, Julia, JAX, and PyTorch, from deal.II and OpenFOAM to JAX-FEM and XLB, behind one Tesseract interface, so a single harness can compare their gradients and cost on shared tasks.

Quick start

You need Python 3.10+ and uv, which Tesseract uses to build an isolated environment for each component.

$ pip install tesseract-core tesseract-jax
$ tesseract init --name my-tesseract

Replace the generated tesseract_api.py with this stand-in for a solver:

# tesseract_api.py
from pydantic import BaseModel
from tesseract_core.runtime import Array, Differentiable, Float32, ShapeDType


class InputSchema(BaseModel):
    x: Differentiable[Array[(None,), Float32]]


class OutputSchema(BaseModel):
    y: Differentiable[Array[(None,), Float32]]


def apply(inputs: InputSchema) -> OutputSchema:
    # Call your solver, mesh generator, or surrogate here
    return OutputSchema(y=inputs.x**2)


def vector_jacobian_product(inputs, vjp_inputs, vjp_outputs, cotangent_vector):
    # Hand-written, autodiff, adjoint solve, finite differences, ...
    return {"x": 2 * inputs.x * cotangent_vector["y"]}


def abstract_eval(abstract_inputs):
    # Output shapes from input shapes, so JAX can trace without running apply
    return {"y": ShapeDType(shape=abstract_inputs.x.shape, dtype="float32")}

Run it in its own process and differentiate through it with JAX:

import jax
import jax.numpy as jnp
from tesseract_core import Tesseract
from tesseract_jax import apply_tesseract

with Tesseract.from_source("tesseract_api.py") as solver:
    loss = lambda x: apply_tesseract(solver, {"x": x})["y"].sum()
    print(jax.grad(loss)(jnp.array([1.0, 2.0, 3.0])))  # [2. 4. 6.]

Tesseract-Torch does the same for torch.autograd. Before an optimizer relies on the hand-written VJP, check it against finite differences:

$ pip install "tesseract-core[runtime]"
$ TESSERACT_API_PATH=tesseract_api.py tesseract-runtime check-gradients '{"inputs": {"x": [1.0, 2.0, 3.0]}}'
✅ Gradient check for vector_jacobian_product passed ✅ (0 failures / 1000 checks)

To share or deploy the component, build the same folder as a container image, which requires Docker. Tesseract.from_image("my-tesseract") then takes the place of from_source:

$ tesseract build .
$ tesseract run my-tesseract apply '{"inputs": {"x": [1.0, 2.0, 3.0]}}'

The Tesseract ecosystem

  • Tesseract Core: CLI, Python SDK, and runtime (this repo).
  • Tesseract-JAX: embed Tesseracts as JAX primitives, compatible with jit, grad, and vmap.
  • Tesseract-Torch: embed Tesseracts as PyTorch operators with torch.autograd support.

Also see Tesseract-Streamlit to generate web apps from Tesseracts, and cookiecutter-tesseract for a multi-Tesseract project template.

Learn more

Citing Tesseract

If you use Tesseract in your research, please cite:

@article{TesseractCore,
  doi = {10.21105/joss.08385},
  url = {https://doi.org/10.21105/joss.08385},
  year = {2025},
  publisher = {The Open Journal},
  volume = {10},
  number = {111},
  pages = {8385},
  author = {Häfner, Dion and Lavin, Alexander},
  title = {Tesseract Core: Universal, autodiff-native software components for Simulation Intelligence},
  journal = {Journal of Open Source Software}
}

License

Tesseract Core is licensed under the Apache License 2.0 and is free to use, modify, and distribute (under the terms of the license).

Tesseract is a registered trademark of Pasteur Labs, Inc. and may not be used without permission.

Metadata

Release files for tesseract-core 1.16.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 tesseract-core 1.16.0
File Size Uploaded Provenance Actions
tesseract_core-1.16.0.tar.gz 1.5 MB With provenance Details for tesseract_core-1.16.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tesseract-core 1.16.0
File Interpreter ABI Platform Actions
tesseract_core-1.16.0-py3-none-any.whl Python 3 none any Details for tesseract_core-1.16.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / tesseract_core-1.16.0.tar.gz

Download URL tesseract_core-1.16.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
10be77b7b6f2bb7eecdcc792e09d768bcaccbc2d1af3c9db1d80f80b0656c480
BLAKE2b-256 checksum
How to use checksums
ad59dc34a2f7a5deac0c144c669639ade2ebb94aa3ab2d1012a5106435bc4a4e
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 20, 2026.

Transparency log

Release files / tesseract_core-1.16.0-py3-none-any.whl

Download URL tesseract_core-1.16.0-py3-none-any.whl
Size 284.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79a8fb75326093668dbd4ea86c3bd7e9e17d610928efbefe255bf0cd9405aa9b
BLAKE2b-256 checksum
How to use checksums
16d03ca7bb4976a5911dd5f74f77e36abcbca6a95bd13ba84a4bafb3c129535f
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 20, 2026.

Transparency log

Security for tesseract-core 1.16.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tesseract_core-1.16.0.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 20, 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.

Release history Release notifications | RSS feed

This release

1.16.0 This release

2 release files Full provenance

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