Skip to main content

Tesseract-JAX

Tesseract-JAX is a lightweight extension to Tesseract Core that makes Tesseracts look and feel like regular JAX primitives, and makes them jittable, differentiable, and composable.

Read the docs | Explore the examples | Report an issue | Talk to the community | Contribute


The API of Tesseract-JAX consists of a single function, apply_tesseract(tesseract_client, inputs), which is fully traceable by JAX. This enables end-to-end autodifferentiation and JIT compilation of Tesseract-based pipelines:

@jax.jit
def vector_sum(x, y):
    res = apply_tesseract(vectoradd_tesseract, {"a": {"v": x}, "b": {"v": y}})
    return res["vector_add"]["result"].sum()

jax.grad(vector_sum)(x, y) # 🎉

Quick start

  1. Install Tesseract-JAX and get the example Tesseracts:

    $ pip install tesseract-jax
    $ git clone https://github.com/pasteurlabs/tesseract-jax
    
  2. Use a Tesseract as part of a JAX program via the JAX-native apply_tesseract function:

    import jax
    import jax.numpy as jnp
    from tesseract_core import Tesseract
    from tesseract_jax import apply_tesseract
    
    # Serve the Tesseract in its own process (its environment is built on first use)
    t = Tesseract.from_source("tesseract-jax/examples/simple/vectoradd_jax/tesseract_api.py")
    t.serve()
    
    # Run it with JAX
    x = jnp.ones((1000,))
    y = jnp.ones((1000,))
    
    def vector_sum(x, y):
        res = apply_tesseract(t, {"a": {"v": x}, "b": {"v": y}}, vmap_method="sequential")
        return res["vector_add"]["result"].sum()
    
    vector_sum(x, y) # success!
    
    # You can also use it with JAX transformations like JIT and grad
    vector_sum_jit = jax.jit(vector_sum)
    vector_sum_jit(x, y)
    
    vector_sum_grad = jax.grad(vector_sum)
    vector_sum_grad(x, y)
    
    # vmap requires an explicit vmap_method — "sequential" is safe but slow
    # while "auto_experimental" or "expand_dims" is more efficient for Tesseracts that support batching.
    # See https://docs.pasteurlabs.ai/projects/tesseract-jax/latest/content/vmap-methods.html
    vector_sum_vmap = jax.vmap(vector_sum)
    vector_sum_vmap(x.reshape(10, 100), y.reshape(10, 100))
    
  3. To share or deploy the Tesseract, build the same folder into a container image (this step requires Docker) and replace from_source with from_image:

    $ tesseract build tesseract-jax/examples/simple/vectoradd_jax
    
    t = Tesseract.from_image("vectoradd_jax")
    

    Use Tesseract.from_url(...) to reach a Tesseract that is already running elsewhere. apply_tesseract works the same way with all three.

Sharp edges

  • Additional required endpoints: Tesseract-JAX requires the abstract_eval Tesseract endpoint to be defined to enable JAX tracing and FFI dispatch. To run a Tesseract that has no abstract_eval endpoint, call it directly through the Tesseract client instead. Additionally, many gradient transformations like jax.grad require vector_jacobian_product to be defined.
  • Non-array outputs come from abstract_eval: an OutputSchema field that is not an array, such as a str or a bool, cannot enter a traced computation. As such, non-array outputs returned by apply are ignored and their value is instead taken from abstract_eval. apply_tesseract warns when the two differ; pass check_static_outputs=False or set TESSERACT_JAX_CHECK_STATIC_OUTPUTS=0 to skip the comparison. A field whose value depends on the input values belongs in the schema as an array.

License

Tesseract-JAX 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-jax 0.5.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-jax 0.5.0
File Size Uploaded
tesseract_jax-0.5.0.tar.gz 67.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tesseract-jax 0.5.0
File Interpreter ABI Platform
tesseract_jax-0.5.0-py3-none-any.whl Python 3 none any Details
tesseract_jax-0.5.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
tesseract_jax-0.5.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details

Total release size: 557.8 kB

Release files / tesseract_jax-0.5.0.tar.gz

Download URL tesseract_jax-0.5.0.tar.gz
Size 67.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2dff91ed23fa14045845fc97f66fa8ecaabeff701e5cc1c658d63e70a65c9b2e
BLAKE2b-256 checksum
How to use checksums
89b7a7627cad43016778a89f4f747cf98763de37ad1be7d3eb63c9261c14184f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release files / tesseract_jax-0.5.0-py3-none-any.whl

Download URL tesseract_jax-0.5.0-py3-none-any.whl
Size 64.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69a8ab493428a104d285985970c18835cc762ab169679661d571fb6bb690531e
BLAKE2b-256 checksum
How to use checksums
64c425a5654db39b18fce59f4f4e78dd8d46a7f0766bbd14892defb41f34812a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release files / tesseract_jax-0.5.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL tesseract_jax-0.5.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 220.8 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
a65720473d706bf7343a244591a2736d77e1bb469adea1c18a1a68e256c74013
BLAKE2b-256 checksum
How to use checksums
10edb16f99bf0e82a38a9907cddd529e4b2a2b76b7fa09b46e9d6b25c7e7d5ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release files / tesseract_jax-0.5.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL tesseract_jax-0.5.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 205.0 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
a09462a35381c984466140fcbb22f719f1aabf616baf3f06b2a0fd34fb555f61
BLAKE2b-256 checksum
How to use checksums
7a72b6ae2844304d5fd5aeec0cd807060f23b09f2c2fcab7239688e95f93d7b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

4 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

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