tesseract-runtime command line application

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

tesseract-runtime

Invoke the Tesseract runtime.

The Tesseract runtime can be configured via environment variables; for example, export TESSERACT_RUNTIME_PORT=8080 sets the port to use for tesseract serve to 8080.

tesseract-runtime [OPTIONS] COMMAND [ARGS]...

Options

--install-completion

Install completion for the current shell.

--show-completion

Show completion for the current shell, to copy it or customize the installation.

abstract-eval

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. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
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
tesseract-runtime abstract-eval [OPTIONS] JSON_PAYLOAD

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

Arguments

JSON_PAYLOAD

Required argument

apply

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. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
Returns:
The output data from applying the Tesseract.
result: Vector s·a + b
tesseract-runtime apply [OPTIONS] JSON_PAYLOAD

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

Arguments

JSON_PAYLOAD

Required argument

check

Check whether the Tesseract API can be imported.

tesseract-runtime check [OPTIONS]

health

Get health status of the Tesseract instance.

tesseract-runtime health [OPTIONS]

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

input-schema

Get input schema for tesseract apply function.

tesseract-runtime input-schema [OPTIONS]

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

jacobian

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. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
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).
tesseract-runtime jacobian [OPTIONS] JSON_PAYLOAD

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

Arguments

JSON_PAYLOAD

Required argument

jacobian-vector-product

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. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
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.
tesseract-runtime jacobian-vector-product [OPTIONS] JSON_PAYLOAD

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

Arguments

JSON_PAYLOAD

Required argument

openapi-schema

Get the openapi.json schema.

tesseract-runtime openapi-schema [OPTIONS]

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

output-schema

Get output schema for tesseract apply function.

tesseract-runtime output-schema [OPTIONS]

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

serve

Start running this Tesseract’s web server.

tesseract-runtime serve [OPTIONS]

Options

-p, --port <port>

Port number

-h, --host <host>

Host IP address

-w, --num-workers <num_workers>

Number of worker processes

vector-jacobian-product

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. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
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.
tesseract-runtime vector-jacobian-product [OPTIONS] JSON_PAYLOAD

Options

-o, --output-path <output_path>

Output path to write the result to, such as local directory or S3 URI (may be anything supported by fsspec). [default: write to stdout]

-f, --output-format <output_format>

Output format to write results in.

Options:

json | msgpack | json+base64 | json+binref

Arguments

JSON_PAYLOAD

Required argument