All posts
AI Tools 13 min read March 23, 2026

Dify: From LLM Prototype to Production in One Platform

A hands-on guide to Dify — the open-source LLM platform with visual workflows, RAG pipelines, and built-in observability. Setup via Docker, key features, and honest review.

#Dify#LLM#RAG#Visual Workflow#Open Source#AI Platform
Neel Shah Tech Lead · Senior Data Engineer · Ottawa

Most LLM projects die in the gap between “it works in a notebook” and “it works for real users.”

The notebook proves the idea. But turning that idea into something your team can use, something with a proper UI, proper access controls, proper logging, and proper ways to update the prompt without touching code — that is where most projects stall.

Dify closes that gap. It is an open-source platform where you build LLM applications visually, connect RAG pipelines, manage your prompts, and deploy to users — all in one place. 134,000 GitHub stars. 1 million Discord members. Available as a cloud service or fully self-hosted.

This guide walks through setup, the five features that make it different, and an honest look at where it falls short.


Before We Start: What You Need

Dify runs as a Docker Compose stack. The minimum requirements are light enough for a developer laptop.

Minimum requirements (self-hosted)
─────────────────────────────────────────
  CPU      2 cores
  RAM      4 GB
  Disk     20 GB free
  Docker   20.10.0 or later
  OS       Linux, macOS, or Windows (WSL2)

For production deployments with real users and large knowledge bases, plan for at least 8 GB RAM and 100 GB disk.

Alternatively, use Dify Cloud at cloud.dify.ai — there is a free plan that does not require any local setup. For this guide, we will cover the self-hosted path since that is where you have full control.


What Dify Actually Is

Before installing, it helps to see where Dify sits compared to other tools in this space.

LLM tooling landscape
──────────────────────────────────────────────────────────
  Code-first frameworks   LangChain, LlamaIndex
  (Python libraries)      You write the logic in code

  Visual + code hybrid    Langflow, Flowise
  (drag-and-drop)         Build visually, export to code

  Full platform           Dify  ←── this guide
  (prototype to prod)     Build, deploy, manage, monitor
                          in one place

  Cloud-only platforms    OpenAI Assistants, Google Vertex AI
  (managed service)       No self-hosting option
──────────────────────────────────────────────────────────

Dify’s position is unique: it is not just a visual builder. It is a complete platform that covers the full lifecycle — build, deploy, monitor, iterate — without switching tools.


Installation

Step 1 — Clone the repository

git clone https://github.com/langgenius/dify.git
cd dify/docker

Step 2 — Create the environment file

cp .env.example .env

Open .env and set a strong secret key:

SECRET_KEY=your-very-long-random-string-here

For everything else, the defaults work fine to start.

Step 3 — Start the stack

docker compose up -d

This pulls and starts about 10 containers. On first run, expect 5–10 minutes for all images to download.

Monitor the startup:

docker compose logs -f api

Wait until you see:

INFO:     Application startup complete.

Step 4 — Open Dify

Navigate to http://localhost in your browser.

The first time, you will be prompted to create an admin account. Do that, and you are in.

Step 5 — Add a model provider

Before building anything, connect at least one LLM. Go to Settings → Model Provider.

Supported providers include:

Commercial:  OpenAI, Anthropic, Cohere, Google Gemini, Azure OpenAI
Self-hosted: Ollama, LM Studio, LocalAI, xinference

For a local Ollama setup:

  • Provider: Ollama
  • Base URL: http://host.docker.internal:11434

On Linux, host.docker.internal is available in Docker 20.10+. On older versions, use the Docker bridge IP: run ip route show | grep docker to find it.


Your First Application: Step by Step

Let us build a simple chatbot that answers questions about a document.

Step 1 — Create a knowledge base

Go to Knowledge → Create Knowledge. Upload a PDF or text file. Dify will process it — splitting into chunks, embedding, and storing in the vector database.

You can check the chunks under Recall Testing — type a test question and see which chunks would be retrieved.

Step 2 — Create an application

Go to Studio → Create App. Choose Chatbot as the application type.

In the prompt editor, set the system prompt:

You are a helpful assistant. Answer questions using only the provided context.
If the context does not contain the answer, say "I don't have that information."

Step 3 — Connect the knowledge base

In the Context panel on the right, click Add and select your knowledge base. Adjust the retrieval settings:

Top K:         3      (retrieve 3 chunks per question)
Score threshold: 0.5  (minimum similarity score)

Step 4 — Test in the playground

Use the built-in chat preview to test your application before publishing.

Step 5 — Publish and share

Click Publish. Dify generates:

  • A shareable web URL for direct user access
  • An API endpoint for integration into your own application
  • An embeddable widget for your website

The 5 Features That Make Dify Different

Feature 1: Visual Workflow Builder

