Setup
Object Storage
TensorZero uses object storage to store files (e.g. images, PDFs) used during multimodal inference. It supports any S3-compatible object storage service, including AWS S3, GCP Cloud Storage, Cloudflare R2, and many more. You can configure the object storage service in theobject_storage section of the configuration file.
In this example, we’ll use a local deployment of MinIO, an open-source S3-compatible object storage service.
type = "filesystem") or disable file storage (type = "disabled").
See Configuration Reference for more details.
The TensorZero Gateway will attempt to retrieve credentials from the following resources in order of priority:
S3_ACCESS_KEY_IDandS3_SECRET_ACCESS_KEYenvironment variablesAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables- Credentials from the AWS SDK (default profile)
Docker Compose
We’ll use Docker Compose to deploy the TensorZero Gateway, ClickHouse, and MinIO.`docker-compose.yml`
`docker-compose.yml`
Inference
With the setup out of the way, you can now use the TensorZero Gateway to perform multimodal inference. The TensorZero Gateway accepts both embedded files (encoded as base64 strings) and remote files (specified by a URL).- Python
- Python (OpenAI)
- HTTP
Image Detail Parameter
When working with image files, you can optionally specify adetail parameter to control the fidelity of image processing.
This parameter accepts three values: low, high, or auto.
The detail parameter only applies to image files and is ignored for other file types like PDFs or audio files.
Using low detail reduces token consumption and processing time at the cost of image quality, while high detail provides better image quality but consumes more tokens.
The auto setting allows the model provider to automatically choose the appropriate detail level based on the image characteristics.