Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dify

install

1

git clone --depth=1 https://github.com/langgenius/dify
cd dify/docker
cp .env.example .env

usage

sudo docker compose --env-file .env up -d

Create chatbot and knowledge bases

2

  1. Dify → <user> → Settings → Model Provider
  2. Ollama → Setup
    Model Name: llama3.1:8b
    Base URL: http://<your_host>:11434
    
  3. Ollama → Add Model
    Model Type: Text Embedding
    Model Name: mxbai-embed-large:latest
    Base URL: http://<host>:11434
    
    Model Type: Text Embedding
    Model Name: jina/jina-embeddings-v2-base-en
    Base URL: http://<host>:11434
    
  4. OpenAI → Setup
    API Key: <apikey>
    API base: https://api.openai.com
    
  5. OpenAI → Show Models
  6. Dify → Studio → Chatbot → Create from Blank
    APP icon & name: llama 3.1
    
  7. Studio → llama 3.1 → <model> CHAT → llama3.1:8b
  8. Dify → Knowledge → Create Knowledge → Upload files → Save & Process → Go to Documents
    Index mode: Economical
    
  9. Studio → llama 3.1 → Context → Add → <knowledge>

resource

cache

dify


  1. Deploy with Docker Compose

  2. 本地部署Dify基于Llama 3.1和OpenAI创建聊天机器人与知识库