Dify

LLM app development platform

★ 55.1k  Docker Compose LLM AI RAG Chatbot

An open alternative to Dialogflow CX · Rasa · Midjourney

Homepage · Source code

Author: LangGenius, Inc · License: Apache-2.0 (with a twist)

Version: 0.14.0 · Updated

About

Dify is an open-source LLM app development platform. Its intuitive interface combines agentic AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.


Key features

1. Workflow: 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 here.

providers-v5

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, DALL·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.


Environment variables

View environment variables
PROJECT
  dify
DOMAIN
  localhost
CONSOLE_API_URL
 
CONSOLE_WEB_URL
 
SERVICE_API_URL
 
APP_API_URL
 
APP_WEB_URL
 
FILES_URL
 
LOG_LEVEL
  INFO
LOG_FILE
 
LOG_FILE_MAX_SIZE
  20
LOG_FILE_BACKUP_COUNT
  5
LOG_DATEFORMAT
  %Y-%m-%d %H:%M:%S
LOG_TZ
  UTC
DEBUG
  false
FLASK_DEBUG
  false
SECRET_KEY
  sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
INIT_PASSWORD
 
DEPLOY_ENV
  PRODUCTION
CHECK_UPDATE_URL
  https://updates.dify.ai
OPENAI_API_BASE
  https://api.openai.com/v1
MIGRATION_ENABLED
  true
FILES_ACCESS_TIMEOUT
  300
ACCESS_TOKEN_EXPIRE_MINUTES
  60
APP_MAX_ACTIVE_REQUESTS
  0
DIFY_BIND_ADDRESS
  0.0.0.0
DIFY_PORT
  5001
SERVER_WORKER_AMOUNT
 
SERVER_WORKER_CLASS
 
CELERY_WORKER_CLASS
 
GUNICORN_TIMEOUT
  360
CELERY_WORKER_AMOUNT
 
CELERY_AUTO_SCALE
  false
CELERY_MAX_WORKERS
 
CELERY_MIN_WORKERS
 
API_TOOL_DEFAULT_CONNECT_TIMEOUT
  10
API_TOOL_DEFAULT_READ_TIMEOUT
  60
DB_USERNAME
  postgres
DB_PASSWORD
  difyai123456
DB_HOST
  db
DB_PORT
  5432
DB_DATABASE
  dify
SQLALCHEMY_POOL_SIZE
  30
SQLALCHEMY_POOL_RECYCLE
  3600
SQLALCHEMY_ECHO
  false
POSTGRES_MAX_CONNECTIONS
  100
POSTGRES_SHARED_BUFFERS
  128MB
POSTGRES_WORK_MEM
  4MB
POSTGRES_MAINTENANCE_WORK_MEM
  64MB
POSTGRES_EFFECTIVE_CACHE_SIZE
  4096MB
REDIS_HOST
  redis
REDIS_PORT
  6379
REDIS_USERNAME
 
REDIS_PASSWORD
  difyai123456
REDIS_USE_SSL
  false
REDIS_USE_SENTINEL
  false
REDIS_SENTINELS
 
REDIS_SENTINEL_SERVICE_NAME
 
REDIS_SENTINEL_USERNAME
 
REDIS_SENTINEL_PASSWORD
 
REDIS_SENTINEL_SOCKET_TIMEOUT
  0.1
CELERY_BROKER_URL
  redis://:difyai123456@redis:6379/1
BROKER_USE_SSL
  false
CELERY_USE_SENTINEL
  false
CELERY_SENTINEL_MASTER_NAME
 
CELERY_SENTINEL_SOCKET_TIMEOUT
  0.1
WEB_API_CORS_ALLOW_ORIGINS
  *
CONSOLE_CORS_ALLOW_ORIGINS
  *
STORAGE_TYPE
  local
STORAGE_LOCAL_PATH
  storage
S3_USE_AWS_MANAGED_IAM
  false
S3_ENDPOINT
 
S3_REGION
  us-east-1
S3_BUCKET_NAME
  difyai
S3_ACCESS_KEY
 
S3_SECRET_KEY
 
AZURE_BLOB_ACCOUNT_NAME
  difyai
