CLI Reference (tesseract-runtime)

This is the command line interface of the Tesseract runtime that is bundled with each Tesseract container.

tesseract-runtime

tesseract-runtime Usage: tesseract-runtime [OPTIONS] COMMAND [ARGS]... Invoke the Tesseract runtime. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --name<str>Overwrite the `name` config       option.                           --description<str>Overwrite the `description`       config option.                    --version<str>Overwrite the `version` config    option.                           --debugOverwrite the `debug` config      option.                           --input-path<str>Overwrite the `input_path` config option.                           --output-path<str>Overwrite the `output_path`       config option.                    --output-format<json|json+base64|json+binref>Overwrite the `output_format`     config option.                    --output-file<str>Overwrite the `output_file`       config option.                    --compression<lz4>Overwrite the `compression`       config option.                    --mlflow-tracking-uri<str>Overwrite the                     `mlflow_tracking_uri` config      option.                           --mlflow-run-extra-args<str>Overwrite the                     `mlflow_run_extra_args` config    option.                           --profilingOverwrite the `profiling` config  option.                           --tracingOverwrite the `tracing` config    option.                           --install-completionInstall completion for the        current shell.                    --show-completionShow completion for the current   shell, to copy it or customize    the installation.                 --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮ check                  Check whether the Tesseract API is valid.                               check-gradients        Check gradients of endpoints against a finite difference approximation. serve                  Start running this Tesseract's web server.                              apply                  Call the Tesseract function apply.                                      jacobian               Call the Tesseract function jacobian.                                   jacobian-vector-productCall the Tesseract function jacobian-vector-product.                    vector-jacobian-productCall the Tesseract function vector-jacobian-product.                    health                 Call the Tesseract function health.                                     abstract-eval          Call the Tesseract function abstract-eval.                              test                   Call the Tesseract function test.                                       openapi-schema         Call the Tesseract function openapi-schema.                             ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

check

check Usage: tesseract-runtime check [OPTIONS] Check whether the Tesseract API is valid. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

check-gradients

check-gradients Usage: tesseract-runtime check-gradients [OPTIONS] {JSON_PAYLOAD} Check gradients of endpoints against a finite difference approximation. This is an automated way to check the correctness of the gradients of the different gradient  endpoints (jacobian, jacobian_vector_product, vector_jacobian_product) of a ``tesseract_api.py`` module. It will sample random indices and compare the gradients computed by the gradient endpoints with  the finite difference approximation. Warning:     Finite differences are not exact and the comparison is done with a tolerance. This means     that the check may fail even if the gradients are correct, and vice versa. Finite difference approximations are sensitive to numerical precision. When finite differences are reported incorrectly as 0.0, it is likely that the chosen `eps` is too small, especially for inputs that do not use float64 precision. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *JSON_PAYLOAD<str>JSON payload to pass to the Tesseract API. If prefixed with '@',   it is treated as a file path.                                      [required]                                                         ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --input-paths<str>Paths to differentiable inputs to check gradients for. [default: (check all)]                                 --output-paths<str>Paths to differentiable outputs to check gradients for. [default: (check all)]                                  --endpoints<str>Endpoints to check gradients for.[default: (check all)] --eps<float>Step size for finite differences.[default: 0.0001] --rtol<float>Relative tolerance when comparing finite differences to          gradients.                                                       [default: 0.1]                                                   --max-evals<int>Maximum number of evaluations per input.[default: 1000] --max-failures<int>Maximum number of failures to report per endpoint.[default: 10] --seed<int>Seed for random number generator. If not set, a random seed is   used.                                                            --show-progressShow progress bar.[default: True] --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

serve

serve Usage: tesseract-runtime serve [OPTIONS] Start running this Tesseract's web server. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --host<str>Host IP address[default: 127.0.0.1] --port<int>Port number[default: 8000] --num-workers<int>Number of worker processes[default: 1] --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

apply

apply Usage: tesseract-runtime apply [OPTIONS] {payload} Apply the Tesseract to the input data. Multiplies a vector `a` by `s`, and sums the result to `b`. First argument is the payload, which should be a JSON object with the following structure. Input schema:     inputs: The input data to apply the Tesseract to.         a: An arbitrary vector normalized according to [...]         b: An arbitrary vector. Needs to have the same dimensions as a.         s: A scalar.          normalize: True if the output should be normalized, False otherwise.  Returns:     The output data from applying the Tesseract.         result: Vector s·a + b ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

jacobian

jacobian Usage: tesseract-runtime jacobian [OPTIONS] {payload} Computes the Jacobian of the Tesseract. Differentiates ``jac_outputs`` with respect to ``jac_inputs``, at the point ``inputs``. First argument is the payload, which should be a JSON object with the following structure. Input schema:     inputs: The input data to compute the Jacobian at.         a: An arbitrary vector normalized according to [...]         b: An arbitrary vector. Needs to have the same dimensions as a.         s: A scalar.          normalize: True if the output should be normalized, False otherwise.      jac_inputs: The set of differentiable inputs to compute the Jacobian with respect to.     jac_outputs: The set of differentiable outputs to compute the Jacobian of. Returns:     Container for the results of Jacobian computations. The result represents a nested structure  of the Jacobian matrix as a mapping with structure ``{jac_outputs: {jac_inputs: array}}``. The  shape of each array is the concatenation of the shapes of the output and input arrays, i.e.  ``(*output_array.shape, *input_array.shape)``. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

