dify
by langgenius
Visual workspace for building agentic workflows and RAG pipelines, self-hosted or in the cloud.
- Stars
- 161,856 stars
- Forks
- 26k forks
- Last push
- today
- Activity
- Active
# Prepare the Docker config$ cd docker
cp .env.example .env
openssl rand -hex 32# Start Dify$ docker compose up -dCommands from the project's README. Run them after installing (see below).
Overview
Understand dify in 60 seconds
- What it does
- Dify is a platform for building AI apps without starting from scratch. On one visual interface you get AI workflows, RAG pipelines for your documents, agents, model management and observability, and every app comes with an API you can call from your own software.
- The problem it solves
- Going from an AI prototype to a production app means wiring up models, document search, prompts, monitoring and APIs. Dify brings these together so teams can build, test and ship LLM apps faster.
- Why choose it
- Choose it for an all-in-one, self-hostable LLM app platform with visual workflows and APIs. Check the Dify Open Source License, which adds conditions to Apache 2.0.
- Who should use it
- Product teams building AI chat and workflow apps
- Developers who want a backend-as-a-service for LLM apps
- Companies building RAG on internal documents
- Non-developers prototyping AI apps visually
- Setup difficulty
You'll need:
- CPU with 2+ cores and 4 GiB+ RAM
- Docker with a running daemon and Docker Compose v2.35.0+
- OpenSSL
How dify works
Dify combines a workflow canvas, a prompt IDE, RAG pipelines with text extraction from PDFs, slides and other documents, autonomous agents with their own sandbox, and LLMOps monitoring. It supports hundreds of proprietary and open models from dozens of providers, including any OpenAI API-compatible model.
Every Dify app exposes APIs, so it works as a backend-as-a-service for your own products. Agents can run commands, install software and handle files in a sandbox, and can use tools from the Dify Marketplace.
You can use Dify Cloud, self-host the Community Edition with Docker Compose, or ask about Dify Enterprise for SSO, RBAC and support SLAs. Self-hosting needs a generated auth token in the .env file before the first start.
Features
Key features
Visual workflows
Build and test AI workflows on a canvas.
Hundreds of models
Proprietary, open-source and OpenAI-compatible models.
Prompt IDE
Craft prompts and compare models.
RAG pipeline
Ingest and retrieve PDFs, slides and more.
Agents with sandboxes
Agents that run commands and handle files.
APIs for everything
Use Dify as a backend-as-a-service.
Strengths
- All-in-one LLM app platform
- Self-hostable with Docker Compose
- Large model provider support
- Very active project
Limitations
- Dify Open Source License adds conditions to Apache 2.0
- Self-hosting runs several services
- Enterprise features like SSO need Dify Enterprise
Practical use cases
Internal knowledge chatbot
Answer questions from company documents.
AI workflows
Chain model calls, tools and logic visually.
AI backend for products
Call Dify apps through their APIs.
Installation
Install dify
Commands come from Dify's README. AIRepoHub hasn't run them yet. View source
Prerequisites
- Docker and Docker Compose v2.35.0+
- OpenSSL
Supported systems
- Windows
- macOS
- Linux
- 1
Clone the repository
Shellgit clone https://github.com/langgenius/dify.gitcd dify - 2
Create your environment file and a token
Shellcd dockercp .env.example .envopenssl rand -hex 32 - 3
Set the sandbox token
Open .env and set DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN to the generated value. Keep the default COMPOSE_PROFILES.
- 4
Start the services
Shelldocker compose up -ddocker compose ps --all
- 1
Sign up at cloud.dify.ai
Try Dify without managing a server; see the pricing page for plans.
Configuration and API keys
| Setting | What it's for |
|---|---|
DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKENRequired | Set in docker/.env to a value generated with openssl rand -hex 32. |
COMPOSE_PROFILESOptional | Keep the default to run the bundled services. |
First run
- 1
Complete the setup
Open http://localhost/install once the services are running.
dify's documentation doesn't include sample output, so we don't show any. Expect the results in your terminal.
Your first project
Self-host Dify and finish the first-time setup
Run the Community Edition locally with Docker Compose.
Before you start
- Docker with Compose v2.35.0+
- OpenSSL
- At least 2 CPU cores and 4 GiB RAM
- 1
Configure
Shellcd dockercp .env.example .envopenssl rand -hex 32 - 2
Add the token to .env
Set DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN to the generated value.
- 3
Start and check the services
Shelldocker compose up -ddocker compose ps --all - 4
Open http://localhost/install
Create the admin account to finish setup.
What to expect
All services run, the one-time init_permissions service exits with code 0, and Dify's setup page opens in your browser.
Next steps
- Add a model provider in settings
- Create a workflow or chatbot app
- See the Docker deployment guide for options
Costs and requirements
What it costs to run
- License
- Dify Open Source License, based on Apache 2.0 with additional conditions.Depends
- Self-hosted
- Free Community Edition; you pay for your servers.Free
- Dify Cloud
- Hosted plans; see dify.ai/pricing.Depends
- Model providers
- Billed by each provider you connect.Depends
Troubleshooting
Common setup issues
init_permissions shows as exited
That's expected; it should exit with code 0.
Upgrading an existing deployment
Keep your .env and follow the upgrade guidance in docker/README.md.
Other setup problems
Check the self-hosting FAQ at docs.dify.ai.
Alternatives
Similar AI repositories
MoneyPrinterTurbo
harry0703
Python app that uses AI models to generate short HD videos automatically from a topic or keyword.
VoiceStudio
debpalash
Local voice studio for voice cloning, dubbing, transcription and audiobook creation that runs on your own computer.
Scrapling
D4Vinci
Python web scraping framework for collecting data from websites, from single pages to full crawls.
last30days-skill
mvanhorn
AI agent skill that researches a topic across Reddit, X, YouTube and the web, then writes a summary.