能力标签
🤖
Dify应用

Dify AI应用开发平台

基于 TypeScript · 快速构建企业级 AI 应用,支持私有知识库
英文名:dify-self-hosted-on-aws
⭐ 188 Stars 🍴 56 Forks 💻 TypeScript 📄 MIT-0 🏷 AI 7.5分
7.5AI 综合评分
aws-cdkdifytypescript
⚙️ 配置说明
✦ AI Skill Hub 推荐

AI Skill Hub 推荐使用:Dify AI应用开发平台 是一款优质的Dify应用。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Dify应用解决方案,这是一个值得深入了解的选择。

📚 深度解析
Dify AI应用开发平台 是一款基于 TypeScript 的开源工具,在 GitHub 上收获 0k+ Star,是aws-cdk、dify、typescript领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
Dify AI应用开发平台 依赖 TypeScript 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 TypeScript 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 Dify AI应用开发平台 的版本更新,及时通知重要功能变化。
📋 工具概览

Dify AI应用开发平台 是一款基于 TypeScript 开发的开源工具,专注于 aws-cdk、dify、typescript 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 188
开发语言
TypeScript
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT-0
AI 综合评分
7.5 分
工具类型
Dify应用
Forks
56
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Dify AI应用开发平台 是一款基于 TypeScript 开发的开源工具,专注于 aws-cdk、dify、typescript 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 基于 Dify 平台的 AI 应用快速部署模板
  • 支持 RAG 检索增强生成,可接入私有知识库
  • 可一键部署为独立 AI 应用服务,无需从零搭建
  • 提供可视化 Prompt 编排和变量管理界面
  • 支持多模型切换,灵活应对不同场景需求
🎯 主要使用场景
  • 基于公司内部文档快速构建员工知识库问答系统
  • 部署特定领域的 AI 客服或智能助手应用
  • 搭建个人专属的 RAG 增强知识问答工具
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:npm 全局安装
npm install -g dify-self-hosted-on-aws

# 方式二:npx 直接运行(无需安装)
npx dify-self-hosted-on-aws --help

# 方式三:项目依赖安装
npm install dify-self-hosted-on-aws

# 方式四:从源码运行
git clone https://github.com/aws-samples/dify-self-hosted-on-aws
cd dify-self-hosted-on-aws
npm install
npm start
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
dify-self-hosted-on-aws --help

# 基本用法
dify-self-hosted-on-aws [options] <input>

# Node.js 代码中使用
const dify_self_hosted_on_aws = require('dify-self-hosted-on-aws');

const result = await dify_self_hosted_on_aws.run(options);
console.log(result);
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# dify-self-hosted-on-aws 配置说明
# 查看配置选项
dify-self-hosted-on-aws --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export DIFY_SELF_HOSTED_ON_AWS_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 58/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

Dify on AWS with CDK

Build

Self-host Dify, an LLM app development platform, using AWS managed services with AWS CDK.

architecture

Key Features:

  • Fully managed services requiring less maintenance effort
  • Aurora servereless v2, ElastiCache, ECS Fargate, etc.
  • Cost effective architectural decisions
  • allow to use NAT instances instead of NAT Gateway, and Fargate spot capacity by default
  • Easily integrate with Bedrock models and Knowledge Bases

Prerequisites

You must have the following dependencies installed to deploy this app:

install npm dependencies

npm ci

bootstrap the AWS account (required only once per account and region)

npx cdk bootstrap

Deploy

You can adjust configuration parameters such as AWS regions by modifying bin/cdk.ts. Please also check EnvironmentProps interface for all the available parameters.

Then you can run the following commands to deploy the entire stack.

```sh

deploy the CDK stack

npx cdk deploy --all


The initial deployment usually takes about 20 minutes. After a successful deployment, you will get the URL for the app.
✅ DifyOnAwsCdkStack

✨ Deployment time: 326.43s

Outputs: DifyOnAwsStack.DifyUrl = https://dify.example.com ```

You can open the URL with a browser and get started!

Deploy from CloudShell

You can use a dedicated script that works even in an environment with limited storage space such as AWS CloudShell.

In CloudShell, you can just run the following commands:

