{"id":30000,"date":"2025-03-04T11:27:39","date_gmt":"2025-03-04T03:27:39","guid":{"rendered":"https:\/\/www.1ai.net\/?p=30000"},"modified":"2025-03-04T11:30:09","modified_gmt":"2025-03-04T03:30:09","slug":"%e5%9c%a8%e4%bd%a0%e7%9a%84%e7%94%b5%e8%84%91%e4%b8%8a%e9%83%a8%e7%bd%b2deepseek%ef%bc%8c%e6%95%99%e4%bd%a0%e6%90%ad%e5%bb%badeepseek%e6%9c%ac%e5%9c%b0%e7%9f%a5%e8%af%86%e5%ba%93","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/30000.html","title":{"rendered":"Deploying DeepSeek on your computer teaches you to build a DeepSeek local knowledge base"},"content":{"rendered":"<p>For locally deployed<a href=\"https:\/\/www.1ai.net\/en\/tag\/deepseek\" title=\"[View articles tagged with [DeepSeek]]\" target=\"_blank\" >DeepSeek<\/a>,<a href=\"https:\/\/www.1ai.net\/en\/27856.html\/\">How to install and use DeepSeek R1 Big Model on your own computer?DeepSeek R1 Local Deployment Guide<\/a><\/p>\n<p>How do you make it more efficient with your answers? This is where a knowledge base comes into play. The program used in this article is<a href=\"https:\/\/www.1ai.net\/en\/tag\/ollama\" title=\"_Other Organiser\" target=\"_blank\" >Ollama<\/a>+Docker+Dify.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30001\" title=\"976ee82bj00sskx6e005td000u0009wm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/976ee82bj00sskx6e005td000u0009wm.jpg\" alt=\"976ee82bj00sskx6e005td000u0009wm\" width=\"1080\" height=\"356\" \/><\/p>\n<p>Note: First, make sure you have Git and Python installed, and that you have a \"good internet connection\".<\/p>\n<p>I. Install Ollama and Docker and download the big model.<\/p>\n<p>The methodology refers to the first and second parts of the following article: DeepSeek-R1 Local Deployment<\/p>\n<p>Second, the installation of Dify (Windows as an example)<\/p>\n<p>Before installing make sure that both Ollama and Docker are running, i.e. you can see the icons in the taskbar:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30002\" title=\"d16369cbj00sskx6c001rd00095005sm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/d16369cbj00sskx6c001rd00095005sm.jpg\" alt=\"d16369cbj00sskx6c001rd00095005sm\" width=\"329\" height=\"208\" \/><\/p>\n<p>Open the directory of the hard disk where you want to install Dify, click the right mouse button and select \"Open in Terminal\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30003\" title=\"6ba16946j00sskx6c000qd000ao00dim\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/6ba16946j00sskx6c000qd000ao00dim.jpg\" alt=\"6ba16946j00sskx6c000qd000ao00dim\" width=\"384\" height=\"486\" \/><\/p>\n<p>Then execute the following commands in sequence:<\/p>\n<p>i'm not sure if it's a good idea, right<\/p>\n<p>cd dify\/docker<\/p>\n<p>cp .env.example .env<\/p>\n<p>docker compose up -d<\/p>\n<p>When it's done, you'll see a prompt like this one, just wait for it to finish.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30004\" title=\"39c9ec05j00sskx6d001td000qt009km\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/39c9ec05j00sskx6d001td000qt009km.jpg\" alt=\"39c9ec05j00sskx6d001td000qt009km\" width=\"965\" height=\"344\" \/><\/p>\n<p>The following command can be run to see if the container is running properly:<\/p>\n<p>docker compose ps<\/p>\n<p>In the output, you should see the following services in the leftmost column: api, db, nginx, redis, sandbox, ssrf_proxy, weaviate, web, worker<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30005\" title=\"f50bffd2j00sskx6c001wd000u0004um\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/f50bffd2j00sskx6c001wd000u0004um.jpg\" alt=\"f50bffd2j00sskx6c001wd000u0004um\" width=\"1080\" height=\"174\" \/><\/p>\n<p>You can also open Docker's container bar and click on the red box to mark the part:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30006\" title=\"d5deb716j00sskx6f004id000u000jdm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/d5deb716j00sskx6f004id000u000jdm.jpg\" alt=\"d5deb716j00sskx6f004id000u000jdm\" width=\"1080\" height=\"697\" \/><\/p>\n<p>The same can be seen for the services mentioned above:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30007\" title=\"c7cd3bbej00sskx6f004md000u000l8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/c7cd3bbej00sskx6f004md000u000l8m.jpg\" alt=\"c7cd3bbej00sskx6f004md000u000l8m\" width=\"1080\" height=\"764\" \/><\/p>\n<p>Next setup setup administrator account, open the URL: http:\/\/localhost\/install, enter your email, username, password, confirm and log in:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30008\" title=\"df9700b6j00sskx6e001sd000ni00nxm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/df9700b6j00sskx6e001sd000ni00nxm.jpg\" alt=\"df9700b6j00sskx6e001sd000ni00nxm\" width=\"846\" height=\"861\" \/><\/p>\n<p>The installation was successful! In the future you can simply visit: http:\/\/localhost directly to open the main Dify page:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30009\" title=\"9e801da8j00sskx6e002id000u000c8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/9e801da8j00sskx6e002id000u000c8m.jpg\" alt=\"9e801da8j00sskx6e002id000u000c8m\" width=\"1080\" height=\"440\" \/><\/p>\n<p>If you can't open the page through the above URL (or jump to the Microsoft web page after opening), it may be that the default port 80 is occupied, and you need to change the port at this time:<\/p>\n<p>Open the .env file in the \\dify\\docker folder with a text editor tool:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30010\" title=\"98e95897j00sskx6e001md000of00fum\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/98e95897j00sskx6e001md000of00fum.jpg\" alt=\"98e95897j00sskx6e001md000of00fum\" width=\"879\" height=\"570\" \/><\/p>\n<p>Find the two lines below:<\/p>\n<p>EXPOSE_NGINX_PORT=80<\/p>\n<p>EXPOSE_NGINX_SSL_PORT=443<\/p>\n<p>Modified to:<\/p>\n<p>EXPOSE_NGINX_PORT=8080<\/p>\n<p>EXPOSE_NGINX_SSL_PORT=8443<\/p>\n<p>Save the file and run the following two lines in command line mode to restart the service:<\/p>\n<p>docker compose down<\/p>\n<p>docker compose up -d<\/p>\n<p>At this point the default port has been changed to 8080 and you can use Dify at the following URL:<\/p>\n<p>Dify setup page: http:\/\/localhost:8080\/install<\/p>\n<p>Dify main page: http:\/\/localhost:8080<\/p>\n<p>III. Setting up the model<\/p>\n<p>Dify can manage various models by clicking on your username in the top right corner and selecting \"Settings\" in the drop down menu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30011\" title=\"69a92f2fj00sskx6e0045d000u000hjm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/69a92f2fj00sskx6e0045d000u000hjm.jpg\" alt=\"69a92f2fj00sskx6e0045d000u000hjm\" width=\"1080\" height=\"631\" \/><\/p>\n<p>Select \"Model Providers\", find Ollama and click \"Add Model\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30012\" title=\"7c48ed5cj00sskx6f005cd000u000l1m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/7c48ed5cj00sskx6f005cd000u000l1m.jpg\" alt=\"7c48ed5cj00sskx6f005cd000u000l1m\" width=\"1080\" height=\"757\" \/><\/p>\n<p>Model Type Selection: LLM<\/p>\n<p>The name of the model is the one that has been downloaded locally, e.g. deepseek-r1:14b.<\/p>\n<p>Base URL filled in: http:\/\/host.docker.internal:11434<\/p>\n<p>Then click \"Save\", no error message.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30013\" title=\"b49bdfbcj00sskx6e001bd000ol00lrm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/b49bdfbcj00sskx6e001bd000ol00lrm.jpg\" alt=\"b49bdfbcj00sskx6e001bd000ol00lrm\" width=\"885\" height=\"783\" \/><\/p>\n<p>Go back to the main Dify page and click \"Create a blank app\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30014\" title=\"414378f0j00sskx6e002wd000u000dcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/414378f0j00sskx6e002wd000u000dcm.jpg\" alt=\"414378f0j00sskx6e002wd000u000dcm\" width=\"1080\" height=\"480\" \/><\/p>\n<p>Select \"Chat Assistant\", name it whatever you want, and click \"Create\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30015\" title=\"2309b509j00sskx6f002id000ri00qcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/2309b509j00sskx6f002id000ri00qcm.jpg\" alt=\"2309b509j00sskx6f002id000ri00qcm\" width=\"990\" height=\"948\" \/><\/p>\n<p>In the Chat Assistant window, in the top right corner is the model you have installed (if you can't see it, refresh the page a bit), and in the bottom right is the chat box, so you can test it out:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30016\" title=\"de612bfbj00sskx6f007nd000u000num\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/de612bfbj00sskx6f007nd000u000num.jpg\" alt=\"de612bfbj00sskx6f007nd000u000num\" width=\"1080\" height=\"858\" \/><\/p>\n<p>IV. Creating a knowledge base<\/p>\n<p>In the main page of Dify, click on the top of the \"Knowledge Base\", at this time, you can choose to \"create a knowledge base\" or \"connect to an external knowledge base\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30017\" title=\"174d8000j00sskx6e0026d000u000g7m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/174d8000j00sskx6e0026d000u000g7m.jpg\" alt=\"174d8000j00sskx6e0026d000u000g7m\" width=\"1080\" height=\"583\" \/><\/p>\n<p>In \"Create Knowledge Base\", you can create an empty knowledge base or select a data source:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30018\" title=\"0dc9e11fj00sskx6e001id000t000elm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/0dc9e11fj00sskx6e001id000t000elm.jpg\" alt=\"0dc9e11fj00sskx6e001id000t000elm\" width=\"1044\" height=\"525\" \/><\/p>\n<p>If it's an empty knowledge base, just take a name and OK it.<\/p>\n<p>If you import data sources, there are a variety of ways to \"import existing text\" as an example, select the text file (a single file is not larger than 15MB), click Next:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30019\" title=\"e52609acj00sskx6e003ld000u000fcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/e52609acj00sskx6e003ld000u000fcm.jpg\" alt=\"e52609acj00sskx6e003ld000u000fcm\" width=\"1080\" height=\"552\" \/><\/p>\n<p>Set the settings according to your needs, and finally click \"Save and Process\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30020\" title=\"55477a8fj00sskx6f007qd000u000tym\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/55477a8fj00sskx6f007qd000u000tym.jpg\" alt=\"55477a8fj00sskx6f007qd000u000tym\" width=\"1080\" height=\"1078\" \/><\/p>\n<p>This text was then added to the knowledge base:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30021\" title=\"edf5e794j00sskx6f0052d000u000kym\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/edf5e794j00sskx6f0052d000u000kym.jpg\" alt=\"edf5e794j00sskx6f0052d000u000kym\" width=\"1080\" height=\"754\" \/><\/p>\n<p>Select \"Add\" in the \"Context\" field at the bottom of the chat assistant window to call up the knowledge base. At this point, if you ask a question about the content in the knowledge base, the AI will give you the appropriate answer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30022\" title=\"8bb88c5aj00sskx6e006ed000u000hvm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/03\/8bb88c5aj00sskx6e006ed000u000hvm.jpg\" alt=\"8bb88c5aj00sskx6e006ed000u000hvm\" width=\"1080\" height=\"643\" \/><\/p>\n<p>At this point, a simple knowledge base for large models has been built.<\/p>\n<p>Dify's knowledge base is very feature-rich, for more information on how to use it, please refer to the official documentation at the bottom of the tweet.<\/p>\n<p>The article covers the URL:<\/p>\n<p>Dify's Github code page<\/p>\n<p>https:\/\/github.com\/langgenius\/dify<\/p>\n<p>Dify Knowledge Base Building Official Documentation:<\/p>\n<p>https:\/\/docs.dify.ai\/zh-hans\/guides\/knowledge-base\/create-knowledge-and-upload-documents<\/p>","protected":false},"excerpt":{"rendered":"<p>For local deployment of DeepSeek, how to install and use DeepSeek R1 Big Model on your own computer?DeepSeek R1 Local Deployment Guide How to make its answer more efficient? This is where the knowledge base comes into play. In this article, we use Ollama+Docker+Dify. Note: First of all, please make sure you have installed Git and Python, and keep the \"network open\". Install Ollama and Docker, and download the big model. Please refer to the first and second part of the following article: DeepSeek-R1 Local Deployment. Install Dify (Windows for example) Before installing, please make sure that Ollama and Docker are already running, that is, in either<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[3606,5661,5656,2405],"collection":[5669],"class_list":{"0":"post-30000","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-jiaocheng","7":"category-baike","8":"tag-deepseek","11":"tag-ollama","12":"collection-deepseek"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/30000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=30000"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/30000\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=30000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=30000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=30000"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=30000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}