Learn how to deploy and customize the TensorZero Gateway.
--default-config: Use default configuration settings.--config-file path/to/tensorzero.toml: Use a custom configuration file.--config-file supports glob patterns, e.g.--config-file /path/to/**/*.toml.--run-clickhouse-migrations: Run ClickHouse database migrations and exit.--run-postgres-migrations: Run PostgreSQL database migrations and exit.Run with Docker
docker run \ --env-file .env \ -p 3000:3000 \ tensorzero/gateway \ --default-configdocker run \ -v "./config:/app/config" \ --env-file .env \ -p 3000:3000 \ tensorzero/gateway \ --config-path config/tensorzero.tomlRun with Docker Compose
docker-compose.yml for reference.Run with Kubernetes (k8s) and Helm
Build from source
cargo run --profile performance --bin gateway -- --config-file path/to/your/tensorzero.toml| Provider | Environment Variable(s) |
|---|---|
| Anthropic | ANTHROPIC_API_KEY |
| AWS Bedrock | AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY (seedetails) |
| AWS SageMaker | AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY (seedetails) |
| Azure OpenAI | AZURE_OPENAI_API_KEY |
| Fireworks | FIREWORKS_API_KEY |
| GCP Vertex AI Anthropic | GCP_VERTEX_CREDENTIALS_PATH (seedetails) |
| GCP Vertex AI Gemini | GCP_VERTEX_CREDENTIALS_PATH (seedetails) |
| Google AI Studio Gemini | GOOGLE_AI_STUDIO_GEMINI_API_KEY |
| Groq | GROQ_API_KEY |
| Hyperbolic | HYPERBOLIC_API_KEY |
| Mistral | MISTRAL_API_KEY |
| OpenAI | OPENAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Together | TOGETHER_API_KEY |
| xAI | XAI_API_KEY |
.env.example for a complete example with every supported environment variable.Disable pseudonymous usage analytics
howdy.rs in the GitHub repository to see exactly what usage data is collected and shared with TensorZero.To disable usage analytics, set the following configuration in thetensorzero.toml file:[gateway]disable_pseudonymous_usage_analytics =trueTENSORZERO_DISABLE_PSEUDONYMOUS_USAGE_ANALYTICS=1.TENSORZERO_CLICKHOUSE_URL environment variable with the connection details.If you don’t provide this environment variable, observability will be disabled.We recommend setting up observability early to monitor your LLM application and collect data for future optimization, but this can be done incrementally as needed.--log-format: Set the logging format to eitherpretty (default) orjson./status endpoint checks that the gateway is running successfully.{"status":"ok" }/health endpoint additionally checks that it can communicate with ClickHouse (if observability is enabled).{"gateway":"ok","clickhouse":"ok" }