Skip to main content
Jig is a beta feature. The CLI surface, configuration schema, and supported hardware can change. Reach out to your Together AI contact or contact sales with feedback.
Jig is the CLI for building, pushing, and deploying dedicated containers. For an end-to-end walkthrough, see the Jig CLI guide. Jig is included with the Together AI Python library:

Environment variables

All commands are subcommands of tg beta jig. Use --config <path> to specify a custom config file (default: pyproject.toml).

Build

jig init

Create a starter pyproject.toml with sensible defaults.

jig dockerfile

Generate a Dockerfile from your pyproject.toml configuration. Useful for debugging the build.

jig build

Build the Docker image locally.

jig push

Push the built image to Together’s registry at registry.together.xyz.

Deployments

jig deploy

Build, push, and create or update the deployment. Combines build, push, and deployment creation into one step.

jig status

Show deployment status and configuration.

jig list

List all deployments in your organization.

jig logs

Retrieve deployment logs.

jig destroy

Delete the deployment.

jig endpoint

Print the deployment’s endpoint URL.

Queue

jig submit

Submit a job to the deployment’s queue.

jig job-status

Get the status of a submitted job.

jig queue-status

Show queue backlog and worker status.

Secrets

Secrets are encrypted environment variables injected at runtime. Manage them with the secrets subcommand.

jig secrets set

jig secrets list

List all secrets for the deployment.

jig secrets unset

Remove a secret from the local state without touching the deployment.

jig secrets delete

Delete a secret from the deployment and unset it locally.

Volumes

Volumes mount read-only data, such as model weights, into your container without baking them into the image.

jig volumes create

Create a volume and upload files.

jig volumes update

Update a volume with new files.
Updating a volume bumps its version by 1. To mount the new version, specify the version explicitly in your pyproject.toml:
If version is not specified, the initial version (version 0) of the volume is mounted. You can view current and historical volume versions using the jig volumes describe command.

jig volumes describe

Show volume details and contents.

jig volumes list

List all volumes.

jig volumes delete

Delete a volume.

Configuration reference

Jig reads configuration from your pyproject.toml file or a standalone jig.toml file. You can also specify a custom config file explicitly:
This is useful for managing multiple environments (e.g., staging_jig.toml, production_jig.toml). The configuration is split into three sections: build settings, deployment settings, and autoscaling.

The [tool.jig.image] section

The [tool.jig.image] section controls how your container image is built.

python_version

Sets the Python version for the container. Jig uses this to select the appropriate base image.
Default: "3.11"

system_packages

A list of APT packages to install in the container. Useful for libraries that require system dependencies like FFmpeg for video processing or OpenGL for graphics.
Default: []

environment

Environment variables are a part of the image (as ENV directives). These are available during the Docker build, the warmup step, and at runtime. Use this for build configuration like CUDA architecture targets.
For environment variables that should only be set at runtime use [tool.jig.deploy.environment_variables] instead. This is useful for values that can change without changing the image. Default: {}

run

Additional shell commands to run during the Docker build. Each command becomes a separate RUN instruction. Use this for custom installation steps that can’t be expressed as Python dependencies.
Default: []

cmd

The default command to run when the container starts. This becomes the Docker CMD instruction.
For queue-based workloads using Sprocket, include the --queue flag. Default: "python app.py"

copy

A list of files and directories to copy into the container. Paths are relative to your project root.
Default: []

auto_include_git

When enabled, automatically includes all git-tracked files in the container in addition to files specified in copy. Requires a clean git repository (no uncommitted changes).
This is convenient for projects where you want everything in version control to be deployed. You can combine it with copy to include additional untracked files. Default: false

The [tool.jig.deploy] section

The [tool.jig.deploy] section controls how your container runs on Together’s infrastructure.

description

A human-readable description of your deployment. This appears in the Together dashboard and API responses.
Default: ""

gpu_type

The type of GPU to allocate for each replica. Together supports NVIDIA H100, NVIDIA B200, or CPU-only deployments.
Available options:
  • "h100-80gb" - NVIDIA H100 with 80GB memory (recommended for large models)
  • "b200-192gb" - NVIDIA B200 with 192GB memory (next-generation hardware for the largest models)
  • "none" - CPU-only deployment
Default: "h100-80gb" Other hardware is available on request. Contact sales to discuss options.

gpu_count

The number of GPUs to allocate per replica. For multi-GPU inference with tensor parallelism, set this higher and use use_torchrun=True in your Sprocket. See Multi-GPU / Distributed Inference.
Default: 1

cpu

CPU cores to allocate per replica. Supports fractional values for smaller workloads.
Examples:
  • 0.1 = 100 millicores, 1 = 1 core, 8 = 8 cores
Default: 1.0

memory

Memory to allocate per replica, in gigabytes. Supports fractional values. Set this high enough for your model weights plus inference overhead.
Examples:
  • 0.5 = 512 MB, 8 = 8 GB, 64 = 64 GB
If you’re seeing OOM (out of memory) errors, increase this value. Default: 8.0

storage

Ephemeral storage to allocate per replica, in gigabytes. This is the disk space available to your container at runtime for temporary files, caches, and model artifacts.
Default: 100

min_replicas

The minimum number of replicas to keep running. Set to 0 to allow scaling to zero when idle (saves costs but adds cold start latency).
Default: 1

max_replicas

The maximum number of replicas the autoscaler can create. Set this based on your expected peak load and budget.
Default: 1

port

The port your container listens on. Sprocket uses port 8000 by default.
Default: 8000

health_check_path

The endpoint Together uses to check if your container is ready to accept traffic. The endpoint must return a 200 status when healthy.
Sprocket provides this endpoint automatically. Default: "/health"

termination_grace_period_seconds

How long to wait for a worker to finish its current job before forcefully terminating during shutdown or scale-down. Set this higher for long-running inference jobs.
Default: 300

command

Override the container’s startup command at deploy time. This takes precedence over the cmd setting in [tool.jig.image].
Default: null (uses the image’s CMD)

environment_variables

Runtime environment variables injected into your container. For sensitive values like API keys, use secrets instead.
Default: {}

The [tool.jig.deploy.autoscaling] section

The [tool.jig.deploy.autoscaling] section controls how your deployment scales based on demand. For all supported metrics and scaling behavior, see Autoscaling.

metric

The autoscaling strategy to use. Currently, QueueBacklogPerWorker is the recommended metric for queue-based workloads.
QueueBacklogPerWorker scales based on queue depth relative to worker count. When the queue grows, more replicas are added. When workers are idle, replicas are removed (down to min_replicas).

target

The target ratio for the autoscaler. This controls how aggressively the system scales.
The formula is: desired_replicas = queue_depth / target For example, if there are 100 jobs in the pending or running state, here’s what happens with each setting:
  • 1.0: exact match, 100 workers.
  • 1.05: 5% underprovisioning, 95 workers (slightly less than needed, recommended).
  • 0.95: 5% overprovisioning, 105 workers (more than strictly needed, lower latency).

Full configuration example