Components and Sizing Recommendations
Component | Options | Sizing Recommendations |
---|---|---|
AI Gateway | Deploy as a Docker container in your Kubernetes cluster using Helm Charts | AWS EC2 t4g.medium instance, with at least 4GiB of memory and two vCPUs. For high reliability, deploy across multiple Availability Zones. |
Logs Store (optional) | Hosted MongoDB, Document DB or AWS S3 | Each log document is ~10kb in size (uncompressed) |
Cache (Prompts, Configs & Providers) | Elasticache or self-hosted Redis | Deploy in the same VPC as the Portkey Gateway. |
Prerequisites
Ensure the following tools and resources are installed and available:- Kubectl
- Helm (v3 or above)
- eksctl
- A running Amazon EKS cluster with at least 2 worker nodes. ( Best Practice: Use 2 nodes, with one node in each Availability Zone, to ensure high availability.)
Create a Portkey Account
- Go to the Portkey website.
- Sign up for a Portkey account.
- Once logged in, locate and save your
Organisation ID
for future reference. You can find it in the browser URL:https://app.portkey.ai/organisation/<organisation_id>/
- Contact the PortkeyAI team and provide your Organisation ID and the email address used during signup..
- The Portkey team will share the following information with you:
- Docker credentials for the Gateway images (username and password).
- License: Client Auth Key.
Setup Project Environment
Image Credentials Configuration
Configure Components
Based on the choice of components and their configuration update thevalues.yaml
.
Cache Store
The Portkey Gateway deployment includes a Redis instance pre-installed by default.. You can either use this built-in Redis or connect to an external cache likeAmazon ElastiCache for Redis OSS
or Valkey
.
- Built-in Redis: No additional permissions or network configurations are required.
Built-in Redis
- Amazon ElastiCache: To enable the gateway to work with an ElastiCache cache, ensure that inbound rule is configured in ElastiCache’s Security Group allowing access from EKS cluster on required port.
Amazon ElastiCache
Log Store
Amazon S3
- Create an Amazon S3 bucket for storing LLM logs.
-
Set up access to the log store. The Gateway offers the following options to access the S3 bucket to store logs.:
- IAM Roles for Service Accounts (IRSA)
Data Service (Optional)
The Data Service is a component of the Portkey deployment responsible for batch processing, fine-tuning, and log exports. To enable Data Service, add the following configuration to thevalues.yaml
file.
Network Configuration
Set Up External Access to the Gateway
To ensure the Gateway service is accessible from outside the cluster, create either an internal or internet-facing Load Balancer. Prerequisites- VPC and Subnet tagging requirements
- Installed and running AWS Load Balancer Controller. For Load Balancer Controller installation details, refer to the AWS documentation.
Ensure Outbound Network Access
By default, Kubernetes allows full outbound access, but if your cluster has NetworkPolicies that restrict egress, configure them to allow outbound traffic. Example NetworkPolicy for Outbound Access:Deploying Portkey Gateway
Verify the deployment
To confirm that the deployment was successful, follow these steps:- Verify that all pods are running correctly.
-
Test Gateway by sending a cURL request.
- Port-forward the Gateway pod
- Once port forwarding is active, open a new terminal window or tab and send a test request by running:
- Test gateway service integration with Load Balancer.
Integrating Gateway with Control Plane
Portkey supports the following methods for integrating the Control Plane with the Data Plane/Gateway:- AWS PrivateLink
- IP Whitelisting
AWS PrivateLink
Establishes a secure, private connection between the Control Plane and Data Plane within the AWS network, eliminating exposure to the public internet. Steps to establish AWS PrivateLink connectivity - To use AWS PrivateLink, you must create an AWS Network Load Balancer (NLB)—either internal or internet-facing—to expose the Gateway outside the EKS cluster. For detailed instructions on creating and integrating an NLB, please refer to the Networking Configuration Create Endpoint Service- Navigate to the AWS VPC Console.
- In the top-right corner of the AWS Console, select the region where the Portkey Gateway is deployed.
- Provide the following details -
- Name of endpoint service
- Select Network Load Balancer to associate with Endpoint.
- Choose region in which endpoint service will be available.
- Select whether acceptance is required or not for requested connections.
- Choose whether to enable private DNS name - If enabled provide the Private DNS Name.
- Select IPv4 under Supported IP address types.
- Click Create.
- Open to Endpoint Service > click on Actions > select Allow principals, and enter the Control Plane’s ARN(
arn:aws:iam::299329113195:root
). Reach out to portkey team and share the following details -- Service name
- DNS names
- Private DNS name
- Region selected while creating Endpoint Service.
- Port number on which Load Balancer is listening for connections.
- Wait for the Portkey team to initiate a connection request from the control plane’s AWS account to your Gateway AWS account. Navigate to the Endpoint connections section and once the request appears, approve it.
IP Whitelisting
Allows control plane to access the Data Plane over the internet by restricting inbound traffic to specific IP address of Control Plane. This method requires the Data Plane to have a publicly accessible endpoint. To implement, add an inbound rule to the Load Balancer’s security group allowing connections from the Portkey Control Plane’s IP (44.221.117.129
) on NLB listner port.
Verifying Gateway Integration with the Control Plane
- Send a test request to Gateway using
curl
. - Go to Portkey website -> Logs.
- Verify that the test request appears in the logs and that you can view its full details by selecting the log entry.
Uninstalling Portkey Gateway
Setting up IAM Permission
To enable the Portkey Gateway to access Amazon S3 for log storage and, optionally, Amazon Bedrock for model invocation, specific permissions are required. Follow the steps below to configure these permissions.IAM Roles for Service Accounts (IRSA)
- Create an IAM trust policy to provide Gateway access to S3 bucket.
- Create an IAM Role to associate with Gateway’s service account.
values.yaml
.
- Attach an IAM policy to the role to grant access to the S3 log store and, optionally, Amazon Bedrock.
Examples
Built-in Redis The following samplevalues.yaml
below shows how to configure the built-in Redis cache and Amazon S3 log store using IRSA.