git clone https://github.com/aws-samples/dify-self-hosted-on-aws.git
cd dify-self-hosted-on-aws
./simple-deploy.sh

Then follow the prompts from the shell script. You will finally get the DifyOnAwsStack.DifyUrl output in the CLI.

Setup Dify to use Bedrock

After logged in, you can setup Dify to use Bedrock LLMs.

[!IMPORTANT] Before setting up models in Dify, you have to enable models you want to use in Bedrock management console. Please read this document for more details.

Go to settings by clicking the right-top profile, click WORKSPACE -> Model Provider, and select AWS Bedrock model.

IAM policies are already configured properly, so you can just select a correct AWS region (where the models are enabled) to use Bedrock models, and click Save.

model-setup

Deploying to a closed network (a.k.a 閉域要件)

You can deploy the system on a closed network (i.e. a VPC without internet gateway or NAT gateway) with a few simple additional steps.

To deploy on a closed network, please follow the steps below:

1. Set configuration parameters in bin/cdk.ts as below:

    export const props: EnvironmentProps = {
        // set region and account explicitly.
        awsRegion: 'ap-northeast-1',
        awsAccount: '123456789012',

        // Set your internal IP address ranges here.
        allowedIPv4Cidrs: ['10.0.0.0/16'],

        // The below two flags must be set for closed network deployment.
        useCloudFront: false,
        internalAlb: true,

        // If Docker Hub is not accessible from your vpc subnets, set this property and run copy-to-ecr script (see step#2)
        customEcrRepositoryName: 'dify-images',

        // To let the CDK create a VPC with closed network, set this property.
        vpcIsolated: true,
        // Or, optionally you can import an existing VPC.
        vpcId: 'vpc-12345678',

        // Other properties can be configured as you like.
    };
    

2. Open python-requirements.txt and remove all the dependencies from it This is only required if PyPI is not accessible from your vpc subnets. 3. Copy all the dify container images in Docker Hub to an ECR repository by executing npx ts-node scripts/copy-to-ecr.ts. The script handles all the tasks required to copy images. You will also need to run npm ci before this. You can create an ECR repository with the name of customEcrRepositoryName by yourself, or the script creates one if it does not exist yet. This script must be executed in an environment that has access to the Internet. Please run the script every time you change difyImageTag or difySandboxImageTag property. This is only required if Docker Hub is not accessible from your vpc subnets. 4. If you are using an existing VPC (vpcId property), make sure the required VPC endpoints are provisioned before deployment. See vpc-endpoints.ts for the list of required VPC endpoints. If you let CDK create a VPC (by setting vpcIsolated: true), all the endpoints are created automatically. 5. Deploy the CDK project following the Deploy section. 6. After the deployment, please configure Bedrock in Dify with the same AWS region as your VPC (see setup section) * This is only required if Bedrock API in other regions are not accessible from your vpc subnets.

[!WARNING] From Dify v1, you often need access to the PyPI server to install Dify plugins, which happens every time the plugin-daemon container starts. You can use solutions like pypi-mirror to avoid the limitation. See issue#69 for more details.

Setup Email (SMTP) for user invitation

You can let Dify send emails to invite new users or reset passwords. To enable the feature, set setupEmail and domainName property in bin/cdk.ts. Note that you can only configure one email server (Amazon SES Identity) per domainName property.

After a successful deployment, you have to move out from SES sandbox to send emails to non-verified addresses and domains. Please refer to the document for more details: Request production access (Moving out of the Amazon SES sandbox)

Example output from deployment

