{"id":124,"date":"2026-05-05T23:09:29","date_gmt":"2026-05-05T15:09:29","guid":{"rendered":"https:\/\/zoran.090702.xyz\/?p=124"},"modified":"2026-05-05T23:09:29","modified_gmt":"2026-05-05T15:09:29","slug":"%e7%94%a8docker%e6%8a%8adeepseek%e8%b7%91%e8%b5%b7%e6%9d%a5%ef%bc%9a%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%85%a5%e9%97%a8","status":"publish","type":"post","link":"https:\/\/zoran.090702.xyz\/?p=124","title":{"rendered":"\u7528Docker\u628aDeepSeek\u8dd1\u8d77\u6765\uff1a\u672c\u5730\u90e8\u7f72\u5927\u6a21\u578b\u5165\u95e8"},"content":{"rendered":"<p>\u6700\u8fd1DeepSeek\u706b\u5f97\u4e0d\u884c\uff0c\u5404\u79cd\u7fa4\u90fd\u5728\u804a\u3002\u4f46\u5f88\u591a\u4eba\u4e0d\u77e5\u9053\uff0c\u9664\u4e86\u7528\u5b98\u7f51\u7684API\uff0cDeepSeek\u7684\u6a21\u578b\u662f\u53ef\u4ee5\u672c\u5730\u90e8\u7f72\u7684\u3002\u6628\u665a\u53c8\u5c01\u4e86\u597d\u51e0\u4e2a\u7f51\u4e0a\u6d41\u4f20\u7684\u514d\u8d39\u4e2d\u8f6c\u7ad9\uff0c\u4e0e\u5176\u64cd\u5fc3\u54ea\u4e2a\u7ad9\u70b9\u8fd8\u80fd\u7528\uff0c\u4e0d\u5982\u81ea\u5df1\u62c9\u4e2a\u5bb9\u5668\u8dd1\u3002<\/p>\n<p>\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u6700\u7701\u4e8b\u7684\u65b9\u6848\u2014\u2014\u57fa\u4e8eOllama+Docker\uff0c\u51e0\u5206\u949f\u5c31\u80fd\u628aDeepSeek\u8dd1\u8d77\u6765\u3002<\/p>\n<p># \u51c6\u5907\u5de5\u4f5c<\/p>\n<p>\u4f60\u5f97\u6709\u4e00\u53f0\u5e26\u663e\u5361\u7684\u673a\u5668\u3002\u5982\u679c\u6ca1\u6709\u72ec\u663e\uff0c\u7eafCPU\u4e5f\u80fd\u8dd1\uff0c\u5c31\u662f\u6162\u70b9\u3002VPS\u7684\u8bdd\u63a8\u8350\u81f3\u5c114G\u5185\u5b58\uff0c2\u6838\u8d77\u6b65\u3002<\/p>\n<p># \u7b2c\u4e00\u6b65\uff1a\u88c5Docker<\/p>\n<p>\u8fd9\u6b65\u4e0d\u591a\u8bf4\uff0c\u4e00\u884c\u547d\u4ee4\u641e\u5b9a\uff1a<\/p>\n<p>&#8220;`<br \/>\ncurl -fsSL https:\/\/get.docker.com | sh<br \/>\n&#8220;`<\/p>\n<p>\u88c5\u5b8c\u522b\u5fd8\u4e86\u628a\u5f53\u524d\u7528\u6237\u52a0\u5230docker\u7ec4\uff1a<\/p>\n<p>&#8220;`<br \/>\nsudo usermod -aG docker $USER<br \/>\n&#8220;`<\/p>\n<p>\u7136\u540e\u91cd\u65b0\u767b\u5f55\u6216newgrp docker\u751f\u6548\u3002<\/p>\n<p># \u7b2c\u4e8c\u6b65\uff1a\u90e8\u7f72Ollama<\/p>\n<p>Ollama\u662f\u76ee\u524d\u6700\u7701\u5fc3\u7684\u672c\u5730LLM\u8fd0\u884c\u5de5\u5177\uff0c\u6ca1\u6709\u4e4b\u4e00\u3002\u76f4\u63a5\u62c9\u955c\u50cf\u8dd1\uff1a<\/p>\n<p>&#8220;`<br \/>\ndocker run -d &#8211;name ollama \\<br \/>\n  -v ollama:\/root\/.ollama \\<br \/>\n  -p 11434:11434 \\<br \/>\n  ollama\/ollama<br \/>\n&#8220;`<\/p>\n<p>\u7b49\u4e2a\u51e0\u5341\u79d2\uff0c\u955c\u50cf\u62c9\u5b8c\u5bb9\u5668\u5c31\u8d77\u6765\u4e86\u3002<\/p>\n<p>\u7136\u540e\u62c9\u6a21\u578b\uff1a<\/p>\n<p>&#8220;`<br \/>\ndocker exec ollama ollama pull deepseek-r1:7b<br \/>\n&#8220;`<\/p>\n<p>7B\u7684\u6a21\u578b\u5927\u69824G\u5de6\u53f3\uff0c\u7f51\u901f\u5feb\u7684\u8bdd\u51e0\u5206\u949f\u5c31\u62c9\u5b8c\u3002\u5982\u679cVPS\u5185\u5b58\u53ea\u67094G\uff0c\u53ef\u4ee5\u8bd5\u8bd5deepseek-r1:1.5b\uff0c\u66f4\u8f7b\u91cf\u3002<\/p>\n<p># \u7b2c\u4e09\u6b65\uff1a\u8dd1\u8d77\u6765\u9a8c\u8bc1<\/p>\n<p>\u62c9\u5b8c\u4e4b\u540e\uff0c\u76f4\u63a5\u8c03API\u9a8c\u8bc1\uff1a<\/p>\n<p>&#8220;`<br \/>\ncurl http:\/\/localhost:11434\/api\/generate \\<br \/>\n  -d &#8216;{&#8220;model&#8221;:&#8221;deepseek-r1:7b&#8221;,&#8221;prompt&#8221;:&#8221;Python\u7684GIL\u662f\u4ec0\u4e48\uff1f&#8221;,&#8221;stream&#8221;:false}&#8217;<br \/>\n&#8220;`<\/p>\n<p>\u80fd\u770b\u5230\u8fd4\u56de\u7ed3\u679c\u5c31\u8bf4\u660e\u90e8\u7f72\u6210\u529f\u4e86\u3002\u9ed8\u8ba4\u768411434\u7aef\u53e3\u66b4\u9732\u7684\u662fOllama\u7684API\u63a5\u53e3\uff0c\u548cOpenAI\u7684API\u683c\u5f0f\u4e0d\u592a\u4e00\u6837\uff0c\u4f46\u5f88\u591a\u5f00\u6e90\u9879\u76ee\u90fd\u539f\u751f\u652f\u6301Ollama\u3002<\/p>\n<p># \u7b2c\u56db\u6b65\uff1a\u88c5\u4e2aWeb\u754c\u9762\uff08\u53ef\u9009\uff09<\/p>\n<p>\u5149\u547d\u4ee4\u884c\u4e0d\u591f\u76f4\u89c2\uff0c\u53ef\u4ee5\u7528Open WebUI\uff1a<\/p>\n<p>&#8220;`<br \/>\ndocker run -d &#8211;name open-webui \\<br \/>\n  -p 3000:8080 \\<br \/>\n  -v open-webui:\/app\/backend\/data \\<br \/>\n  &#8211;link ollama \\<br \/>\n  -e OLLAMA_BASE_URL=http:\/\/ollama:11434 \\<br \/>\n  ghcr.io\/open-webui\/open-webui:main<br \/>\n&#8220;`<\/p>\n<p>\u8bbf\u95ee http:\/\/\u4f60\u7684IP:3000 \u5c31\u80fd\u770b\u5230\u4e00\u4e2a\u7c7b\u4f3cChatGPT\u7684\u754c\u9762\u4e86\u3002<\/p>\n<p># \u5ef6\u4f38\uff1a\u642d\u914dOpenAI\u517c\u5bb9API\u683c\u5f0f<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u8ba9Ollama\u517c\u5bb9OpenAI\u7684client\u683c\u5f0f\uff0cOllama 0.3.0+\u5df2\u7ecf\u81ea\u5e26\u4e86\u517c\u5bb9\u63a5\u53e3\u3002\u76f4\u63a5\u8fd9\u6837\u8c03\uff1a<\/p>\n<p>&#8220;`<br \/>\ncurl http:\/\/localhost:11434\/v1\/chat\/completions \\<br \/>\n  -H &#8220;Content-Type: application\/json&#8221; \\<br \/>\n  -d &#8216;{<br \/>\n    &#8220;model&#8221;:&#8221;deepseek-r1:7b&#8221;,<br \/>\n    &#8220;messages&#8221;:[{&#8220;role&#8221;:&#8221;user&#8221;,&#8221;content&#8221;:&#8221;\u5199\u4e00\u6bb5\u5192\u6ce1\u6392\u5e8f&#8221;}]<br \/>\n  }&#8217;<br \/>\n&#8220;`<\/p>\n<p>\u8fd9\u6837\u5c31\u7701\u53bb\u4e86\u5199\u517c\u5bb9\u5c42\u7684\u9ebb\u70e6\uff0c\u5f88\u591a\u73b0\u6210\u7684Agent\u6846\u67b6\u76f4\u63a5\u5c31\u80fd\u8fde\u3002<\/p>\n<p># \u4e00\u4e2a\u5fe0\u544a<\/p>\n<p>\u672c\u5730\u90e8\u7f72\u867d\u7136\u7701\u94b1\uff0c\u4f467B\u7684\u6a21\u578b\u8dd1\u590d\u6742\u4efb\u52a1\u6548\u679c\u4e00\u822c\u3002\u771f\u8981\u505a\u4ee3\u7801\u5206\u6790\u3001\u957f\u6587\u6863\u5904\u7406\uff0c\u8be5\u7528API\u8fd8\u662f\u7528API\u3002\u672c\u5730\u90e8\u7f72\u7684\u597d\u5904\u662f\uff1a\u79c1\u5bc6\u6027\u597d\u3001\u4e0d\u9650\u8c03\u7528\u6b21\u6570\u3001\u9002\u5408\u505a\u4e00\u4e9b\u53cd\u590d\u8c03\u7528\u7684\u81ea\u52a8\u5316\u4efb\u52a1\u3002<\/p>\n<p>\u6211\u4e2a\u4eba\u662fAPI+\u672c\u5730\u90e8\u7f72\u6df7\u7740\u7528\u7684\u2014\u2014\u654f\u611f\u6570\u636e\u8d70\u672c\u5730\uff0c\u65e5\u5e38\u5f00\u53d1\u8d70API\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1DeepSeek\u706b\u5f97\u4e0d\u884c\uff0c\u5404\u79cd\u7fa4\u90fd\u5728\u804a\u3002\u4f46\u5f88\u591a\u4eba\u4e0d\u77e5\u9053\uff0c\u9664\u4e86\u7528\u5b98\u7f51\u7684API\uff0cDeepSeek\u7684\u6a21\u578b\u662f\u53ef\u4ee5\u672c&hellip; <a href=\"https:\/\/zoran.090702.xyz\/?p=124\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u7528Docker\u628aDeepSeek\u8dd1\u8d77\u6765\uff1a\u672c\u5730\u90e8\u7f72\u5927\u6a21\u578b\u5165\u95e8<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-ai-frontier"],"_links":{"self":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=124"}],"version-history":[{"count":1,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}