CLI Reference (tesseract)

tesseract

tesseract Usage: tesseract [OPTIONS] COMMAND [ARGS]... Tesseract: A toolkit for universal, autodiff-native software components. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --loglevelLEVELSet the logging level. At debug level, also print tracebacks  for user errors.                                              [default: info]                                               --versionPrint Tesseract CLI version and exit. --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 ───────────────────────────────────────────────────────────────────────────────────────╮ build   Build a new Tesseract from a context directory.                                        init    Initialize a new Tesseract API module.                                                 serve   Serve one or more Tesseract images.                                                    list    Display all Tesseract images.                                                          ps      Display all Tesseract containers.                                                      apidoc  Serve the OpenAPI schema for a Tesseract.                                              teardownTear down one or more Tesseracts that were previously started with `tesseract serve`.  run     Execute a command in a Tesseract.                                                      ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

build

build Usage: tesseract build [OPTIONS] {src_dir} Build a new Tesseract from a context directory. The passed directory must contain the files `tesseract_api.py` and `tesseract_config.yaml` (can be created via `tesseract init`). Prints the built images as JSON array to stdout, for example: `["mytesseract:latest"]`. If `--generate-only` is set, the path to the build context is printed instead. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *src_dir<directory>Source directory for the Tesseract. Must contain                  `tesseract_api.py` and `tesseract_config.yaml`.                   [required]                                                        ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --tag-t<str>Tag for the resulting          Tesseract. By default, this    will be inferred from the      version specified in           tesseract_config.yaml, and the Tesseract will also be tagged  as `latest`.                   --build-dir<directory>Directory to use for the       build. Defaults to a temporary directory.                     --forward-ssh-agent--no-forward-ssh-agentForward the SSH agent to the   Docker build environment. Has  to be provided if              requirements.txt contains      private dependencies.          [default:                      no-forward-ssh-agent]          --config-overrideKEYPATH=VALUEOverride a configuration       option in the Tesseract.       Format: ``keypath=value``      where ``keypath`` is a         dot-separated path to the      attribute in                   tesseract_config.yaml.         Possible keypaths are: name,   version, description,          build_config, env, metadata.   Possible build_config options  are: base_image,               target_platform,               extra_packages, package_data,  custom_build_steps,            python_version,                inherit_base_image_packages,   requirements, skip_checks.     Example: ``--config-override build_config.target_platform=… --generate-only--no-generate-onlyOnly generate the build        context and do not actually    build the image.               [default: no-generate-only]    --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

init

init Usage: tesseract init [OPTIONS] Initialize a new Tesseract API module. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --name<str>Tesseract name as specified in tesseract_config.yaml.    Will be empty if not provided.                           --target-dir<directory>Path to the directory where the Tesseract API module     should be created.                                       [default: (current directory)]                           --recipe<base|jax|pytorch>Use a pre-configured template to initialize Tesseract    API and configuration.                                   [default: base]                                          --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

serve