AZURE_BLOB_ACCOUNT_KEY
  difyai
AZURE_BLOB_CONTAINER_NAME
  difyai-container
AZURE_BLOB_ACCOUNT_URL
  https://<your_account_name>.blob.core.windows.net
GOOGLE_STORAGE_BUCKET_NAME
  your-bucket-name
GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64
  your-google-service-account-json-base64-string
ALIYUN_OSS_BUCKET_NAME
  your-bucket-name
ALIYUN_OSS_ACCESS_KEY
  your-access-key
ALIYUN_OSS_SECRET_KEY
  your-secret-key
ALIYUN_OSS_ENDPOINT
  https://oss-ap-southeast-1-internal.aliyuncs.com
ALIYUN_OSS_REGION
  ap-southeast-1
ALIYUN_OSS_AUTH_VERSION
  v4
ALIYUN_OSS_PATH
  your-path
TENCENT_COS_BUCKET_NAME
  your-bucket-name
TENCENT_COS_SECRET_KEY
  your-secret-key
TENCENT_COS_SECRET_ID
  your-secret-id
TENCENT_COS_REGION
  your-region
TENCENT_COS_SCHEME
  your-scheme
HUAWEI_OBS_BUCKET_NAME
  your-bucket-name
HUAWEI_OBS_SECRET_KEY
  your-secret-key
HUAWEI_OBS_ACCESS_KEY
  your-access-key
HUAWEI_OBS_SERVER
  your-server-url
VOLCENGINE_TOS_BUCKET_NAME
  your-bucket-name
VOLCENGINE_TOS_SECRET_KEY
  your-secret-key
VOLCENGINE_TOS_ACCESS_KEY
  your-access-key
VOLCENGINE_TOS_ENDPOINT
  your-server-url
VOLCENGINE_TOS_REGION
  your-region
BAIDU_OBS_BUCKET_NAME
  your-bucket-name
BAIDU_OBS_SECRET_KEY
  your-secret-key
BAIDU_OBS_ACCESS_KEY
  your-access-key
BAIDU_OBS_ENDPOINT
  your-server-url
SUPABASE_BUCKET_NAME
  your-bucket-name
SUPABASE_API_KEY
  your-access-key
SUPABASE_URL
  your-server-url
VECTOR_STORE
  weaviate
WEAVIATE_ENDPOINT
  http://weaviate:8080
WEAVIATE_API_KEY
  WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
QDRANT_URL
  http://qdrant:6333
QDRANT_API_KEY
  difyai123456
QDRANT_CLIENT_TIMEOUT
  20
QDRANT_GRPC_ENABLED
  false
QDRANT_GRPC_PORT
  6334
MILVUS_URI
  http://127.0.0.1:19530
MILVUS_TOKEN
 
MILVUS_USER
  root
MILVUS_PASSWORD
  Milvus
MYSCALE_HOST
  myscale
MYSCALE_PORT
  8123
MYSCALE_USER
  default
MYSCALE_PASSWORD
 
MYSCALE_DATABASE
  dify
MYSCALE_FTS_PARAMS
 
COUCHBASE_CONNECTION_STRING
  couchbase://couchbase-server
COUCHBASE_USER
  Administrator
COUCHBASE_PASSWORD
  password
COUCHBASE_BUCKET_NAME
  Embeddings
COUCHBASE_SCOPE_NAME
  _default
PGVECTOR_HOST
  pgvector
PGVECTOR_PORT
  5432
PGVECTOR_USER
  postgres
PGVECTOR_PASSWORD
  difyai123456
PGVECTOR_DATABASE
  dify
PGVECTOR_MIN_CONNECTION
  1
PGVECTOR_MAX_CONNECTION
  5
PGVECTO_RS_HOST
  pgvecto-rs
PGVECTO_RS_PORT
  5432
PGVECTO_RS_USER
  postgres
PGVECTO_RS_PASSWORD
  difyai123456
PGVECTO_RS_DATABASE
  dify
ANALYTICDB_KEY_ID
  your-ak
ANALYTICDB_KEY_SECRET
  your-sk
