# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Dify
spec:
    description: Dify is an open-source LLM app development platform.
    coverImage: https://cdn.zeabur.com/dify-banner.png
    icon: https://cdn.zeabur.com/dify-icon.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Domain of your Dify app.
    tags:
        - LLM
        - Workflow
        - AI
    readme: |
        Dify is an open-source LLM app development platform. Its intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

        ## Features

        1. **Workflows**: Build and test powerful AI workflows on a visual canvas, leveraging all the following features and beyond.
        2. **Comprehensive model support**: Seamless integration with hundreds of proprietary / open-source LLMs from dozens of inference providers and self-hosted solutions, covering GPT, Mistral, Llama3, and any OpenAI API-compatible models. A full list of supported model providers can be found [in the Model Providers section](https://docs.dify.ai/getting-started/readme/model-providers).
        3. **Prompt IDE**: Intuitive interface for crafting prompts, comparing model performance, and adding additional features such as text-to-speech to a chat-based app.
        4. **RAG Pipeline**: Extensive RAG capabilities that cover everything from document ingestion to retrieval, with out-of-box support for text extraction from PDFs, PPTs, and other common document formats.
        5. **Agent capabilities**: You can define agents based on LLM Function Calling or ReAct, and add pre-built or custom tools for the agent. Dify provides 50+ built-in tools for AI agents, such as Google Search, DELL·E, Stable Diffusion and WolframAlpha.
        6. **LLMOps**: Monitor and analyze application logs and performance over time. You could continuously improve prompts, datasets, and models based on production data and annotations.
        7. **Backend-as-a-Service**: All of Dify's offerings come with corresponding APIs, so you could effortlessly integrate Dify into your own business logic.

        ## Deployment

        To deploy Dify, click the "Deploy" button in the top-right corner, and fill in the required domain name. Once deployed, you can access your Dify app at `https://<your-domain>.zeabur.app`.

        ## App structure

        - Redis, PostgreSQL, MINIO, and Webaviate for data storage and caching.
        - `api`, `worker`, `web`, and `sandbox` are the microservices of Dify.
        - `nginx` is the gateway of Dify. It integrates the microservices to a single host. In another words, **it is the entry point of your Dify app.**

        ## Configuration

        Refer to <https://docs.dify.ai/getting-started/install-self-hosted/environments> for the configurable variables, which are primarily set in the `api` service.

        ### Upload File Size Limit

        The default upload file size limit is 15 MB. You can change this limit by modifying the `client_max_body_size` directive in the configuration file located at `/etc/nginx/nginx.conf` for the `nginx` service. The value should be a string with a unit (e.g., `15M` for 15 MB).

        Additionally, you may need to set the `UPLOAD_FILE_SIZE_LIMIT` variable in the environment of the `api` service to match this value. Ensure that this value is the same as the `client_max_body_size` directive in the `/etc/nginx/nginx.conf` configuration (e.g., `15M` for 15 MB).
    services:
        - name: nginx
          icon: https://www.svgrepo.com/show/373924/nginx.svg
          template: PREBUILT
          spec:
            source:
                image: nginx:1.27
            ports:
                - id: web
                  port: 80
                  type: HTTP
            env:
                DIFY_GATEWAY_URL:
                    default: https://${ZEABUR_WEB_DOMAIN}
                    expose: true
            configs:
                - path: /etc/nginx/proxy.conf
                  template: |
                    proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_buffering off; proxy_read_timeout 3600s; proxy_send_timeout 3600s;
                  permission: null
                  envsubst: null
                - path: /etc/nginx/nginx.conf
                  template: |
                    user  nginx; worker_processes  auto;
                    error_log  /var/log/nginx/error.log notice; pid        /var/run/nginx.pid;
                    events {
                      worker_connections  1024;
                    }
                    http {
                      include       /etc/nginx/mime.types;
                      default_type  application/octet-stream;

                      log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

                      access_log  /var/log/nginx/access.log  main;

                      sendfile        on;
                      keepalive_timeout  65;
                      client_max_body_size 15M;
                      include /etc/nginx/conf.d/*.conf;
                    }
                  permission: null
                  envsubst: null
                - path: /etc/nginx/conf.d/default.conf
                  template: "server {\n  listen 80;\n  server_name _;\n\n  location /console/api {\n    proxy_pass http://api:5001;\n    include proxy.conf;\n  }\n  \n  location /api {\n    proxy_pass http://api:5001;\n    include proxy.conf;\n  }\n  \n  location /v1 {\n    proxy_pass http://api:5001;\n    include proxy.conf;\n  }\n\n  location /files {\n    proxy_pass http://api:5001;\n    include proxy.conf;\n  }\n\n  location / {\n    proxy_pass http://web:3000;\n    include proxy.conf;\n  }\n\n}\n"
                  permission: null
                  envsubst: null
          domainKey: PUBLIC_DOMAIN
        - name: redis
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg
          template: PREBUILT
          spec:
            source:
                image: redis/redis-stack-server:latest
            ports:
                - id: database
                  port: 6379
                  type: TCP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Command to connect to your Redis
                  content: redis-cli -h ${PORT_FORWARDED_HOSTNAME} -p ${DATABASE_PORT_FORWARDED_PORT} -a ${REDIS_PASSWORD}
                - title: Redis Connection String
                  content: redis://:${REDIS_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: Redis password
                  content: ${REDIS_PASSWORD}
                - title: Redis host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: Redis port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                REDIS_ARGS:
                    default: --requirepass ${REDIS_PASSWORD}
                REDIS_CONNECTION_STRING:
                    default: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}
                    expose: true
                REDIS_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                REDIS_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                REDIS_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                REDIS_URI:
                    default: ${REDIS_CONNECTION_STRING}
                    expose: true
        - name: db
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/postgresql.svg
          template: PREBUILT
          spec:
            source:
                image: postgres:16
            ports:
                - id: database
                  port: 5432
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/postgresql/data
            instructions:
                - title: Connection String
                  content: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}
                - title: PostgreSQL Connect Command
                  content: psql "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}"
                - title: PostgreSQL username
                  content: ${POSTGRES_USERNAME}
                - title: PostgresSQL password
                  content: ${POSTGRES_PASSWORD}
                - title: PostgresSQL database
                  content: ${POSTGRES_DATABASE}
                - title: PostgreSQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: PostgreSQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                PGDATA:
                    default: /var/lib/postgresql/data/pgdata
                POSTGRES_CONNECTION_STRING:
                    default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}
                    expose: true
                POSTGRES_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: true
                POSTGRES_DB:
                    default: zeabur
                POSTGRES_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                POSTGRES_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                POSTGRES_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                POSTGRES_URI:
                    default: ${POSTGRES_CONNECTION_STRING}
                    expose: true
                POSTGRES_USER:
                    default: root
                POSTGRES_USERNAME:
                    default: ${POSTGRES_USER}
                    expose: true
        - name: minio
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/minio.svg
          template: PREBUILT
          spec:
            source:
                image: quay.io/minio/minio:latest
                command:
                    - /bin/sh
                args:
                    - -c
                    - |
                      minio server /data --console-address :9090 &
                      MINIO_PID=$!
                      while ! curl -s http://localhost:9000/minio/health/live; do
                        echo 'Waiting for MinIO to start...'
                        sleep 1
                      done
                      sleep 5
                      mc alias set myminio http://localhost:9000 $MINIO_USERNAME $MINIO_PASSWORD
                      echo "Creating bucket '$MINIO_DEFAULT_BUCKET'"
                      mc mb myminio/$MINIO_DEFAULT_BUCKET
                      wait $MINIO_PID
            ports:
                - id: web
                  port: 9000
                  type: HTTP
                - id: console
                  port: 9090
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Go to MinIO Console
                  content: ${MINIO_CONSOLE_URL}
                - title: MinIO Username
                  content: ${MINIO_USERNAME}
                - title: MinIO Password
                  content: ${MINIO_PASSWORD}
            env:
                MINIO_BROWSER_REDIRECT:
                    default: "false"
                MINIO_CONSOLE_URL:
                    default: ${ZEABUR_CONSOLE_URL}
                    expose: true
                MINIO_DEFAULT_BUCKET:
                    default: dify
                MINIO_PASSWORD:
                    default: ${MINIO_ROOT_PASSWORD}
                    expose: true
                MINIO_ROOT_PASSWORD:
                    default: ${PASSWORD}
                MINIO_ROOT_USER:
                    default: minio
                MINIO_USERNAME:
                    default: ${MINIO_ROOT_USER}
                    expose: true
        - name: api
          icon: https://cdn.zeabur.com/dify-icon.png
          template: PREBUILT
          spec:
            source:
                image: langgenius/dify-api:1.9.0
            ports:
                - id: api
                  port: 5001
                  type: HTTP
            volumes:
                - id: data
                  dir: /app/api/storage
            env:
                API_SECRET_KEY:
                    default: ${PASSWORD}
                    expose: true
                APP_WEB_URL:
                    default: ${DIFY_GATEWAY_URL}
                CELERY_BROKER_URL:
                    default: redis://:${REDIS_PASSWORD}@redis:6379/1
                CODE_EXECUTION_API_KEY:
                    default: dify-sandbox
                CODE_EXECUTION_ENDPOINT:
                    default: http://sandbox:8194
                CODE_MAX_NUMBER:
                    default: "9223372036854775807"
                CODE_MAX_NUMBER_ARRAY_LENGTH:
                    default: "1000"
                CODE_MAX_OBJECT_ARRAY_LENGTH:
                    default: "30"
                CODE_MAX_STRING_ARRAY_LENGTH:
                    default: "30"
                CODE_MAX_STRING_LENGTH:
                    default: "80000"
                CODE_MIN_NUMBER:
                    default: "-9223372036854775808"
                CONSOLE_API_URL:
                    default: ${DIFY_GATEWAY_URL}
                CONSOLE_WEB_URL:
                    default: ${DIFY_GATEWAY_URL}
                DB_DATABASE:
                    default: ${POSTGRES_DATABASE}
                DB_HOST:
                    default: ${POSTGRES_HOST}
                DB_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                DB_PORT:
                    default: ${POSTGRES_PORT}
                DB_USERNAME:
                    default: ${POSTGRES_USERNAME}
                MIGRATION_ENABLED:
                    default: "true"
                MODE:
                    default: api
                REDIS_DB:
                    default: "0"
                REDIS_USE_SSL:
                    default: "false"
                REDIS_USERNAME:
                    default: ""
                S3_ACCESS_KEY:
                    default: ${MINIO_USERNAME}
                S3_BUCKET_NAME:
                    default: dify
                S3_ENDPOINT:
                    default: http://minio.zeabur.internal:9000
                S3_REGION:
                    default: us-east-1
                S3_SECRET_KEY:
                    default: ${MINIO_PASSWORD}
                SECRET_KEY:
                    default: ${API_SECRET_KEY}
                SERVICE_API_URL:
                    default: ${DIFY_GATEWAY_URL}
                STORAGE_TYPE:
                    default: s3
                TEMPLATE_TRANSFORM_MAX_LENGTH:
                    default: "80000"
                VECTOR_STORE:
                    default: weaviate
                WEAVIATE_API_KEY:
                    default: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
                WEAVIATE_ENDPOINT:
                    default: http://weaviate:8080
        - name: worker
          icon: https://cdn.zeabur.com/dify-icon.png
          template: PREBUILT
          spec:
            source:
                image: langgenius/dify-api:1.9.0
            env:
                APP_WEB_URL:
                    default: ${DIFY_GATEWAY_URL}
                CELERY_BROKER_URL:
                    default: redis://:${REDIS_PASSWORD}@redis:6379/1
                CODE_EXECUTION_API_KEY:
                    default: dify-sandbox
                CODE_EXECUTION_ENDPOINT:
                    default: http://sandbox:8194
                CODE_MAX_NUMBER:
                    default: "9223372036854775807"
                CODE_MAX_NUMBER_ARRAY_LENGTH:
                    default: "1000"
                CODE_MAX_OBJECT_ARRAY_LENGTH:
                    default: "30"
                CODE_MAX_STRING_ARRAY_LENGTH:
                    default: "30"
                CODE_MAX_STRING_LENGTH:
                    default: "80000"
                CODE_MIN_NUMBER:
                    default: "-9223372036854775808"
                CONSOLE_API_URL:
                    default: ${DIFY_GATEWAY_URL}
                CONSOLE_WEB_URL:
                    default: ${DIFY_GATEWAY_URL}
                DB_DATABASE:
                    default: ${POSTGRES_DATABASE}
                DB_HOST:
                    default: ${POSTGRES_HOST}
                DB_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                DB_PORT:
                    default: ${POSTGRES_PORT}
                DB_USERNAME:
                    default: ${POSTGRES_USERNAME}
                LOG_LEVEL:
                    default: INFO
                MIGRATION_ENABLED:
                    default: "true"
                MODE:
                    default: worker
                REDIS_DB:
                    default: "0"
                REDIS_USE_SSL:
                    default: "false"
                REDIS_USERNAME:
                    default: ""
                S3_ACCESS_KEY:
                    default: ${MINIO_USERNAME}
                S3_BUCKET_NAME:
                    default: dify
                S3_ENDPOINT:
                    default: http://minio.zeabur.internal:9000
                S3_REGION:
                    default: us-east-1
                S3_SECRET_KEY:
                    default: ${MINIO_PASSWORD}
                SECRET_KEY:
                    default: ${API_SECRET_KEY}
                STORAGE_TYPE:
                    default: s3
                TEMPLATE_TRANSFORM_MAX_LENGTH:
                    default: "80000"
                VECTOR_STORE:
                    default: weaviate
                WEAVIATE_API_KEY:
                    default: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
                WEAVIATE_ENDPOINT:
                    default: http://weaviate:8080
        - name: web
          icon: https://cdn.zeabur.com/dify-icon.png
          template: PREBUILT
          spec:
            source:
                image: langgenius/dify-web:1.9.0
            ports:
                - id: web
                  port: 3000
                  type: HTTP
            env:
                APP_API_URL:
                    default: ${DIFY_GATEWAY_URL}
                CONSOLE_API_URL:
                    default: ${DIFY_GATEWAY_URL}
        - name: weaviate
          icon: https://avatars.githubusercontent.com/u/37794290
          template: PREBUILT
          spec:
            source:
                image: semitechnologies/weaviate:1.26.3
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: data
                  dir: /var/lib/weaviate
            env:
                AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED:
                    default: "false"
                AUTHENTICATION_APIKEY_ALLOWED_KEYS:
                    default: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
                AUTHENTICATION_APIKEY_ENABLED:
                    default: "true"
                AUTHENTICATION_APIKEY_USERS:
                    default: hello@dify.ai
                AUTHORIZATION_ADMINLIST_ENABLED:
                    default: "true"
                AUTHORIZATION_ADMINLIST_USERS:
                    default: hello@dify.ai
                CLUSTER_HOSTNAME:
                    default: node1
                DEFAULT_VECTORIZER_MODULE:
                    default: none
                ENABLE_MODULES:
                    default: text2vec-cohere,text2vec-huggingface,text2vec-palm,text2vec-openai,generative-openai,generative-cohere,generative-palm,ref2vec-centroid,reranker-cohere,qna-openai
                PERSISTENCE_DATA_PATH:
                    default: /var/lib/weaviate
                QUERY_DEFAULTS_LIMIT:
                    default: "25"
        - name: sandbox
          icon: https://cdn.zeabur.com/dify-icon.png
          template: PREBUILT
          spec:
            source:
                image: langgenius/dify-sandbox:latest
            ports:
                - id: web
                  port: 8194
                  type: HTTP
            env:
                API_KEY:
                    default: dify-sandbox
                ENABLE_NETWORK:
                    default: "true"
                GIN_MODE:
                    default: release
                SANDBOX_PORT:
                    default: "8194"
                WORKER_TIMEOUT:
                    default: "15"
localization:
    ja-JP:
        description: Difyは、オープンソースの大規模言語モデル（LLM）アプリケーション開発プラットフォームです。
        readme: |-
            DifyはオープンソースのLLMアプリ開発プラットフォームです。その直感的なインターフェースは、AIワークフロー、RAGパイプライン、エージェント機能、モデル管理、可観測性機能などを組み合わせており、プロトタイプから本番環境への移行を迅速に行うことができます。

            ## 機能

            1. **ワークフロー**：視覚的なキャンバス上で強力なAIワークフローを構築し、テストします。以下のすべての機能およびそれ以上を活用します。
            2. **包括的なモデルサポート**：数十の推論プロバイダーおよび自己ホスト型ソリューションから、数百の専有/オープンソースLLMとシームレスに統合されており、GPT、Mistral、Llama3、そしてOpenAI API互換のモデルをすべてカバーしています。サポートされているモデルプロバイダーの完全なリストは[モデルプロバイダーセクション](https://docs.dify.ai/getting-started/readme/model-providers)で見つけることができます。
            3. **プロンプトIDE**：プロンプトの作成、モデルの性能比較、そしてチャットベースのアプリに音声合成などの追加機能を加えるための直感的なインターフェースです。
            4. **RAGパイプライン**：ドキュメントの取り込みから検索までをカバーする広範なRAG機能を備えており、PDF、PPT、およびその他の一般的なドキュメント形式からのテキスト抽出をサポートします。
            5. **エージェント機能**：LLM関数呼び出しまたはReActに基づいてエージェントを定義し、エージェントにプリビルドまたはカスタムツールを追加できます。Difyは、Google検索、DELL·E、Stable Diffusion、WolframAlphaなど、AIエージェント向けに50以上の組み込みツールを提供しています。
            6. **LLMOps**：アプリケーションのログと性能を時間の経過とともに監視し、分析します。プロダクションデータと注釈に基づいてプロンプト、データセット、モデルを継続的に改善することができます。
            7. **バックエンド・アズ・ア・サービス**：Difyのすべての製品には対応するAPIが付属しており、Difyをビジネスロジックに簡単に統合できます。

            ## デプロイ

            Difyをデプロイするには、右上の「デプロイ」ボタンをクリックし、必要なドメイン名を入力してください。デプロイ後、`https://<your-domain>.zeabur.app`でDifyアプリにアクセスできます。

            ## アプリの構造

            - Redis、PostgreSQL、MINIO、Webaviateがデータストレージとキャッシングに使用されます。
            - `api`、`worker`、`web`、`sandbox`はDifyのマイクロサービスです。
            - `nginx`はDifyのゲートウェイです。マイクロサービスを単一のホストに統合します。言い換えれば、**それがDifyアプリのエントリーポイントです。**

            ## 設定

            環境変数の設定については、<https://docs.dify.ai/getting-started/install-self-hosted/environments> を参照してください。これらの変数は主に `api` サービスで設定されます。

            ### アップロードファイルサイズの制限

            デフォルトのアップロードファイルサイズ制限は15 MBです。この制限は、`nginx` サービスの `/etc/nginx/nginx.conf` 設定ファイル内の `client_max_body_size` ディレクティブを変更することで調整できます。値は単位付きの文字列で指定する必要があります（例：`15M` は15 MBを表します）。

            また、`api` サービスの環境で `UPLOAD_FILE_SIZE_LIMIT` 変数を設定し、上記の設定と一致させる必要があるかもしれません。この値が `/etc/nginx/nginx.conf` の設定にある `client_max_body_size` ディレクティブと同じであることを確認してください（例：`15M` は15 MBを表します）。
    zh-CN:
        description: Dify 是一个开源的大型语言模型(LLM)应用开发平台。
        readme: |-
            Dify 是一个开源的 LLM 应用开发平台。它的直观界面结合了 AI 工作流、RAG 流水线、代理功能、模型管理、可观察性特征等，使您能够快速从原型开发到生产。

            ## 功能

            1. **工作流**：在可视化画布上构建和测试强大的 AI 工作流，利用以下所有功能及更多功能。
            2. **全面的模型支持**：与数十家推理提供商和自托管解决方案的数百个专有/开源 LLM 无缝集成，涵盖 GPT、Mistral、Llama3 和任何兼容 OpenAI API 的模型。支持的模型提供商的完整列表可以在 [模型提供商部分](https://docs.dify.ai/getting-started/readme/model-providers) 中找到。
            3. **提示 IDE**：用于设计提示、比较模型性能并为基于聊天的应用程序添加其他功能（如文本转语音）的直观界面。
            4. **RAG 流水线**：广泛的 RAG 功能，涵盖从文档摄取到检索的所有内容，开箱即用支持从 PDF、PPT 和其他常见文档格式中提取文本。
            5. **代理功能**：您可以基于 LLM 函数调用或 ReAct 定义代理，并为代理添加预构建或自定义工具。Dify 为 AI 代理提供了 50 多种内置工具，例如 Google Search、DELL·E、Stable Diffusion 和 WolframAlpha。
            6. **LLMOps**：监控和分析应用程序日志和性能随时间的变化。您可以根据生产数据和注释不断改进提示、数据集和模型。
            7. **后端即服务**：Dify 的所有产品都附带相应的 API，因此您可以轻松地将 Dify 集成到您自己的业务逻辑中。

            ## 部署

            要部署 Dify，请点击右上角的“部署”按钮，并填写所需的域名。部署后，您可以在 `https://<your-domain>.zeabur.app` 访问您的 Dify 应用。

            ## 应用结构

            - Redis、PostgreSQL、MINIO 和 Webaviate 用于数据存储和缓存。
            - `api`、`worker`、`web` 和 `sandbox` 是 Dify 的微服务。
            - `nginx` 是 Dify 的网关。它将微服务集成到一个主机上。换句话说，**它是您的 Dify 应用的入口点。**

            ## 配置

            请参考 <https://docs.dify.ai/getting-started/install-self-hosted/environments> 了解可配置的环境变量，这些变量主要在 `api` 服务中设置。

            ### 上传文件大小限制

            默认的上传文件大小限制为 15 MB。你可以通过修改 `nginx` 服务中的 `/etc/nginx/nginx.conf` 配置文件里的 `client_max_body_size` 指令来调整这个限制。数值应为带有单位的字符串（例如：`15M` 表示 15 MB）。

            另外，你可能需要在 `api` 服务的环境中设置 `UPLOAD_FILE_SIZE_LIMIT` 变量，使其与上述配置保持一致。请确保这个数值与 `/etc/nginx/nginx.conf` 配置中的 `client_max_body_size` 指令相同（例如：`15M` 表示 15 MB）。
    zh-TW:
        description: Dify 是一個開源的大型語言模型(LLM)應用開發平台。
        readme: |-
            Dify 是一個開源的 LLM 應用程式開發平台。它的直觀介面結合了 AI 工作流程、RAG 流水線、代理功能、模型管理、可觀察性特徵等，使您能夠快速從原型開發到生產。

            ## 功能

            1. **工作流程**：在可視化畫布上建構和測試強大的 AI 工作流程，利用以下所有功能及更多功能。
            2. **全面的模型支援**：與數十家推理提供商和自託管解決方案的數百個專有/開源 LLM 無縫整合，涵蓋 GPT、Mistral、Llama3 和任何相容 OpenAI API 的模型。支援的模型提供商的完整列表可以在 [模型提供商部分](https://docs.dify.ai/getting-started/readme/model-providers) 中找到。
            3. **提示 IDE**：用於設計提示、比較模型效能並為基於聊天的應用程式加入其他功能（如文字轉語音）的直觀介面。
            4. **RAG 流水線**：廣泛的 RAG 功能，涵蓋從文件攝取到檢索的所有內容，開箱即用支援從 PDF、PPT 和其他常見檔案格式中提取文字。
            5. **代理功能**：您可以基於 LLM 函數呼叫或 ReAct 定義代理，並為代理加入預建構或自訂工具。Dify 為 AI 代理提供了 50 多種內建工具，例如 Google Search、DELL·E、Stable Diffusion 和 WolframAlpha。
            6. **LLMOps**：監控和分析應用程式日誌和效能隨時間的變化。您可以根據生產資料和註釋不斷改進提示、資料集和模型。
            7. **後端即服務**：Dify 的所有產品都附帶相應的 API，因此您可以輕鬆地將 Dify 整合到您自己的業務邏輯中。

            ## 部署

            要部署 Dify，請點擊右上角的「部署」按鈕，並填寫所需的域名。部署後，您可以在 `https://<your-domain>.zeabur.app` 存取您的 Dify 應用程式。

            ## 應用程式結構

            - Redis、PostgreSQL、MINIO 和 Webaviate 用於資料儲存和快取。
            - `api`、`worker`、`web` 和 `sandbox` 是 Dify 的微服務。
            - `nginx` 是 Dify 的閘道。它將微服務整合到一個主機上。換句話說，**它是您的 Dify 應用程式的入口點。**

            ## 設定

            請參考 <https://docs.dify.ai/getting-started/install-self-hosted/environments> 了解可設定的變數，這些變數主要設定在 `api` 服務當中。

            ### 上傳檔案大小限制

            預設的上傳檔案大小限制為 15 MB。你可以透過修改 `nginx` 服務中的 `/etc/nginx/nginx.conf` 設定檔裡的 `client_max_body_size` 指令來調整這個限制。數值應為帶有單位的字串（例如：`15M` 代表 15 MB）。

            此外，你可能需要在 `api` 服務的環境中設定 `UPLOAD_FILE_SIZE_LIMIT` 變數，使其與上述設定相符。請確保這個數值與 `/etc/nginx/nginx.conf` 設定中的 `client_max_body_size` 指令相同（例如：`15M` 代表 15 MB）。
