Setup
For this minimal setup, you’ll need just two files in your project directory:You can also find the complete code for this example on GitHub.
Configuration
Create a minimal configuration file that defines a model and a simple chat function:config/tensorzero.toml
Many AWS Bedrock models are only available through cross-region inference profiles.
For those models, the
model_id
requires special prefix (e.g. the us.
prefix in us.anthropic.claude-3-7-sonnet-20250219-v1:0
).
See the AWS documentation on inference profiles.region
).
Credentials
You must make sure that the gateway has the necessary permissions to access AWS Bedrock. The TensorZero Gateway will use the AWS SDK to retrieve the relevant credentials. The simplest way is to set the following environment variables before running the gateway:Deployment (Docker Compose)
Create a minimal Docker Compose configuration:docker-compose.yml
docker compose up
.