ANALYTICDB_REGION_ID
  cn-hangzhou
ANALYTICDB_INSTANCE_ID
  gp-ab123456
ANALYTICDB_ACCOUNT
  testaccount
ANALYTICDB_PASSWORD
  testpassword
ANALYTICDB_NAMESPACE
  dify
ANALYTICDB_NAMESPACE_PASSWORD
  difypassword
TIDB_VECTOR_HOST
  tidb
TIDB_VECTOR_PORT
  4000
TIDB_VECTOR_USER
  xxx.root
TIDB_VECTOR_PASSWORD
  xxxxxx
TIDB_VECTOR_DATABASE
  dify
TIDB_ON_QDRANT_URL
  http://127.0.0.1
TIDB_ON_QDRANT_API_KEY
  dify
TIDB_ON_QDRANT_CLIENT_TIMEOUT
  20
TIDB_ON_QDRANT_GRPC_ENABLED
  false
TIDB_ON_QDRANT_GRPC_PORT
  6334
TIDB_PUBLIC_KEY
  dify
TIDB_PRIVATE_KEY
  dify
TIDB_API_URL
  http://127.0.0.1
TIDB_IAM_API_URL
  http://127.0.0.1
TIDB_REGION
  regions/aws-us-east-1
TIDB_PROJECT_ID
  dify
TIDB_SPEND_LIMIT
  100
CHROMA_HOST
  127.0.0.1
CHROMA_PORT
  8000
CHROMA_TENANT
  default_tenant
CHROMA_DATABASE
  default_database
CHROMA_AUTH_PROVIDER
  chromadb.auth.token_authn.TokenAuthClientProvider
CHROMA_AUTH_CREDENTIALS
  xxxxxx
ORACLE_HOST
  oracle
ORACLE_PORT
  1521
ORACLE_USER
  dify
ORACLE_PASSWORD
  dify
ORACLE_DATABASE
  FREEPDB1
RELYT_HOST
  db
RELYT_PORT
  5432
RELYT_USER
  postgres
RELYT_PASSWORD
  difyai123456
RELYT_DATABASE
  postgres
OPENSEARCH_HOST
  opensearch
OPENSEARCH_PORT
  9200
OPENSEARCH_USER
  admin
OPENSEARCH_PASSWORD
  admin
OPENSEARCH_SECURE
  true
TENCENT_VECTOR_DB_URL
  http://127.0.0.1
TENCENT_VECTOR_DB_API_KEY
  dify
TENCENT_VECTOR_DB_TIMEOUT
  30
TENCENT_VECTOR_DB_USERNAME
  dify
TENCENT_VECTOR_DB_DATABASE
  dify
TENCENT_VECTOR_DB_SHARD
  1
TENCENT_VECTOR_DB_REPLICAS
  2
ELASTICSEARCH_HOST
  0.0.0.0
ELASTICSEARCH_PORT
  9200
ELASTICSEARCH_USERNAME
  elastic
ELASTICSEARCH_PASSWORD
  elastic
BAIDU_VECTOR_DB_ENDPOINT
  http://127.0.0.1:5287
BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS
  30000
BAIDU_VECTOR_DB_ACCOUNT
  root
BAIDU_VECTOR_DB_API_KEY
  dify
BAIDU_VECTOR_DB_DATABASE
  dify
BAIDU_VECTOR_DB_SHARD
  1
BAIDU_VECTOR_DB_REPLICAS
  3
VIKINGDB_ACCESS_KEY
  your-ak
VIKINGDB_SECRET_KEY
  your-sk
VIKINGDB_REGION
  cn-shanghai
VIKINGDB_HOST
  api-vikingdb.xxx.volces.com
VIKINGDB_SCHEMA
  http
VIKINGDB_CONNECTION_TIMEOUT
  30
VIKINGDB_SOCKET_TIMEOUT
  30
LINDORM_URL
  http://ld-***************-proxy-search-pub.lindorm.aliyuncs.com:30070
LINDORM_USERNAME
  username
LINDORM_PASSWORD
  password
OCEANBASE_VECTOR_HOST
  oceanbase
OCEANBASE_VECTOR_PORT
  2881
