run_draft blocked on AppGenerateService.generate(streaming=False) and then
replayed every finished node-execution row through on_event, so the user
watched a spinner for the whole run and then saw every node light up at once.
It now consumes the streaming generator and fires on_event per frame.
Two things the plan assumed that turned out not to hold:
- The stream does NOT yield dicts. convert_stream_full_response yields dicts,
but that runs in the Celery worker; on our side
BaseAppGenerator.convert_to_event_stream (not overridden) re-wraps every
event as "data: {json}\n\n" and every keep-alive as "event: ping\n\n". An
isinstance(chunk, dict) guard would have dropped every frame. New
stream_chunk_as_mapping accepts both shapes and rejects keep-alives.
- The streaming workflow_paused frame carries workflow_run_id where the
blocking response carried id, so map_run_result would KeyError on it.
Adapted at the call site via run_result_data_from_terminal_chunk;
map_run_result's contract is unchanged for the fix/edit flows.
Session lifetime: _dispatch_generate is a plain function, so all of its
Session work is eager, and the generator it returns only reads a Redis
subscription while the run executes in a Celery worker with its own session.
The consumption loop therefore sits outside the `with` block rather than
pinning a DB connection for the length of a workflow run; a test pins this.
The node-execution read stays at the end -- map_run_result still needs those
rows for per_node[].outputs. Only the progress streams.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dify Cloud · Self-hosting · Documentation · Dify edition overview
Dify is an open-source LLM app development platform. Its intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features (including Opik, Langfuse, and Arize Phoenix) and more, letting you quickly go from prototype to production. Here's a list of the core features:
Quick start
Before installing Dify, make sure your machine meets the following minimum system requirements:
- CPU >= 2 Core
- RAM >= 4 GiB
The easiest way to start the Dify server is through Docker Compose. Before running Dify with the following commands, make sure that Docker and Docker Compose v2.24.0 or later are installed on your machine:
cd dify
cd docker
cp .env.example .env
docker compose up -d
After running, you can access the Dify dashboard in your browser at http://localhost/install and start the initialization process.
Seeking help
Please refer to our FAQ if you encounter problems setting up Dify. Reach out to the community and us if you are still having issues.
If you'd like to contribute to Dify or do additional development, refer to our guide to deploying from source code
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.
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: Autonomous agents with a sandbox of their own: they run commands, install software, and handle files to get open-ended tasks done. Describe the agent you want and it builds itself. Give it skills, connect tools from Dify Marketplace, MCP servers, or your own APIs, and put it to work as a chat app or as a step in any workflow.
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.
Using Dify
-
Cloud
We host a Dify Cloud service for anyone to try with zero setup. It provides all the capabilities of the self-deployed version, and includes 200 free GPT-4 calls in the sandbox plan. If you run into issues with Dify Cloud, contact our Cloud support team. -
Self-hosting Dify Community Edition
Quickly get Dify running in your environment with this starter guide. Use our documentation for further references and more in-depth instructions. -
Dify Enterprise
For organizations requiring self-hosting, SSO, RBAC Security and Enterprise Support SLAs, please fill out this form to speak to a solution representative.
Staying ahead
Star Dify on GitHub and be instantly notified of new releases.
Advanced Setup
For custom configuration, observability, and deployment options, see Advanced Setup.
Contributing
Dify welcomes contributions of all kinds:
- Code: Read the Contribution Guide, then browse good first issues.
- Ideas and feedback: Start or join a GitHub Discussion.
- Translations: Follow the internationalization guide to add or update a locale.
- Community: Share the apps you build, help other users, and spread the word about Dify.
Contributors
Community & contact
Choose the channel that best fits your question:
- GitHub Discussions: Get help, share feedback, and propose ideas.
- GitHub Issues: Report reproducible bugs and track engineering work. Read the Contribution Guide before opening one.
- Discord: Chat in real time, share your apps, and connect with other Dify users.
- (https://x.com/dify_ai): Follow Dify for release news and project updates.
Star History
Security disclosure
To protect your privacy, please avoid posting security issues on GitHub. Instead, report issues to security@dify.ai, and our team will respond with detailed answer.
License
This repository is licensed under the Dify Open Source License, based on Apache 2.0 with additional conditions.