serve Usage: tesseract serve [OPTIONS] {image_name} Serve one or more Tesseract images. A successful serve command will display on standard output a JSON object with the Tesseract container name, which is required to run the teardown command and its respective port. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *image_name<str>Tesseract image name[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --volume-vsource:target                 Bind mount a volume in all          Tesseracts, in Docker format:       source:target[:ro|rw]               --env-e<str>Set environment variables in the    Tesseract containers, in Docker     format: key=value.                  --port-p<str>Optional port/port range to serve   the Tesseract on (e.g. -p '8080-8082'). Port must be between  1025 and 65535.                     --network<str>Network to use for the Tesseract    container, analogous to Docker's    --network option. For example,      'host' uses the host system's       network. Alternatively, you can     create a custom network with        `docker network create              <network-name>` and use it here.    --network-alias<str>Network alias to use for the        Tesseract container. This makes the Tesseract accessible via this alias within the specified network. Must  be used with --network.             --host-ip<str>IP address of the host to bind the  Tesseract to. Defaults to 127.0.0.1 (localhost). To bind to all         interfaces, use '0.0.0.0'. WARNING: This may expose Tesseract to all    local networks, use with caution.   [default: 127.0.0.1]                --gpus'all' | int                   IDs of host Nvidia GPUs to make     available in the Tesseract. You can use all GPUs via `--gpus all` or    pass (multiple) IDs: `--gpus 0      --gpus 1`.                          --num-workers<int>Number of worker processes to use   when serving the Tesseract.         [default: 1]                        --debugEnable debug mode. This will        propagate full tracebacks to the    client and start a debugpy server   in the Tesseract. WARNING: This may expose sensitive information, use   with caution (and never in          production).                        --skip-health-checkSkip the startup health check.      Useful for Tesseracts with slow     initialization (e.g., Julia runtime startup, large model loading). The  caller is responsible for ensuring  readiness, e.g. by polling /health. --user<str>User to run the Tesseracts as e.g.  '1000' or '1000:1000' (uid:gid).    Defaults to the current user.       --memory-m<str>Memory limit for the container      (e.g., '512m', '2g'). Minimum       allowed value is 6m (6 megabytes).  --input-path-i<str>Input path to read input files      from, such as local directory or S3 URI (may be anything supported by   fsspec).                            --output-path-o<str>Output path to write output files   to, such as local directory or S3   URI (may be anything supported by   fsspec).                            --output-format-f<json|json+base64|json+binref>Output format to use for the        Tesseract.                          --runtime-argsARGS                          Additional arguments to pass to the underlying container runtime (e.g., Docker). Example: --runtime-args '--shm-size=1g --cpus=2'            --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

list

list Usage: tesseract list [OPTIONS] Display all Tesseract images. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

ps

ps Usage: tesseract ps [OPTIONS] Display all Tesseract containers. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

apidoc

apidoc Usage: tesseract apidoc [OPTIONS] {image_name} Serve the OpenAPI schema for a Tesseract. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ *image_name<str>Tesseract image name[required] ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --browser--no-browserOpen the browser after serving the OpenAPI schema [default: browser]                                --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

teardown

teardown Usage: tesseract teardown [OPTIONS] [container_names]... Tear down one or more Tesseracts that were previously started with `tesseract serve`. One or more Tesseract container names must be specified unless `--all` is set. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ container_names<str>Tesseract container names ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --allTear down all Tesseracts currently being served. --helpShow this message and exit. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

run

run Usage: tesseract run [OPTIONS] [TESSERACT_IMAGE] [CMD] [payload] Execute a command in a Tesseract. This command starts a Tesseract instance and executes the given command. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ TESSERACT_IMAGE<str>Tesseract image name CMD            <abstract-eval|apply|check|check-grTesseract command to run, must be    adients|health|input-schema|jacobiaone of ['abstract-eval', 'apply',    n|jacobian-vector-product|openapi-s'check', 'check-gradients',          chema|output-schema|serve|test|vect'health', 'input-schema',            or-jacobian-product>'jacobian',                          'jacobian-vector-product',           'openapi-schema', 'output-schema',   'serve', 'test',                     'vector-jacobian-product']           payload        <str>Optional payload to pass to the      Tesseract command. This can be a     JSON string or an @ prefixed path to a JSON file.                         ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ --input-path-i<str>Input path to read input files from,    such as local directory or S3 URI (may  be anything supported by fsspec).       --output-path-o<str>Output path to write output files to,   such as local directory or S3 URI (may  be anything supported by fsspec).       --output-format-f<json|json+base64|json+binref>Output format to use for the Tesseract. --output-file<str>Output filename to write the result to  (relative to output path). If not set,  results will be written to stdout.      --volume-vsource:target                 Bind mount a volume, in Docker format:  source:target.                          --gpus'all' | int                   IDs of host GPUs to make available in   the tesseract. You can use all GPUs via `--gpus all` or pass (multiple) IDs:    `--gpus 0 --gpus 1`.                    --env-ekey=value                     Set environment variables in the        Tesseract container, in Docker format:  key=value.                              --network<str>Network to use for the Tesseract        container, analogous to Docker's        --network option. For example, 'host'   uses the host system's network.         Alternatively, you can create a custom  network with `docker network create     <network-name>` and use it here.        --user<str>User to run the Tesseract as e.g.       '1000' or '1000:1000' (uid:gid).        Defaults to the current user.           --memory-m<str>Memory limit for the container (e.g.,   '512m', '2g'). Minimum allowed value is 6m (6 megabytes).                       --docker-argsARGS                          Additional arguments to pass to the     underlying container runtime (e.g.,     Docker). Example: --docker-args '--shm-size=1g --cpus=2'                --runtime-argsARGS                          Additional arguments to pass to the     `tesseract-runtime` command inside the  container. Example: --runtime-args '--seed=42 --eps=1e-5' to pass optional arguments to `tesseract-runtime         check-gradients`.                       --profilingEnable profiling to measure execution   time of functions.                      --tracingEnable tracing for detailed debug       output.                                 --debugEnable debug mode. This starts a        debugpy server in the Tesseract and     blocks until a debugger attaches to the forwarded port. WARNING: This may       expose sensitive information, use with  caution (and never in production).      --help-hShow help for the Tesseract command. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ For more information about a specific Tesseract, try `tesseract run <tesseract-name><cmd> --help`. For example, `tesseract run helloworld apply --help`.