Chatbots are fine for simple Q&A. For anything more complex — multi-step reasoning, conditional logic, parallel processing — Dify’s Workflow application type gives you a visual builder.

Example: Document analysis workflow
──────────────────────────────────────────────────────────
  [Start]


  [HTTP Request]  ← fetch document from URL


  [LLM Node]     ← "Extract all action items from this text"

     ├──── [If: action items found]
     │              │
     │              ▼
     │         [LLM Node]  ← "Format action items as a table"
     │              │
     │              ▼
     │         [End: return table]

     └──── [If: no action items]


               [End: return "No action items found"]
──────────────────────────────────────────────────────────

Nodes you can use in workflows:

Node TypeWhat it does
LLMCall any configured model with a prompt
Knowledge RetrievalQuery a knowledge base
HTTP RequestCall any external API
CodeRun Python or JavaScript
ConditionalBranch logic based on output
TemplateFormat text with variables
Document ExtractorParse files from previous steps
LoopIterate over a list

Workflows are exportable as JSON and can be triggered via API or webhook — so you can build the logic visually and integrate it into any backend.

Why this matters: Most LLM apps that go beyond simple chat need conditional logic and multi-step processing. Doing this in code means maintaining complex prompt orchestration. Doing it visually means you can see and change the logic without touching code.


Feature 2: RAG Pipeline With Retrieval Quality Controls

Dify’s document processing is not just “split and embed.” It gives you controls over how documents are chunked and retrieved.

Dify document processing pipeline
──────────────────────────────────────────────────────────
  Upload


  Pre-processing
  - Clean: remove headers, footers, page numbers
  - Segment: by paragraph, sentence, or fixed size
  - Deduplicate: remove repeated passages


  Indexing
  - Embedding model: choose from your configured providers
  - Index mode: high quality (vector) or economical (keyword)


  Retrieval
  - Mode: vector, full-text, or hybrid
  - Re-ranking: cross-encoder models to improve precision
  - TopK and score threshold: tunable per application
──────────────────────────────────────────────────────────

The Recall Testing page is especially useful. Before connecting a knowledge base to an application, you can type test questions and see:

  • Which chunks were retrieved
  • Their similarity scores
  • Whether the answer is actually in those chunks

This lets you diagnose retrieval problems before they affect users.

Why this matters: The most common failure mode in RAG applications is not the LLM — it is the retrieval. Dify gives you visibility into and control over the retrieval layer, which most platforms hide.


Feature 3: 50+ Built-in Tools

Dify ships with built-in integrations for common tools. In a workflow or agent, you can use these without writing any integration code.

Selected available tools:

Search:         Google Search, Bing, DuckDuckGo, Wikipedia
Image:          DALL·E 3, Stable Diffusion
Code execution: Python sandbox
Communication:  Slack, Gmail
Data:           WolframAlpha, Weather API
Storage:        Google Drive, Notion

Adding a tool to an agent:

Agent application → Tools → Add Tool → Google Search

The agent will now decide when to use the search tool based on the user’s question. You do not configure the decision logic — the LLM handles that.

For tools not in the list, Dify supports custom tools via OpenAPI spec — paste a Swagger/OpenAPI JSON and Dify imports the endpoints as callable tools.

Why this matters: Every tool you do not have to build and maintain yourself is time saved. Dify’s built-in tool library covers the most common integrations, and the OpenAPI import path covers the rest.


Feature 4: Built-in Observability

Dify integrates with three observability platforms out of the box:

Observability integrations
─────────────────────────────────────────────────────────
  Opik          LLM observability and evaluation
  Langfuse      Tracing, evals, prompt management
  Arize Phoenix MLOps observability for LLM applications
─────────────────────────────────────────────────────────

To enable, go to Monitoring in your application settings and connect your preferred platform.

Even without a third-party tool, Dify logs every conversation internally. You can see:

For each conversation:
  - Full message history
  - Which knowledge base chunks were retrieved
  - Latency for each step
  - Token usage
  - Model used
  - Timestamp

The Annotation feature lets you review real user conversations, mark answers as correct or incorrect, and add those examples as ground truth for future evaluation.

Why this matters: LLM applications degrade silently. Without observability, you do not know when the retrieval started returning worse results or when the model changed its behaviour. Dify’s monitoring catches this before users do.


Feature 5: Team Collaboration and Access Controls

Dify is built for teams, not just individual developers.

Workspace structure
──────────────────────────────────────────────────────────
  Workspace
  ├── Members
  │   ├── Owner       Full access, billing
  │   ├── Admin       Manage apps, members, integrations
  │   └── Member      Build and use applications

  ├── Applications
  │   ├── Chatbot 1   (owned by member A)
  │   ├── Workflow 2  (owned by member B)
  │   └── Agent 3     (shared)

  └── Knowledge Bases
      ├── Company Docs
      └── Product Manual
