
What Is Dify?
Dify is an open-source platform for developing applications powered by large language models. It combines visual AI workflows, retrieval-augmented generation, agent capabilities, model management, observability, and application APIs in one interface, helping teams move from prototypes to production.
You can use the hosted Dify Cloud service without installing anything, or deploy the Community Edition in your own environment. Enterprise-focused options are also available for organizations with additional requirements.
Key Features
- Visual workflows: Build and test AI workflows on a visual canvas.
- Broad model support: Connect to hundreds of proprietary and open-source models through inference providers or self-hosted solutions. Supported options include GPT, Mistral, Llama 3, and OpenAI API-compatible models.
- Prompt IDE: Craft prompts, compare model performance, and add capabilities such as text-to-speech to chat applications.
- RAG pipeline: Ingest and retrieve information from documents, with built-in text extraction support for PDFs, presentations, and other common formats.
- Agents and tools: Define agents using LLM Function Calling or ReAct. Dify includes more than 50 built-in tools, including Google Search, DALL·E, Stable Diffusion, and WolframAlpha, and also supports custom tools.
- LLMOps: Monitor application logs and performance, then improve prompts, datasets, and models using production data and annotations.
- Backend as a service: Integrate Dify applications into existing business logic through corresponding APIs.
- Observability integrations: Dify supports observability options including Opik, Langfuse, and Arize Phoenix.
Choose How to Run Dify
Dify Cloud
Dify Cloud is the quickest way to try the platform because it requires no local setup. According to the project README, its sandbox plan includes 200 free GPT-4 calls and provides the capabilities available in the self-deployed version.
Self-Hosted Community Edition
Self-hosting gives you control over the environment in which Dify runs. The simplest documented installation method uses Docker Compose.
Enterprise and Organization Use
Dify also offers enterprise-oriented features. Organizations can contact the Dify team to discuss their requirements and licensing options.
Install Dify with Docker Compose
Check the Requirements
Before starting, make sure the host machine meets these minimum requirements:
- CPU: At least 2 cores
- Memory: At least 4 GiB of RAM
- Docker: Installed and running
- Docker Compose: Version 2.24.0 or later
Use the official Docker installation guide if Docker is not already available.
Start the Services
From a checked-out copy of the Dify repository, enter the project and Docker directories, copy the example environment file, and start the services:
cd dify
cd docker
cp .env.example .env
docker compose up -dThe -d option starts the containers in detached mode, allowing them to continue running in the background.
Initialize the Dashboard
After the services have started, open the following address in a browser:
http://localhost/installFollow the initialization process displayed by the dashboard. If setup fails, consult the official self-hosting FAQ.
Developers who want to contribute or modify Dify should use the official source-code deployment guide rather than relying only on the Docker Compose quick start.
Basic Usage
1. Select a Model
Dify can integrate with models from many hosted inference providers and self-hosted solutions. Choose a provider and model appropriate for your application. Compatible options include GPT, Mistral, Llama 3, and models exposed through an OpenAI API-compatible interface. Consult the model provider list for currently supported integrations.
2. Build and Test a Workflow
Use the visual canvas to assemble and test the logic of an AI application. Workflows are useful when an application needs more than a single prompt, such as when input must be processed, sent to a model, enriched with retrieved information, or passed to tools.
- Define what the application should accept from the user.
- Use Dify's visual workflow interface to represent the AI process.
- Connect the workflow to an appropriate model.
- Test the behavior and review the generated results.
- Refine the workflow, prompts, datasets, or model selection as needed.
3. Develop Prompts in the Prompt IDE
Use the Prompt IDE to craft and test prompts through an interactive interface. You can compare model performance before deciding which model best fits the application. For chat-based applications, the IDE can also incorporate features such as text-to-speech.
4. Add Knowledge with RAG
Dify's RAG pipeline covers document ingestion and retrieval. A typical knowledge-based application can ingest supported files, including PDFs and presentations, extract their text, and retrieve relevant material when responding to a user.
For example, you can create an assistant that answers questions from internal documentation. Instead of relying only on a model's pre-existing knowledge, the application can retrieve relevant content from the ingested documents and use it when producing a response.
5. Create a Tool-Using Agent
For tasks that require actions or external services, define an agent using Function Calling or ReAct. Add built-in tools such as Google Search, DALL·E, Stable Diffusion, or WolframAlpha, or connect a custom tool supported by your application design.
One example is a research agent that uses search to gather information before generating a response. Another is a creative agent that invokes an image-generation tool when a user requests visual output.
6. Integrate the Application Through APIs
Dify's capabilities have corresponding APIs, allowing a completed application to serve as a backend for another product. Use this backend-as-a-service approach when your web application, internal tool, or other business system needs to invoke logic built in Dify. Refer to the official documentation for current integration instructions.
Monitoring and Continuous Improvement
Dify's LLMOps capabilities help you monitor application logs and performance over time. Production data and annotations can guide improvements to prompts, datasets, and model choices. This creates an iterative workflow in which you deploy an application, examine its behavior, and refine it based on observed results.
For additional observability, review Dify's integrations with Opik, Langfuse, and Arize Phoenix. Choose an integration according to the tracing, evaluation, and monitoring needs of your environment.
Advanced Setup Tips
Customize Environment Variables
The essential startup defaults are stored in docker/.env.example. The quick-start command copies these defaults to docker/.env, which is the file to edit for a custom deployment. Optional advanced variables are organized by theme under docker/envs/.
After changing the configuration, run the following command again from the docker directory:
docker compose up -dReview the environment variable documentation for the complete list of available settings.
Monitor Metrics with Grafana
A community-created Grafana dashboard can use Dify's PostgreSQL database as a data source. It provides monitoring at the level of applications, tenants, messages, and other metrics.
Deploy on Kubernetes
For highly available environments, the README lists community-contributed Helm charts and Kubernetes YAML files. Available options include:
- Dify Helm chart by LeoQuote
- Dify Helm chart by BorisPolonsky
- AI charts by magicsong
- Kubernetes YAML files by Winson-030
- Kubernetes files by wyy-holding
- YAML files supporting Dify v1.6.0 by Zhoneym
These deployment resources are community contributions, so review their documentation and compatibility before using them in production.
Use Cloud Infrastructure Tools
The project README also points to community deployment options for major cloud platforms:
- Terraform: Community projects are available for Azure Global and Google Cloud.
- AWS CDK: AWS samples provide EKS-based and ECS-based self-hosting options.
- Alibaba Cloud: Computing Nest and Data Management deployment options are listed.
- Azure Kubernetes Service: A community Azure DevOps Pipeline and Helm chart can deploy Dify to AKS.
Handle Security Reports Privately
Do not publish security vulnerabilities as GitHub issues. The project asks users to report them privately to security@dify.ai.
Getting Help and Contributing
Use GitHub Discussions for questions and feedback, and GitHub Issues for bugs and feature proposals. The Discord community is available for sharing applications and talking with other users.
If you want to contribute code, read the project's contribution guide. Translation contributors can consult the internationalization README.
Conclusion
Dify brings workflows, prompts, RAG, agents, model management, observability, and APIs into a unified LLM application platform. You can try it immediately through Dify Cloud or self-host the Community Edition with Docker Compose. Start with the default configuration, build and test a focused AI application, and then adopt monitoring or cloud deployment options as your requirements grow.
