Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Optimization
Evaluations
  • Overview
Deployment

Deploy Postgres (optional)

Learn how to deploy Postgres for advanced TensorZero features.

Most TensorZero deployments will not require Postgres.
TensorZero only requires Postgres for certain advanced features.Most notably, you need to deploy Postgres toenforce custom rate limits,run adaptive A/B tests, andset up auth for TensorZero.

Deploy

You can self-host Postgres or use a managed service (e.g. AWS RDS, Supabase, PlanetScale).Follow the deployment instructions for your chosen service.Internally, we test TensorZero using self-hosted Postgres 14.
If you find any compatibility issues, please open a detailedGitHub Discussion.

Configure

Connect to Postgres

To configure TensorZero to use Postgres, set theTENSORZERO_POSTGRES_URL environment variable with your Postgres connection details.
.env
TENSORZERO_POSTGRES_URL="postgres://[username]:[password]@[hostname]:[port]/[database]"# Example:TENSORZERO_POSTGRES_URL="postgres://myuser:mypass@localhost:5432/tensorzero"

Apply Postgres migrations

Unlike with ClickHouse,TensorZero does not automatically apply Postgres migrations.You must apply migrations manually withgateway --run-postgres-migrations.
  • Docker Compose
  • Docker
If you’ve configured the gateway with Docker Compose, you can run the migrations with:
docker-compose run --rm gateway --run-postgres-migrations
SeeDeploy the TensorZero Gateway for more details.
In most other cases, you can run the migrations with:
docker run --rm --network host \    -e TENSORZERO_POSTGRES_URL \    tensorzero/gateway --run-postgres-migrations
⌘I

[8]ページ先頭

©2009-2025 Movatter.jp