LangChain provides Terraform modules specifically for AWS to help provision infrastructure for LangSmith. These modules can quickly set up EKS clusters, RDS, ElastiCache, S3, and networking resources.View the AWS Terraform modules for documentation and examples.
Reference architecture
LangSmith on AWS leverages managed services to provide a scalable, secure, and resilient platform. The following architecture applies to both self-hosted and hybrid and aligns with the AWS Well-Architected Framework:
- Ingress & networking: Requests enter via Amazon Application Load Balancer (ALB) within your VPC, secured using AWS WAF and IAM-based authentication.
- Frontend & backend services: Containers run on Amazon EKS, orchestrated behind the ALB. Nginx routes requests to the LangSmith frontend, backend, and queue workers.
- Storage & databases:
- Amazon RDS for PostgreSQL: metadata, projects, users.
- Amazon ElastiCache (Redis): caching and job queues.
- ClickHouse + Amazon EBS: analytics and trace storage.
- Amazon S3: object storage for trace artifacts and telemetry.
- LLM integration: Optionally proxy requests to Amazon Bedrock or Amazon SageMaker for LLM inference.
- Monitoring & observability: Integrated with Amazon CloudWatch and LangSmith Beacon (for self-hosted telemetry opt-in).
LangSmith self-hosted models
You can host LangSmith on AWS using any of the three self-hosted models:- LangSmith Observability and Evaluation: Deploy the UI and API services (frontend, backend, platform backend, playground, queue workers, and ACE). Use external AWS managed services for RDS PostgreSQL, ElastiCache, and S3.
- Full LangSmith Platform Observability, Evaluation, and Agent Deployment: In addition to the application services, run the Agent Server control plane and data plane in your EKS cluster. The control plane is installed via Helm; the data plane consists of Agent Server pods.
- Standalone Agent Server: Deploy one or a few Agent Servers on EKS or Docker with external RDS PostgreSQL and ElastiCache. Use optional integration with the LangSmith UI for tracing. This model offers maximum flexibility and suits microservice architectures.
- Hybrid: Run your data plane (Agent Servers and backing services) on AWS infrastructure while using LangChain’s managed control plane for the UI and APIs. The data plane uses the same AWS services (EKS, RDS PostgreSQL, ElastiCache) as the self-hosted models.
Compute options
LangSmith supports multiple compute options depending on your requirements:| Compute option | Description | Suitable for |
|---|---|---|
| Elastic Kubernetes Service (preferred) | Advanced scaling and multi-tenant support | Large enterprises |
| EC2-based | Full control, BYO-infra | Regulated or air-gapped environments |
AWS Well-Architected best practices
This reference is designed to align with the six pillars of the AWS Well-Architected Framework:Operational excellence
- Automate deployments with IaC (CloudFormation / Terraform).
- Use AWS Systems Manager Parameter Store for configuration.
- Continuously monitor via CloudWatch Logs and LangSmith trace metrics.
- The preferred method to manage LangSmith deployments is to create a CI process that builds Agent Server images and pushes them to ECR. Create a test deployment for pull requests before deploying a new revision to staging or production upon PR merge.
Security
- Use IAM roles with least-privilege policies.
- Enable encryption at rest (RDS, S3, ClickHouse volumes) and in transit (TLS 1.2+).
- Integrate with AWS Secrets Manager for credentials.
- Use Amazon Cognito as an IDP in conjunction with LangSmith’s built-in authentication and authorization features to secure access to agents and their tools.
Reliability
- Replicate the LangSmith data plane across regions: Deploy identical data planes to Kubernetes clusters in different regions for LangSmith Deployment. Deploy RDS and ECS services across Multi-AZ.
- Implement auto-scaling for backend workers.
- Use Amazon Route 53 health checks and failover policies.
Performance efficiency
- Leverage AWS Graviton instances for optimized compute.
- Cache hot datasets in ElastiCache.
- Use S3 Intelligent-Tiering for infrequently accessed trace data.
Cost optimization
- Right-size EKS clusters using Compute Savings Plans.
- Adopt Spot Fargate tasks for non-critical workloads.
- Monitor cost KPIs using AWS Cost Explorer dashboards.
Sustainability
- Minimize idle workloads with on-demand compute.
- Store telemetry in low-latency, low-cost tiers.
- Enable auto-shutdown for non-prod environments.
Security and compliance
LangSmith can be configured for:- PrivateLink-only access (no public internet exposure).
- KMS-based encryption keys for S3, RDS, and EBS.
- Audit logging to CloudWatch and AWS CloudTrail.
Monitoring and evals
Use LangSmith to:- Capture traces from LLM apps running on Bedrock or SageMaker.
- Evaluate model outputs via LangSmith datasets.
- Track latency, token usage, and success rates.
- AWS CloudWatch dashboards.
- OpenTelemetry and Prometheus exporters.