BestLLMfor Your hardware. Your LLM. Your call.
◆ The kits◆ Kits APIOpen data Find my LLM
Guide · 2026-09-20

Dify, Self-Hosted: Building LLM Apps Without Writing the Plumbing

◆ AI at Work — Deploy local AI at work: privacy, compliance, costs · $24 · or all kits $49 →

Dify gives you a visual workflow builder, a knowledge base and an API on top of whatever model you point it at. Self-hosted with Ollama, the whole thing stays on your hardware. What it is, what it takes to run, and when it is overkill.

By Mohamed Meguedmi·Last updated 2026-09-20·11 min read·Tested on Windows, macOS, Linux

Key takeaways

  • Dify is a self-hostable platform for building LLM applications: a visual workflow editor, a built-in knowledge base for RAG, agent support, and a published API for each app you create.
  • It is model-agnostic. Connected to Ollama or any OpenAI-compatible endpoint, an entire deployment runs on your own hardware.
  • It replaces glue code, not the model. What you gain is the prompt versioning, the retrieval pipeline, the logs and the API you would otherwise write yourself.
  • It is a real deployment: a Docker Compose stack with a database, a vector store, a worker and a web front end. Budget several gigabytes of RAM for the platform alone, before the model.
  • The licence is open source with conditions around multi-tenant hosting and branding. Fine for internal use; read it before reselling anything built on it.

What Dify gives you

The AI at Work Kit

Deploy local AI at work: privacy, compliance, multi-user architecture, costs, the one-page memo for leadership.

  • Lifetime online access
  • PDF + files
  • 30-day refund

Everyone who builds a second LLM application writes the same scaffolding: a place to store prompts, a way to attach documents, a retrieval step, a conversation history, a log of what was asked and answered, and an HTTP endpoint the rest of the business can call. Dify is that scaffolding as a product, with a web interface in front of it.

Four things sit in the box:

  • Apps — chat assistants, text generators, agents and workflows, each published with its own API key and a shareable web page.
  • Workflow editor — a node graph where a request flows through retrieval, conditionals, model calls, code steps and tools.
  • Knowledge base — upload documents, choose chunking and an embedding model, and attach the resulting index to any app. This is RAG with the moving parts exposed but not left to you.
  • Observability — per-conversation logs, annotations and usage, which is what turns a demo into something you can debug.

Wiring it to a local model

Dify treats model providers as plugins, and Ollama is one of them. The configuration is short but has one recurring trap: inside Docker, localhost means the container, not your machine. The base URL must be the host address reachable from the container, and Ollama must be listening on the network interface rather than the loopback only — the Ollama service guide covers that setting.

You will configure two kinds of model, and forgetting the second is the usual reason a knowledge base returns nothing useful:

  1. A generation model — the chat model that writes answers.
  2. An embedding model — a separate, much smaller model that converts documents and questions into vectors. A chat model is not an embedding model; the knowledge base needs a real one.

For anything with multiple users or several workflow steps running at once, a server built for concurrency beats a desktop-oriented one. That is exactly the distinction drawn in Ollama vs vLLM in production.

What it costs to run

ComponentWhy it is thereRough footprint
API + workerApplication logic, background jobs, document indexing1–2 GB RAM
DatabaseApps, prompts, conversations, usersHundreds of MB, grows with logs
Vector storeDocument embeddings for the knowledge baseDepends on corpus size
Cache / queueSessions and job queueSmall
Web front end + proxyThe interface you useSmall
The modelServed separately by Ollama or vLLMThe real cost — see the VRAM calculator

The official minimum for the platform is modest on paper — a couple of CPU cores and a few gigabytes of RAM — but that is for the containers only. On a single machine that also hosts a 27B model, plan the memory for the model first and give Dify what is left; document indexing is spiky and will contend with inference.

Check the licence against your plan. Dify is open source under terms based on Apache 2.0 with added conditions, notably around offering it as a multi-tenant service and around removing its branding. Internal deployment is unambiguous; a commercial product built on top deserves five minutes with the actual text.

Dify, Flowise, Open WebUI or plain code

Your situationBest fit
You want a chat interface over local models, nothing moreOpen WebUI — see the GUI roundup
You want to build several internal apps with RAG and share them by APIDify
You want a lighter visual flow builderFlowise
You are shipping one application and own the codebaseWrite it against the model API directly — the Ollama API in Python is a short read
You need agent teams with rolesA multi-agent framework such as CrewAI

Pitfalls worth knowing before you start

  • No embedding model configured — the knowledge base indexes nothing useful and retrieval silently returns noise.
  • localhost inside the container — the single most common Ollama connection failure.
  • Context overflow — retrieved chunks plus system prompt plus history can exceed a local model's default window; raise it deliberately.
  • Upgrades are real upgrades — a Compose stack with a database means reading migration notes rather than pulling the latest tag blindly. Back up before you do.
  • It does not make a small model smarter — a good workflow around a 7B model still produces 7B answers.

Verdict

Dify is the right shape when several people need to build and run LLM applications on shared, private infrastructure and someone is willing to operate a Docker stack. It removes weeks of plumbing and gives non-developers a way to change a prompt without a deploy. For one person who wants to chat with local models, it is an order of magnitude more machinery than the job needs — install a front end instead, and come back to Dify when the second application appears.

Frequently asked questions

Is Dify free to self-host?

Yes, the self-hosted community edition is free and open source, under a licence based on Apache 2.0 with added conditions about multi-tenant service offerings and branding. There is also a paid cloud service; self-hosting does not require it.

Can Dify run fully offline with a local model?

Yes. Connect it to Ollama or another OpenAI-compatible local server, configure a local embedding model for the knowledge base, and no request leaves your network — provided your workflows do not include tools that call the internet.

Why can't Dify reach my Ollama?

Because localhost inside a container refers to the container. Use the address of the host as seen from Docker, and make sure Ollama listens on all interfaces rather than the loopback only.

Does Dify need a GPU?

Not for the platform itself, which is ordinary web application workload. The GPU is needed by whatever serves your model, which runs separately.

Dify or Flowise?

Dify is the heavier, more complete platform: user management, knowledge base, published APIs, logging. Flowise is lighter and closer to a pure flow builder. Choose Dify when several apps and several people are involved, Flowise for a quicker single-purpose build.

How much RAM does a Dify deployment need?

A few gigabytes for the containers themselves. The number that matters is the model's: on a single machine, size for the model first, then leave headroom for indexing, which competes with inference for memory and CPU.

Recommended hardware

A current option for local AI: GMKtec EVO-X2 64GB / 1TB (Ryzen AI Max+ 395). Match memory to your model and software. A mini PC is a complete PC alternative; Mac/MLX and CUDA instructions require compatible hardware.

Amazon Check GMKtec EVO-X2 64GB / 1TB (Ryzen AI Max+ 395) price →

As an Amazon Associate, BestLLMfor earns from qualifying purchases, at no extra cost to you. It does not influence our independent rankings.

Did this guide help?

Found an error or have feedback? Let us know — it helps everyone who reads this guide.