Dify
LangGenius
An open-source LLM application development platform, providing visual building and deployment capabilities.
Overview
Dify is an open-source LLM application development platform developed by the LangGenius team. It provides a visual application building interface, supporting workflow orchestration, Prompt management, RAG engine, Agent mode, and more. Dify's goal is to make AI application development simpler and more efficient, lowering the technical barrier. It supports private deployment, making it suitable for enterprises with data security requirements. Dify has received 50k+ stars on GitHub, making it one of the most popular LLM application platforms.
Installation
Dify is recommended to be deployed using Docker Compose to simplify the installation process. Docker 20+ and Docker Compose 2+ are required. Local development and cloud deployment are also supported.
# Clone the repository
git clone https://github.com/langgenius/dify.git
cd dify/docker
# Copy environment variables
cp .env.example .env
# Start the service
docker compose up -d
# Access http://localhost:3000
# Default account: admin / Dify123456Workflow
Dify's core feature is visual workflow orchestration. By dragging nodes, you can build complex AI processing flows. Node types include: LLM, knowledge retrieval, code execution, conditional branching, HTTP requests, and more. Workflows support debugging, version management, and API calls.
# Workflow example (via API call)
curl -X POST 'http://localhost/v1/workflows/run' \
-H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \
-d '{
"inputs": {"query": "Analyze this report"},
"response_mode": "streaming"
}'Prompt IDE
Dify provides a Prompt IDE, allowing users to visually edit and test prompts. It supports variable interpolation, few-shot examples, model comparison, and more. Multiple versions of prompts can be managed for A/B testing. Prompt IDE significantly improves the efficiency of prompt engineering.
RAG Engine
Dify has a built-in RAG engine, supporting document upload, automatic chunking, vector indexing, hybrid retrieval, and more. It supports multiple data sources: PDF, Word, web pages, APIs, and more. It provides a knowledge base management interface for easy maintenance and updating of knowledge.
# Upload documents to the knowledge base via API
curl -X POST 'http://localhost/v1/datasets/{dataset_id}/documents' \
-H 'Authorization: Bearer {api_key}' \
-F '[email protected]' \
-F 'data={"name":"Report","process_rule":{"mode":"automatic"}}'Agent Mode
Dify supports Agent mode, allowing AI to autonomously call tools to complete tasks. It supports agent types such as Function Calling and ReAct. Multiple tools can be configured: search, code execution, database queries, custom APIs, and more. Agent mode is suitable for complex task scenarios.
# Agent configuration example
{
"agent_mode": {
"enabled": true,
"strategy": "function_call",
"tools": [
{"name": "web_search", "config": {}},
{"name": "code_interpreter", "config": {}}
]
}
}API Access
Dify provides a RESTful API for each application, supporting operations such as chat, workflows, and knowledge base. The API is compatible with the OpenAI format and can be easily integrated into existing systems. It supports streaming responses, file uploads, session management, and more.
# Chat application API
curl -X POST 'http://localhost/v1/chat-messages' \
-H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \
-d '{
"inputs": {},
"query": "Hello",
"user": "user-123",
"response_mode": "streaming"
}'Plugins
Dify supports a plugin system to extend functionality. Plugins can add new tools, data sources, models, and more. The community provides a rich set of plugins, such as search engines, database connectors, third-party APIs, and more. Custom plugin development is also supported.
Deployment
Dify supports multiple deployment methods: Docker Compose (single machine), Kubernetes (cluster), cloud service (Dify Cloud). The enterprise edition provides high availability, SSO, audit logs, and other advanced features. When deploying, you need to consider the configuration of components such as databases, vector databases, and object storage.
# Kubernetes deployment
helm repo add dify https://dify-ai.github.io/dify-helm
helm install dify dify/dify \
--set global.image.tag=latest \
--set ingress.enabled=truePricing
Dify offers a free open-source version that can be self-deployed. Dify Cloud provides managed services with free and paid plans. The enterprise edition provides advanced features and support, with prices customized based on team size and needs. The open-source version already meets most needs, while the paid version mainly provides hosting and enterprise features.
Configuration
Dify is configured through its .env file and the web dashboard. The .env file sets the secret key, DB connection, and vector store; docker-compose.yml orchestrates the services. In the dashboard you add LLM providers (OpenAI, Anthropic, local models) and configure workflows, RAG knowledge bases, and agent tools.
# .env (dify/docker/.env)
SECRET_KEY=your-random-secret
DB_USERNAME=postgres
DB_PASSWORD=your-password
VECTOR_STORE=weaviate # or qdrant, milvus, pgvector
# Start the stack
cd dify/docker
cp .env.example .env
# edit .env, then:
docker compose up -d
# Access http://localhost:3000 (admin / Dify123456)
# In the dashboard:
# Settings -> Model Provider -> add OpenAI/Anthropic/local keys
# Knowledge -> create dataset -> upload docs -> pick chunking + embedding
# Workflow -> drag nodes (LLM, retrieval, code, HTTP) -> publish -> API keyFor production, change the default admin password and use an external Postgres + vector store.
FAQ
Common questions cover self-hosting, model providers, cost, Dify vs LangChain, and API access. Dify is a visual platform you self-host with Docker; LangChain is a code framework. Each Dify app gets an OpenAI-compatible REST API.
Q: Can I self-host Dify?
A: Yes—docker compose up for single-machine, or Helm/Kubernetes for
clusters. The open-source edition is free.
Q: Which LLM providers are supported?
A: OpenAI, Anthropic, Google, local Ollama, and many more via the
Model Provider settings.
Q: Dify vs LangChain?
A: Dify is a visual low-code platform (drag-and-drop workflows); LangChain
is a Python code framework. Dify suits non-developers and fast prototyping.
Q: Does each app get an API?
A: Yes—every chat/workflow app exposes a REST API compatible with the
OpenAI format, plus streaming and file uploads.
Q: Is there a free tier?
A: The open-source self-hosted edition is free; Dify Cloud has free and
paid plans; the enterprise edition adds SSO and audit logs.Change the default admin password (Dify123456) immediately after first launch.
More AI Guides
Claude Code
A terminal-native AI coding agent from Anthropic that autonomously understands codebases, edits files, runs commands, and completes multi-step development tasks.
OpenAI Codex
An official command-line AI coding assistant from OpenAI, built on the GPT model family and optimized for code generation and development workflows.
Trae
ByteDance's AI-native IDE—the first of its kind in China—deeply integrates LLMs such as Doubao and DeepSeek, supporting natural-language interaction and multimodal collaboration.
Cursor
A next-generation AI code editor from Anysphere with a built-in Composer agent that can run multiple coding tasks in parallel.
GitHub Copilot
An AI coding assistant co-developed by GitHub and OpenAI, offering code completion, chat, and an Agent mode.
Windsurf
An AI-native IDE from Codeium with a built-in Cascade agent that deeply couples the terminal and editor.