Key Components
To install only AI Gateway on your own infrastructure, you need the following components:- Truefoundry AI Gateway (Shipped as a single helm chart called
truefoundry) - Blob Storage (S3, GCS, Azure Container or any other S3 compatible storage)
Prerequisites for Installation
- Kubernetes Cluster: K8s cluster 1.27+.
- Support for dynamic provisioning of storage for PVC (for e.g AWS EBS, Azure Disk etc.) and support for ingress controller (for e.g. Nginx Ingress Controller) or istio service mesh for exposing the control plane dashboard and AI Gateway at an endpoint.
- Domain to map the ingress of the AI Gateway API server along with certificate for the domain.
This Domain will be referred as Gateway URL in our documentation.
- Egress access to TrueFoundry Central Auth Server: https://auth.truefoundry.com & https://login.truefoundry.com
- Tenant Name, Control Plane URL, Licence key, and image pull secret from TrueFoundry team. If you have not registered yet, please visit TrueFoundry to register.
- Blob Storage to store the AI Gateway request logs (either S3, GCS, Azure Blob Storage, or any other S3 compatible storage). You can find the instructions in the guide below.
Installation Instructions
- AWS
Setup AI Gateway IAM Role
Creating AWS IAM Role for AI Gateway
Creating AWS IAM Role for AI Gateway
AI Gateway IAM Role needs to have permission to assume any other IAM role in or cross account to provide access to different cloud services like bedrock models, etc.
- Create a new IAM role for AI Gateway with a suitable name like
tfy-ai-gateway-deps - Following is the IAM policy that needs to be attached to the AI Gateway IAM Role:
Here ”*” is used to allow the AI Gateway IAM Role to assume any other IAM role in or cross account. In place of ”*” you can also give specific ARNs of other IAM roles
- Add the following trust policy to the AI Gateway IAM Role:
In place of
<ACCOUNT_ID>, <AWS_REGION>, and <OIDC_ID> you can also give the values from your EKS cluster.
You can find the OIDC_ID from the EKS cluster. Also, here we are assuming that the service account is truefoundry and the namespace is truefoundry, you can change it as per your needs.Allow your IAM role to be assumed by AI Gateway IAM Role
- Add the following trust policy to your IAM Role to allow it to be assumed by the AI Gateway IAM Role:
Create S3 Bucket
Create a S3 Bucket with following config:Create a IAM Policy to allow access to the S3 Bucket with following config:Attach the IAM Policy to the AI Gateway IAM Role
- Make sure the bucket has lifecycle configuration to abort multipart upload set for 7 days.
- Make sure CORS is applied on the bucket with the below configuration:
Create Kubernetes Secrets
We will create two secrets in this step:
- Store the License Key
- Store the Image Pull Secret
Create Kubernetes Secret for License Key
Create Kubernetes Secret for License Key
We need to create a Kubernetes secret containing the licence key.Apply the secret to the Kubernetes cluster (Assuming you are installing the AI gateway in the
truefoundry-creds.yaml
truefoundry namespace)Create Kubernetes Secret for Image Pull Secret
Create Kubernetes Secret for Image Pull Secret
We need to create a Image Pull Secret to enable pulling the truefoundry images from the private registry.Apply the secret to the Kubernetes cluster (Assuming you are installing the ai gateway in the
truefoundry-image-pull-secret.yaml
truefoundry namespace)Create HelmChart Values file
Create a values file as given below and replace the following values:
- Control Plane URL: Control Plane URL provided by TrueFoundry team (e.g.,
https://truefoundry.cp.example.com) - Tenant Name: Tenant name provided by TrueFoundry team
- AI Gateway Host: URL that you will map to your AI Gateway API Server (e.g.,
truefoundry.gateway.example.com) - AWS S3 Bucket Name: Name of the S3 bucket you created in the previous step (e.g.,
my-truefoundry-bucket) - AWS Region: Region of the S3 bucket you created in the previous step (e.g.,
us-west-2) - AI Gateway IAM Role ARN: ARN of the IAM role you created in the previous step (e.g.,
arn:aws:iam::123456789012:role/tfy-ai-gateway-deps)
truefoundry-values.yaml
Provide Access to TrueFoundry Control Plane
Provide following information to TrueFoundry team on setup completion:
- AI Gateway URL configured to get it whitelisted on TrueFoundry side.
- AWS Access Key ID, AWS Secret Key, Region and Bucket name for accessing the Bucket to show metrics and request logs in the Control Plane Dashboard.