──────────────────────────────────────────────────────────

Enterprise features include:

  • SSO — integrate with your identity provider
  • Audit logs — track who changed what and when
  • Custom branding — white-label the interface
  • Air-gapped deployment — no external network calls required
  • Kubernetes deployment — Terraform configs for AWS, GCP, and Azure are included in the repo

Why this matters: Most open-source LLM tools are single-user by design. Dify is built for organisations where multiple people need to build, review, and iterate on LLM applications without stepping on each other.


Deployment Options at a Glance

Deployment option comparison
──────────────────────────────────────────────────────────
  Option          Cost        Control     Setup effort
  ──────────────────────────────────────────────────────
  Dify Cloud      Free tier   Low         None
  Docker Compose  Free        Full        30 min
  Kubernetes      Free        Full        1–2 days
  AWS (Terraform) Infra cost  Full        2–4 hours
  GCP (Terraform) Infra cost  Full        2–4 hours
  Azure (Terraform)Infra cost Full        2–4 hours
──────────────────────────────────────────────────────────

For most solo developers and small teams, Docker Compose on a single server is the right balance. For enterprise deployments needing high availability and scaling, use the Kubernetes path.


Troubleshooting

The api container keeps restarting

Usually a database initialisation issue on first start. Check the logs:

docker compose logs api | tail -50

Common fix — wait for the db container to be fully ready, then restart:

docker compose restart api

Ollama connection fails

From inside Docker, localhost points to the container. Use host.docker.internal:

# Test from inside the api container
docker exec -it docker-api-1 curl http://host.docker.internal:11434/api/tags

If that fails, find your Docker bridge IP:

ip route show | grep docker
# Use that IP as the Ollama base URL

Knowledge base indexing is very slow

The default embedding model makes API calls for every chunk. For faster local indexing, switch to a local embedding model via Ollama:

  • Go to Settings → Model Provider → Ollama
  • Add an embedding model (e.g. nomic-embed-text)
  • Go to your knowledge base settings and switch the embedding model

What Is Great, What Is Good, What Still Needs Work

What is great

Visual workflow builder. The ability to build complex multi-step LLM pipelines without writing orchestration code — and have them look like clear, readable flowcharts — is genuinely valuable. It is the right abstraction for most LLM workflows that go beyond simple chat.

Observability built in. Logging, conversation review, annotation, and third-party monitoring integrations are available out of the box. You do not have to add these yourself.

Huge model support. Dify connects to every major commercial and self-hosted LLM provider. Switching models is a setting, not a code change.

What is good

Cloud + self-hosted. You can start on Dify Cloud for free and migrate to self-hosted Docker Compose when you need full control. The same application format works in both.

Active community. 134,000 GitHub stars and 1 million Discord members means questions get answered, bugs get fixed, and integrations get added regularly.

What still needs work

Offline and air-gapped documentation. The docs assume internet access. Deploying in a restricted enterprise environment — where you cannot access external embedding APIs or update Docker images freely — is poorly documented.

Workflow debugging. When a workflow fails, the error messages are often generic. Tracing exactly which node failed and why, especially in complex conditional workflows, requires digging into logs rather than being surfaced clearly in the UI.

Mobile UI. Dify’s interface is built for desktop. The admin UI and built-in chat are not usable on mobile. If your users are on phones, you will need to build your own frontend using the API.


Summary

Dify earns its position in the LLM platform space by covering the complete application lifecycle — not just the prototype stage. The visual workflow builder, built-in RAG, observability, and team features are things you would spend weeks wiring together manually in a code-first framework.

The five features worth remembering:

FeatureWhy it matters
Visual workflow builderComplex multi-step pipelines without orchestration code
RAG with retrieval quality controlsDiagnose and tune retrieval before it affects users
50+ built-in toolsSearch, image generation, code execution, APIs — no integration code
Built-in observabilityMonitor, log, and evaluate every conversation
Team access controlsMulti-user workspaces with roles and SSO

To get started:

git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d

Then open http://localhost and create your first application.

The GitHub repo is at github.com/langgenius/dify. With 134,000 stars and an enterprise-grade feature set, it is one of the most complete open-source LLM platforms available.

Frequently asked questions

What is Dify: From LLM Prototype to Production in One Platform about?

A hands-on guide to Dify — the open-source LLM platform with visual workflows, RAG pipelines, and built-in observability. Setup via Docker, key features, and honest review.

Who should read this article?

This article is written for engineers, technical leads, and data teams working with Dify, LLM, RAG.

What can readers use from it?

Readers can use the article as a practical reference for ai tools decisions, implementation tradeoffs, and production engineering workflows.