Dify is an open-source platform (Apache 2.0) for building AI applications without code. With 50k+ GitHub stars, Dify is the leading no-code solution for LLM apps in 2026.
Installation
Docker (Recommended)
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker-compose up -d
Access: http://localhost/
Self-Hosted Requirements
- Server: 4GB RAM, 20GB disk
- Database: PostgreSQL 13+
- Cache: Redis 6+
- Vector DB: Optional (Weaviate, Qdrant, Milvus)
Core Components
1. Workflow Editor
Visual drag-and-drop LLM workflow builder:
Trigger
↓
Input Processing
↓
LLM Node
↓
Output Formatting
↓
API Response
Supports:
- LLM calls (OpenAI, Ollama, Azure, local)
- Tool calling (web search, database)
- Conditional logic
- Loops and parallel processing
2. RAG Integration
Built-in document search:
- Upload PDF/TXT/Web
- Auto-chunk and embed
- Vector search in LLM context
3. Agent Mode
Agent-based workflows with tool calling.
4. API Publishing
Publish as OpenAI-compatible REST API.
Practical Workflow
Create New App
- Dashboard → "Create New App"
- Choose "Blank App" or template
- Configure:
- Icon
- Name
- Description
- Open workflow editor
Configure LLM Node
├── Model: qwen2.5-7b
├── System Prompt: "You are helpful..."
├── Temperature: 0.7
├── Max Tokens: 500
└── Context: 4096
Format Output
LLM Output
↓
JSON Parser
↓
Template Formatter
↓
API Response
Dataset Management
Training data and context sources:
Upload Dataset
- Datasets section
- Create Dataset
- Upload CSV
- Auto-indexed for RAG
Example CSV
question,answer
What is AI?,Artificial Intelligence is...
Explain quantum computing,A quantum computer uses...
Use in RAG
Query
↓
Vector Search
↓
Top Results as Context
↓
LLM Response
API & Integration
REST API Example
curl -X POST http://localhost/api/workflows/run \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"workflow_id": "abc123", "inputs": {"message": "Hello"}}'
Python Integration
import requests
response = requests.post(
"http://localhost/api/workflows/run",
json={
"workflow_id": "abc123",
"inputs": {"query": "What is AI?"}
},
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(response.json()["output"])
Self-Hosting Checklist
1. Database
docker run -d --name postgres \
-e POSTGRES_PASSWORD=secure \
postgres:15
2. Redis
docker run -d --name redis \
redis:7
3. Environment
DATABASE_URL=postgresql://user:pw@postgres:5432/dify
REDIS_URL=redis://redis:6379
SECRET_KEY=your-secret-key
