AWS for open-source AI tools: running Dify, Langfuse, LiveKit and E2B on Amazon Web Services in 2026
Two ways AI tools use AWS
Open-source AI projects touch AWS in two separate ways, and it helps to keep them apart:
| Use | AWS services | Example |
|---|---|---|
| Model access | Amazon Bedrock, SageMaker | Dify calling Claude through Bedrock |
| Hosting the app | EC2, ECS, EKS, RDS, ElastiCache, S3 | Langfuse running on EKS with RDS PostgreSQL |
You can do either without the other. A self-hosted Open WebUI on a home server can call Bedrock; a Dify install on AWS can call OpenAI directly.
Which directory projects support AWS
| Project | AWS support |
|---|---|
| Dify | Bedrock model provider; AWS Marketplace listing and deployment templates |
| Langfuse | Terraform module for EKS, Aurora PostgreSQL, ElastiCache, S3 and ClickHouse; Bedrock cost tracking |
| LiveKit | Self-hosted media servers on EC2 or EKS; Bedrock and Nova Sonic models for voice agents |
| E2B | Self-hosted sandbox infrastructure deployable to AWS with Terraform |
Amazon Bedrock in 2026
Bedrock is AWS's managed service for foundation models. You choose a model, enable access in the console, and call it through the bedrock-runtime API, either with the Converse API, which works across models, or with each provider's native format.
Models available include Anthropic's Claude family, Amazon Nova, Meta Llama, Mistral, Cohere, DeepSeek, Qwen, OpenAI's open-weight gpt-oss models and others. Availability varies by Region.
Recent changes:
| Date | Change |
|---|---|
| October 18, 2026 | Structured outputs for Claude on both bedrock-runtime and bedrock-mantle endpoints, guaranteeing replies match a JSON schema |
| September 15, 2026 | AWS recommended bedrock-runtime for new OpenAI-compatible Chat Completions and Responses integrations |
The OpenAI-compatible endpoints matter for open-source apps: many tools support only the OpenAI API format, and now they can reach Bedrock models by changing the base URL and credentials.
Bedrock pricing
Pricing depends on the model, Region, tier and whether you use cross-Region routing. As an example, Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens at the Standard global cross-Region rate. Geographic and in-Region rates are set per Region and can be higher.
| Tier | Trade-off |
|---|---|
| Standard | Normal on-demand pricing and latency |
| Flex | Lower price, best-effort processing for work that can wait |
| Priority | Higher price, preferential capacity for latency-sensitive apps |
| Reserved | Committed capacity for steady, high volume |
| Batch | 50% off on-demand for asynchronous jobs on supported models |
Prompt caching, available for Claude and other models, cuts the cost of repeated context such as long system prompts or documents. For RAG-heavy apps it can reduce input costs substantially.
Hosting AI apps on AWS
| Scale | Setup | Rough monthly cost |
|---|---|---|
| Trial or small team | One EC2 instance with Docker Compose | $60 to $150 |
| Production, moderate use | ECS or EKS, RDS PostgreSQL, ElastiCache, S3 | $300 to $1,500 |
| Large or regulated | Multi-AZ EKS, Aurora, private networking, WAF | $2,000 and up |
Costs are for infrastructure only; model usage is separate. GPU instances for running models yourself, such as g6 or p5 families, cost far more and are worth it only at steady high volume or for models not available on Bedrock.
A reference setup for Langfuse on AWS
Langfuse's official Terraform module shows a production pattern many AI tools follow:
- Containers on EKS for the web and worker services.
- Aurora PostgreSQL for transactional data.
- ClickHouse for traces, self-managed or through ClickHouse Cloud.
- ElastiCache for Redis or Valkey for queues and caching.
- S3 for event storage and media uploads.
- An Application Load Balancer with TLS from AWS Certificate Manager.
The same building blocks fit Dify, LibreChat and most other platforms with a database, cache and object storage.
Security on AWS
- Use IAM roles, not access keys. Give the app's task or pod role permission only for
bedrock:InvokeModelon the models it needs. - Private networking. Put databases and Redis in private subnets. Use VPC endpoints for Bedrock and S3 so traffic stays off the public internet.
- Guardrails. Bedrock Guardrails can filter harmful content, redact personal data and block topics, applied to any model.
- Logging. Enable model invocation logging to S3 or CloudWatch if you need an audit trail, and protect those logs, since they contain prompts.
- Quotas. Bedrock has per-model token and request quotas per Region. Request increases before launch, not after users hit errors.
Using Bedrock from open-source apps
Most apps need three settings: a Region, credentials and model IDs. On EC2, ECS or EKS, prefer the instance or task role so no keys are stored. Outside AWS, create an IAM user or use IAM Identity Center with short-lived credentials. Model IDs for cross-Region inference profiles start with a prefix such as global. or us.; use the profile ID rather than the base model ID to get cross-Region routing. If an app supports only OpenAI-style APIs, put LiteLLM in front, or use Bedrock's OpenAI-compatible endpoint.
Cost control
Set AWS Budgets alerts on Bedrock spend, tag resources per team or project, and use application inference profiles to attribute model costs. In the apps themselves, Langfuse and LiteLLM track spend per user and project, which AWS billing cannot see. Use batch inference for evaluations and bulk document processing, and Flex for background tasks that can wait.
Agents on AWS
AWS has added services for running agents, not only models. Bedrock Agents and Amazon Bedrock AgentCore provide managed runtimes, memory, identity, a code interpreter, a browser tool and a gateway that turns APIs into MCP tools, so teams can deploy agents built with open-source frameworks such as LangGraph, CrewAI or Strands Agents without managing servers. Strands Agents is AWS's own open-source Python agent SDK. For teams that prefer self-hosting, the same agents run on ECS or EKS with Temporal or a queue for long tasks. E2B's self-hosted sandboxes on AWS give agents an isolated place to run generated code.
AWS compared with other clouds for AI
| Cloud | Model service | Notable models |
|---|---|---|
| AWS | Bedrock | Claude, Nova, Llama, Mistral, DeepSeek, gpt-oss |
| Google Cloud | Gemini Enterprise Agent Platform (Vertex AI) | Gemini, Claude, Llama, Mistral |
| Microsoft Azure | Azure AI Foundry | OpenAI GPT models, Claude, Llama, Mistral, DeepSeek |
Many companies choose based on where their data and existing contracts already are, then use a gateway to reach models on other clouds when needed.
Related: Google Cloud stack, Kubernetes stack, Anthropic API stack, LiteLLM stack, Langfuse stack, Stack index.
Frequently asked questions
Why use Bedrock instead of calling model providers directly?
Billing, security and compliance. Bedrock usage goes on your AWS bill and counts toward AWS commitments, traffic can stay inside your VPC through PrivateLink, access is controlled with IAM, and AWS states that prompts and outputs are not used to train models. Many companies already have AWS approved, which makes Bedrock faster to adopt than a new vendor.
Do open-source AI apps support Bedrock?
Most do. Dify, LibreChat, LobeChat, Open WebUI through pipelines or a gateway, Langflow, n8n and LiteLLM all have Bedrock integrations. Since September 2026 AWS recommends the bedrock-runtime endpoint for new OpenAI-compatible integrations, so tools that speak the OpenAI API can also connect with minimal changes.
What are Bedrock's service tiers?
Standard is regular on-demand pricing. Flex trades slower, best-effort processing for a lower price. Priority costs more for faster, more reliable responses. Reserved buys committed capacity. Batch inference processes large jobs asynchronously at 50 percent off on-demand prices for supported models.
What is the cheapest way to self-host Dify or Langfuse on AWS?
A single EC2 instance running the project's Docker Compose file, with 4 vCPUs and 8 to 16 GB of RAM, costs roughly $60 to $150 a month on demand and less with savings plans. Managed RDS, ElastiCache and EKS add reliability and cost. Use the managed setup once the tool becomes business-critical.
What does cross-Region inference mean on Bedrock?
Bedrock can route a request to another AWS Region with spare capacity. Global cross-Region profiles route anywhere and are usually the cheapest; geographic profiles keep traffic within an area such as the US or EU for data residency; in-Region endpoints stay in one Region and may cost more.