OCEANBASE_VECTOR_USER
  root@test
OCEANBASE_VECTOR_PASSWORD
  difyai123456
OCEANBASE_VECTOR_DATABASE
  test
OCEANBASE_MEMORY_LIMIT
  6G
UPLOAD_FILE_SIZE_LIMIT
  15
UPLOAD_FILE_BATCH_LIMIT
  5
ETL_TYPE
  dify
UNSTRUCTURED_API_URL
 
PROMPT_GENERATION_MAX_TOKENS
  512
CODE_GENERATION_MAX_TOKENS
  1024
MULTIMODAL_SEND_IMAGE_FORMAT
  base64
MULTIMODAL_SEND_VIDEO_FORMAT
  base64
UPLOAD_IMAGE_FILE_SIZE_LIMIT
  10
UPLOAD_VIDEO_FILE_SIZE_LIMIT
  100
UPLOAD_AUDIO_FILE_SIZE_LIMIT
  50
API_SENTRY_DSN
 
API_SENTRY_TRACES_SAMPLE_RATE
  1.0
API_SENTRY_PROFILES_SAMPLE_RATE
  1.0
WEB_SENTRY_DSN
 
NOTION_INTEGRATION_TYPE
  public
NOTION_CLIENT_SECRET
 
NOTION_CLIENT_ID
 
NOTION_INTERNAL_SECRET
 
MAIL_TYPE
  resend
MAIL_DEFAULT_SEND_FROM
 
RESEND_API_KEY
  your-resend-api-key
SMTP_SERVER
 
SMTP_PORT
  465
SMTP_USERNAME
 
SMTP_PASSWORD
 
SMTP_USE_TLS
  true
SMTP_OPPORTUNISTIC_TLS
  false
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH
  1000
INVITE_EXPIRY_HOURS
  72
RESET_PASSWORD_TOKEN_EXPIRY_MINUTES
  5
CODE_EXECUTION_ENDPOINT
  http://sandbox:8194
CODE_MAX_NUMBER
  9223372036854775807
CODE_MIN_NUMBER
  -9223372036854775808
CODE_MAX_DEPTH
  5
CODE_MAX_PRECISION
  20
CODE_MAX_STRING_LENGTH
  80000
TEMPLATE_TRANSFORM_MAX_LENGTH
  80000
CODE_MAX_STRING_ARRAY_LENGTH
  30
CODE_MAX_OBJECT_ARRAY_LENGTH
  30
CODE_MAX_NUMBER_ARRAY_LENGTH
  1000
WORKFLOW_MAX_EXECUTION_STEPS
  500
WORKFLOW_MAX_EXECUTION_TIME
  1200
WORKFLOW_CALL_MAX_DEPTH
  5
MAX_VARIABLE_SIZE
  204800
WORKFLOW_FILE_UPLOAD_LIMIT
  10
HTTP_REQUEST_NODE_MAX_BINARY_SIZE
  10485760
HTTP_REQUEST_NODE_MAX_TEXT_SIZE
  1048576
SSRF_PROXY_HTTP_URL
  http://ssrf_proxy:3128
SSRF_PROXY_HTTPS_URL
  http://ssrf_proxy:3128
TEXT_GENERATION_TIMEOUT_MS
  60000
PGUSER
  ${DB_USERNAME}
POSTGRES_PASSWORD
  ${DB_PASSWORD}
POSTGRES_DB
  ${DB_DATABASE}
PGDATA
  /var/lib/postgresql/data/pgdata
SANDBOX_API_KEY
  dify-sandbox
SANDBOX_GIN_MODE
  release
SANDBOX_WORKER_TIMEOUT
  15
SANDBOX_ENABLE_NETWORK
  true
SANDBOX_HTTP_PROXY
  http://ssrf_proxy:3128
SANDBOX_HTTPS_PROXY
  http://ssrf_proxy:3128
SANDBOX_PORT
  8194
WEAVIATE_PERSISTENCE_DATA_PATH
  /var/lib/weaviate
WEAVIATE_QUERY_DEFAULTS_LIMIT
  25
WEAVIATE_AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED
  true