DifyOnAwsStack.ConsoleConnectToTaskCommand = aws ecs execute-command --region ap-northeast-1 --cluster DifyOnAwsStack-ClusterEB0386A7-redacted --container Main --interactive --command "bash" --task $(...) ```

Execute this command to start an interactive bash session in the container, where you can run any commands needed for maintenance or migration tasks.

Upgrading Dify without automatic migration

If you need to upgrade Dify without running automatic database migrations (e.g., to handle breaking changes manually), you can toggle the autoMigration flag:

  1. Set autoMigration: false in lib/dify-on-aws-stack.ts (ApiService construct)
  2. Deploy the project with the new Dify version
  3. Use ConsoleConnectToTaskCommand to connect to the container
  4. Run the required migration or maintenance commands manually
  5. Set autoMigration: true and deploy again to re-enable automatic migrations

Quick Start

For a quick and convenient deployment, you can use the one-click deployment option available at: * One-Click Deployment for Dify on AWS

本リポジトリの使い方について、日本語で書かれた資料もあります: Dify on AWS 環境構築手順 (スライド形式) AWS CDKでDifyを一撃構築 * AWSマネージドサービスで Dify のセルフホスティングを試してみた

Additional Environment Variables

You can configure additional environment variables for Dify containers by using the additionalEnvironmentVariables property:

new DifySelfHostedOnAwsStack(app, 'DifySelfHostedOnAwsStack', {
  additionalEnvironmentVariables: [
    {
      // Example of applying environment variable to all containers
      key: 'GLOBAL_SETTING',
      value: 'value',
      // Omitting targets applies to all containers
    },
    {
      // Example of referencing Systems Manager parameter
      key: 'CONFIG_PARAM',
      value: { parameterName: 'my-parameter' },
      targets: ['web', 'api'],
    },
    {
      // Example of referencing a specific field in Secrets Manager
      key: 'API_KEY',
      value: { secretName: 'my-secret', field: 'apiKey' },
      targets: ['worker'],
    },
  ],
});

This feature allows you to inject custom environment variables into Dify containers. The container types that can be specified in targets are 'web', 'api', 'worker', and 'sandbox'.

Add Python packages available in code execution

You can add Python packages that is available in Dify code execution feature. Edit python-requirements.txt following the Requirements File Format.

In some libraries, you have to allow additonal system calls in Dify sandbox. This CDK project let you to allow all the system calls by allowAnySysCalls flag in bin/cdk.ts.

[!WARNING] If you enable allowAnySysCalls flag, please make sure that code executed in your Dify tenant can be fully trusted.

Please also refer to this blog article for more details: Using any Python libraries in Dify's code block

🎯 aiskill88 AI 点评 A 级 2026-05-23

该项目使用TypeScript编写,基于AWS CDK进行部署,易于维护和扩展,值得关注。

📚 实用指南(长尾问题)
适合谁
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效
部署方案
  • Docker:dify-self-hosted-on-aws 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
dify-self-hosted-on-aws 中文教程dify-self-hosted-on-aws 安装报错怎么办dify-self-hosted-on-aws Docker 部署dify-self-hosted-on-aws 与同类工具对比dify-self-hosted-on-aws 最佳实践dify-self-hosted-on-aws 适合谁用
⚡ 核心功能
👥 适合谁
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效
👥 适合人群
AI 应用开发者Dify 平台用户企业 AI 部署团队需要快速构建 AI 产品的创业者
🎯 使用场景
  • 基于公司内部文档快速构建员工知识库问答系统
  • 部署特定领域的 AI 客服或智能助手应用
  • 搭建个人专属的 RAG 增强知识问答工具
⚖️ 优点与不足
✅ 优点
  • +快速构建 AI 应用,缩短上线周期
  • +支持 RAG 私有知识库接入
  • +部署方式灵活,云端本地皆可
⚠️ 不足
  • 依赖 Dify 平台环境,有一定的学习成本
  • 高级功能配置相对复杂
  • 本地部署需要提前配置好 Docker 等基础环境
⚠️ 使用须知

该工具使用 MIT-0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

📄 MIT-0 — 请查阅原始协议条款了解具体使用限制。

🔗 相关工具推荐
📚 相关教程推荐
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
解答
💡 AI Skill Hub 点评

总体来看,Dify AI应用开发平台 是一款质量良好的Dify应用,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
📚 深入学习 Dify AI应用开发平台
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 dify-self-hosted-on-aws
原始描述 开源Dify应用:Self-host Dify on AWS。⭐188 · TypeScript
Topics aws-cdkdifytypescript
GitHub https://github.com/aws-samples/dify-self-hosted-on-aws
License MIT-0
语言 TypeScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/aws-samples/dify-self-hosted-on-aws

收录时间:2026-05-18 · 更新时间:2026-05-19 · License:MIT-0 · AI Skill Hub 不对第三方内容的准确性作法律背书。