Skip to content

Commit 57baa47

Browse files
committed
Add reference / best practice for AWS + Azure infrastructure
1 parent 88dcd78 commit 57baa47

File tree

6 files changed

+301
-9
lines changed

6 files changed

+301
-9
lines changed

src/docs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,13 @@
13441344
"langsmith/cloud"
13451345
]
13461346
},
1347+
{
1348+
"group": "Self-hosted cloud architecture",
1349+
"pages": [
1350+
"langsmith/aws-self-hosted",
1351+
"langsmith/azure-self-hosted"
1352+
]
1353+
},
13471354
{
13481355
"group": "Hybrid",
13491356
"pages": [

src/langsmith/aws-self-hosted.mdx

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: Self-hosted on AWS
3+
sidebarTitle: AWS
4+
icon: "aws"
5+
---
6+
7+
When running LangSmith on [Amazon Web Services (AWS)](https://aws.amazon.com/), you can set up in either [self-hosted](/langsmith/self-hosted) or [hybrid](/langsmith/hybrid) mode. In both cases, your workloads run on AWS infrastructure within your account, allowing you to use AWS managed services while maintaining control over your data and compute resources.
8+
9+
This page provides AWS-specific architecture patterns, service recommendations, and best practices for deploying and operating LangSmith on AWS.
10+
11+
<Note>
12+
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.
13+
14+
View the [AWS Terraform modules](https://github.com/langchain-ai/terraform/tree/main/modules/aws) for documentation and examples.
15+
</Note>
16+
17+
## Reference architecture
18+
19+
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](https://aws.amazon.com/architecture/well-architected/):
20+
21+
![Architecture diagram showing AWS relations to LangSmith services](/langsmith/images/aws-architecture-self-hosted.png)
22+
23+
- <Icon icon="globe" /> **Ingress & networking**: Requests enter via [Amazon Application Load Balancer (ALB)](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/) within your [VPC](https://aws.amazon.com/vpc/), secured using [AWS WAF](https://aws.amazon.com/waf/) and [IAM](https://aws.amazon.com/iam/)-based authentication.
24+
- <Icon icon="cube" /> **Frontend & backend services:** Containers run on [Amazon EKS](https://aws.amazon.com/eks/), orchestrated behind the ALB. Nginx routes requests to the LangSmith frontend, backend, and queue workers.
25+
- <Icon icon="database" /> **Storage & databases:**
26+
- [Amazon RDS for PostgreSQL](https://aws.amazon.com/rds/postgresql/): metadata, projects, users.
27+
- [Amazon ElastiCache (Redis)](https://aws.amazon.com/elasticache/redis/): caching and job queues.
28+
- ClickHouse + [Amazon EBS](https://aws.amazon.com/ebs/): analytics and trace storage.
29+
- [Amazon S3](https://aws.amazon.com/s3/): object storage for trace artifacts and telemetry.
30+
- <Icon icon="sparkles" /> **LLM integration:** Optionally proxy requests to [Amazon Bedrock](https://aws.amazon.com/bedrock/) or [Amazon SageMaker](https://aws.amazon.com/sagemaker/) for LLM inference.
31+
- <Icon icon="chart-line" /> **Monitoring & observability:** Integrated with [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/) and [LangSmith Beacon](/langsmith/self-host-egress) (for self-hosted telemetry opt-in).
32+
33+
### LangSmith self-hosted models
34+
35+
You can host LangSmith on AWS using any of the three self-hosted models:
36+
37+
- [LangSmith Observability and Evaluation](/langsmith/self-hosted#self-host-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.
38+
- [Full LangSmith Platform Observability, Evaluation, and Agent Deployment](/langsmith/self-hosted#enable-langsmith-deployment): In addition to the application services, run the Agent Server [control plane](/langsmith/control-plane) and [data plane](/langsmith/data-plane) in your EKS cluster. The control plane is installed via Helm; the data plane consists of [Agent Server](/langsmith/agent-server) pods.
39+
- [Standalone Agent Server](/langsmith/self-hosted/standalone-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.
40+
41+
## Compute options
42+
43+
LangSmith supports multiple compute options depending on your requirements:
44+
45+
| Compute option | Description | Suitable for |
46+
|-----------------|-------------|--------------|
47+
| **Elastic Kubernetes Service (preferred)** | Advanced scaling and multi-tenant support | Large enterprises |
48+
| **EC2-based** | Full control, BYO-infra | Regulated or air-gapped environments |
49+
50+
## AWS Well-Architected best practices
51+
52+
This reference is designed to align with the six pillars of the AWS Well-Architected Framework:
53+
54+
### Operational excellence
55+
56+
- Automate deployments with IaC ([CloudFormation](https://aws.amazon.com/cloudformation/) / [Terraform](https://www.terraform.io/)).
57+
- Use [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) for configuration.
58+
- Continuously monitor via [CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) and LangSmith trace metrics.
59+
- The preferred method to manage [LangSmith deployments](/langsmith/deployments) is to create a CI process that builds [Agent Server](/langsmith/agent-server) images and pushes them to [ECR](https://aws.amazon.com/ecr/). Create a test deployment for pull requests before deploying a new revision to staging or production upon PR merge.
60+
61+
### Security
62+
63+
- Use [IAM](https://aws.amazon.com/iam/) roles with least-privilege policies.
64+
- Enable encryption at rest ([RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html), [S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingEncryption.html), ClickHouse volumes) and in transit (TLS 1.2+).
65+
- Integrate with [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) for credentials.
66+
- Use [Amazon Cognito](https://aws.amazon.com/cognito/) as an IDP in conjunction with LangSmith's built-in authentication and authorization features to secure access to agents and their tools.
67+
68+
### Reliability
69+
70+
- Replicate the LangSmith [data plane](/langsmith/data-plane) across regions: Deploy identical data planes to Kubernetes clusters in different regions for LangSmith Deployment. Deploy [RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZSingleStandby.html) and [ECS](https://aws.amazon.com/ecs/) services across [Multi-AZ](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/).
71+
- Implement [auto-scaling](https://aws.amazon.com/autoscaling/) for backend workers.
72+
- Use [Amazon Route 53](https://aws.amazon.com/route53/) health checks and failover policies.
73+
74+
### Performance efficiency
75+
76+
- Leverage [AWS Graviton](https://aws.amazon.com/ec2/graviton/) instances for optimized compute.
77+
- Cache hot datasets in [ElastiCache](https://aws.amazon.com/elasticache/).
78+
- Use [S3 Intelligent-Tiering](https://aws.amazon.com/s3/storage-classes/intelligent-tiering/) for infrequently accessed trace data.
79+
80+
### Cost optimization
81+
82+
- Right-size [EKS](https://aws.amazon.com/eks/) clusters using [Compute Savings Plans](https://aws.amazon.com/savingsplans/compute-pricing/).
83+
- Adopt [Spot](https://aws.amazon.com/ec2/spot/) [Fargate](https://aws.amazon.com/fargate/) tasks for non-critical workloads.
84+
- Monitor cost KPIs using [AWS Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/) dashboards.
85+
86+
### Sustainability
87+
88+
- Minimize idle workloads with on-demand compute.
89+
- Store telemetry in low-latency, low-cost tiers.
90+
- Enable auto-shutdown for non-prod environments.
91+
92+
## Security and compliance
93+
94+
LangSmith can be configured for:
95+
96+
- [PrivateLink](https://aws.amazon.com/privatelink/)-only access (no public internet exposure).
97+
- [KMS](https://aws.amazon.com/kms/)-based encryption keys for S3, RDS, and EBS.
98+
- Audit logging to [CloudWatch](https://aws.amazon.com/cloudwatch/) and [AWS CloudTrail](https://aws.amazon.com/cloudtrail/).
99+
100+
Customers can deploy in [GovCloud](https://aws.amazon.com/govcloud-us/), ISO, or HIPAA regions as needed.
101+
102+
## Monitoring and evals
103+
104+
Use LangSmith to:
105+
106+
- Capture traces from LLM apps running on [Bedrock](https://aws.amazon.com/bedrock/) or [SageMaker](https://aws.amazon.com/sagemaker/).
107+
- Evaluate model outputs via [LangSmith datasets](/langsmith/manage-datasets).
108+
- Track latency, token usage, and success rates.
109+
110+
Integrate with:
111+
112+
- [AWS CloudWatch](https://aws.amazon.com/cloudwatch/) dashboards.
113+
- [OpenTelemetry](https://opentelemetry.io/) and [Prometheus](https://prometheus.io/) exporters.

0 commit comments

Comments
 (0)