WEAVIATE_DEFAULT_VECTORIZER_MODULE
  none
WEAVIATE_CLUSTER_HOSTNAME
  node1
WEAVIATE_AUTHENTICATION_APIKEY_ENABLED
  true
WEAVIATE_AUTHENTICATION_APIKEY_ALLOWED_KEYS
  WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
WEAVIATE_AUTHENTICATION_APIKEY_USERS
  hello@dify.ai
WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED
  true
WEAVIATE_AUTHORIZATION_ADMINLIST_USERS
  hello@dify.ai
CHROMA_SERVER_AUTHN_CREDENTIALS
  difyai123456
CHROMA_SERVER_AUTHN_PROVIDER
  chromadb.auth.token_authn.TokenAuthenticationServerProvider
CHROMA_IS_PERSISTENT
  TRUE
ORACLE_PWD
  Dify123456
ORACLE_CHARACTERSET
  AL32UTF8
ETCD_AUTO_COMPACTION_MODE
  revision
ETCD_AUTO_COMPACTION_RETENTION
  1000
ETCD_QUOTA_BACKEND_BYTES
  4294967296
ETCD_SNAPSHOT_COUNT
  50000
MINIO_ACCESS_KEY
  minioadmin
MINIO_SECRET_KEY
  minioadmin
ETCD_ENDPOINTS
  etcd:2379
MINIO_ADDRESS
  minio:9000
MILVUS_AUTHORIZATION_ENABLED
  true
PGVECTOR_PGUSER
  postgres
PGVECTOR_POSTGRES_PASSWORD
  difyai123456
PGVECTOR_POSTGRES_DB
  dify
PGVECTOR_PGDATA
  /var/lib/postgresql/data/pgdata
OPENSEARCH_DISCOVERY_TYPE
  single-node
OPENSEARCH_BOOTSTRAP_MEMORY_LOCK
  true
OPENSEARCH_JAVA_OPTS_MIN
  512m
OPENSEARCH_JAVA_OPTS_MAX
  1024m
OPENSEARCH_INITIAL_ADMIN_PASSWORD
  Qazwsxedc!@#123
OPENSEARCH_MEMLOCK_SOFT
  -1
OPENSEARCH_MEMLOCK_HARD
  -1
OPENSEARCH_NOFILE_SOFT
  65536
OPENSEARCH_NOFILE_HARD
  65536
NGINX_SERVER_NAME
  _
NGINX_HTTPS_ENABLED
  false
NGINX_PORT
  80
NGINX_SSL_PORT
  443
NGINX_SSL_CERT_FILENAME
  dify.crt
NGINX_SSL_CERT_KEY_FILENAME
  dify.key
NGINX_SSL_PROTOCOLS
  TLSv1.1 TLSv1.2 TLSv1.3
NGINX_WORKER_PROCESSES
  auto
NGINX_CLIENT_MAX_BODY_SIZE
  15M
NGINX_KEEPALIVE_TIMEOUT
  65
NGINX_PROXY_READ_TIMEOUT
  3600s
NGINX_PROXY_SEND_TIMEOUT
  3600s
NGINX_ENABLE_CERTBOT_CHALLENGE
  false
CERTBOT_EMAIL
  your_email@example.com
CERTBOT_DOMAIN
  your_domain.com
CERTBOT_OPTIONS
 
SSRF_HTTP_PORT
  3128
SSRF_COREDUMP_DIR
  /var/spool/squid
SSRF_REVERSE_PROXY_PORT
  8194
SSRF_SANDBOX_HOST
  sandbox
COMPOSE_PROFILES
  ${VECTOR_STORE:-weaviate}
EXPOSE_NGINX_PORT
 
EXPOSE_NGINX_SSL_PORT
 
POSITION_TOOL_PINS
 
POSITION_TOOL_INCLUDES
 
POSITION_TOOL_EXCLUDES
 
POSITION_PROVIDER_PINS
 
POSITION_PROVIDER_INCLUDES
 
POSITION_PROVIDER_EXCLUDES
 
CSP_WHITELIST
 
CREATE_TIDB_SERVICE_JOB_ENABLED
  false