Tesseract Core
Universal components for differentiable scientific computing 📦
Read the docs | API reference | Demos & tutorials | Blog | User Forum | Report an issue | Contribute
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, anapplyfunction, 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
|
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. |
A PyTorch network learns to calibrate NOAA's operational Fortran models, Snow-17 and SAC-SMA, with gradients flowing through the untouched Fortran. |
Ansys SpaceClaim geometry and PyMAPDL structural analysis in one optimization loop, giving a design 24% stiffer than the baseline at the same mass. |
|
Sentaurus TCAD, a closed-source binary driven over SSH, differentiated with finite differences and Broyden updates to tune a transistor for a spiking network. |
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. |
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, andvmap. - Tesseract-Torch: embed Tesseracts as PyTorch operators with
torch.autogradsupport.
Also see Tesseract-Streamlit to generate web apps from Tesseracts, and cookiecutter-tesseract for a multi-Tesseract project template.
Learn more
- Get started
- Overview: how Tesseracts work and the ways to run them
- Checking gradients
- Differentiable programming guide
- Demos & tutorials
- Deploying Tesseracts
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tesseract_core-1.16.1.tar.gz | 1.5 MB | With provenance | Details for tesseract_core-1.16.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tesseract_core-1.16.1-py3-none-any.whl | Python 3 | none | any | Details for tesseract_core-1.16.1-py3-none-any.whl |
Total release size: 1.8 MB
Release files / tesseract_core-1.16.1.tar.gz
| Download URL | tesseract_core-1.16.1.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
195ef616e1de5545f4e24b561dad62cf660049579cd9553ddefa05b221cf24b1
|
|
BLAKE2b-256 checksum How to use checksums |
e3ebb1914f8558dbfa4001705b7d0f469ebcb84be1b7ecdb7c8c02845544e0c6
|
| 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 22, 2026.
Transparency logRelease files / tesseract_core-1.16.1-py3-none-any.whl
| Download URL | tesseract_core-1.16.1-py3-none-any.whl |
|---|---|
| Size | 285.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9a571470ee64267f16b1a4b1ed9bf5d9f2b5681e2bcd95504c747dc73024398
|
|
BLAKE2b-256 checksum How to use checksums |
f33ee9450e64be60543281b6dc2dd842808d96fcfa94a1ac83a42cec18febf95
|
| 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 22, 2026.
Transparency logSecurity for tesseract-core 1.16.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tesseract_core-1.16.1.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 22, 2026.
Transparency logA 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.