jacobian-vector-product

jacobian-vector-product Usage: tesseract-runtime jacobian-vector-product [OPTIONS] {payload} Compute the Jacobian vector product of the Tesseract at the input data. Evaluates the Jacobian vector product between the Jacobian given by ``jvp_outputs`` with respect to ``jvp_inputs`` at the point ``inputs`` and the given tangent vector. First argument is the payload, which should be a JSON object with the following structure. Input schema:     inputs: The input data to compute the JVP at.         a: An arbitrary vector normalized according to [...]         b: An arbitrary vector. Needs to have the same dimensions as a.         s: A scalar.          normalize: True if the output should be normalized, False otherwise.      jvp_inputs: The set of differentiable inputs to compute the JVP with respect to.     jvp_outputs: The set of differentiable outputs to compute the JVP of.     tangent_vector: Tangent vector to multiply the Jacobian with. Expected to be a mapping with  structure ``{jvp_inputs: array}``. The shape of each array is the same as the shape of the  corresponding input array. Returns:     Container for the results of Jacobian-vector products. The result is a mapping with structure  ``{jvp_outputs: array}``. The shape of each array is the same as the shape of the corresponding  output array. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

vector-jacobian-product

vector-jacobian-product Usage: tesseract-runtime vector-jacobian-product [OPTIONS] {payload} Compute the Jacobian vector product of the Tesseract at the input data. Computes the vector Jacobian product between the Jacobian given by ``vjp_outputs`` with respect to ``vjp_inputs`` at the point ``inputs`` and the given cotangent vector. First argument is the payload, which should be a JSON object with the following structure. Input schema:     inputs: The input data to compute the VJP at.         a: An arbitrary vector normalized according to [...]         b: An arbitrary vector. Needs to have the same dimensions as a.         s: A scalar.          normalize: True if the output should be normalized, False otherwise.      vjp_inputs: The set of differentiable inputs to compute the VJP with respect to.     vjp_outputs: The set of differentiable outputs to compute the VJP of.     cotangent_vector: Cotangent vector to multiply the Jacobian with. Expected to be a mapping  with structure ``{vjp_outputs: array}``. The shape of each array is the same as the shape of the  corresponding output array. Returns:     Container for the results of vector-Jacobian products. The result is a mapping with structure  ``{vjp_inputs: array}``. The shape of each array is the same as the shape of the corresponding  input array. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

health

health Usage: tesseract-runtime health [OPTIONS] Get health status of the Tesseract instance. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

abstract-eval

abstract-eval Usage: tesseract-runtime abstract-eval [OPTIONS] {payload} Perform abstract evaluation of the Tesseract on the input data. Calculate output shape of apply from the shape of its inputs. First argument is the payload, which should be a JSON object with the following structure. Input schema:     inputs: The abstract input data to evaluate the Tesseract on. Has the same structure as  InputSchema, but with array fields replaced by ShapeDType.         a: An arbitrary vector normalized according to [...]             shape: None             dtype: None         b: An arbitrary vector. Needs to have the same dimensions as a.             shape: None             dtype: None         s: A scalar.          normalize: True if the output should be normalized, False otherwise.  Returns:     Abstract outputs with the same structure as OutputSchema, but with array fields replaced by  ShapeDType.         result: Vector s·a + b             shape: None             dtype: None ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

test

test Usage: tesseract-runtime test [OPTIONS] {payload} Run a single regression test against a Tesseract endpoint. Tests an endpoint by calling it with specified inputs and comparing outputs against expected values or verifying expected exceptions are raised. Args:     payload: Test specification containing:         - endpoint: Name of endpoint to test (e.g., "apply", "jacobian")         - payload: Input data for the endpoint         - expected_outputs: Expected output data (mutually exclusive with expected_exception)         - expected_exception: Expected exception type or name (mutually exclusive with  expected_outputs)         - expected_exception_regex: Optional regex pattern for exception message         - atol: Absolute tolerance for numeric comparisons (default: 1e-8)         - rtol: Relative tolerance for numeric comparisons (default: 1e-5) Returns:     TestOutputSchema with:         - status: "passed" | "failed" | "error"         - message: Empty for passed tests, error details for failed/error         - endpoint: Name of the tested endpoint Note:     This endpoint is designed for testing and CI/CD workflows.     All outcomes return HTTP 200 with status in the response body regardless of success/failure. First argument is the payload, which should be a JSON object with the following structure. Input schema:     endpoint: None     payload: None     expected_outputs: None     expected_exception: None     expected_exception_regex: None     atol: None      rtol: None      skip_output_path_checks: None      cli_config: None Returns:     status: None     message: None     endpoint: None ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *payload<str>[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

openapi-schema

openapi-schema Usage: tesseract-runtime openapi-schema [OPTIONS] Get the openapi.json schema. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