{"id":16450,"date":"2026-07-05T09:53:49","date_gmt":"2026-07-05T01:53:49","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450"},"modified":"2026-07-05T09:53:49","modified_gmt":"2026-07-05T01:53:49","slug":"vmware-ubuntu-%e9%83%a8%e7%bd%b2-ollama-%e5%ae%8c%e6%95%b4%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450","title":{"rendered":"VMware Ubuntu \u90e8\u7f72 Ollama \u5b8c\u6574\u6307\u5357"},"content":{"rendered":"<blockquote>\n<p>\u672c\u6587\u6863\u6574\u7406\u81ea\u5b9e\u9645\u90e8\u7f72\u7ecf\u9a8c\uff0c\u6db5\u76d6\u865a\u62df\u673a\u914d\u7f6e\u3001\u6a21\u578b\u9009\u62e9\u3001Ollama \u5b89\u88c5\u3001GPU \u52a0\u901f\u3001\u670d\u52a1\u66b4\u9732\u3001\u65e5\u5e38\u8fd0\u7ef4\u7b49\u5168\u90e8\u73af\u8282\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_16 counter-hierarchy counter-decimal ez-toc-grey\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%B8%80%E3%80%81%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%A1%AC%E4%BB%B6%E9%85%8D%E7%BD%AE\" title=\"\u4e00\u3001\u865a\u62df\u673a\u786c\u4ef6\u914d\u7f6e\">\u4e00\u3001\u865a\u62df\u673a\u786c\u4ef6\u914d\u7f6e<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#11_%E6%8E%A8%E8%8D%90%E9%85%8D%E7%BD%AE%EF%BC%88%E5%9F%BA%E4%BA%8E%E5%AE%9E%E6%B5%8B%EF%BC%89\" title=\"1.1 \u63a8\u8350\u914d\u7f6e\uff08\u57fa\u4e8e\u5b9e\u6d4b\uff09\">1.1 \u63a8\u8350\u914d\u7f6e\uff08\u57fa\u4e8e\u5b9e\u6d4b\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#12_%E5%85%B3%E9%94%AE%E8%AE%BE%E7%BD%AE%E8%AF%B4%E6%98%8E\" title=\"1.2 \u5173\u952e\u8bbe\u7f6e\u8bf4\u660e\">1.2 \u5173\u952e\u8bbe\u7f6e\u8bf4\u660e<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%BA%8C%E3%80%81Ubuntu_%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87\" title=\"\u4e8c\u3001Ubuntu \u73af\u5883\u51c6\u5907\">\u4e8c\u3001Ubuntu \u73af\u5883\u51c6\u5907<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#21_%E7%B3%BB%E7%BB%9F%E6%9B%B4%E6%96%B0\" title=\"2.1 \u7cfb\u7edf\u66f4\u65b0\">2.1 \u7cfb\u7edf\u66f4\u65b0<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#22_%E5%AE%89%E8%A3%85%E5%9F%BA%E7%A1%80%E5%B7%A5%E5%85%B7\" title=\"2.2 \u5b89\u88c5\u57fa\u7840\u5de5\u5177\">2.2 \u5b89\u88c5\u57fa\u7840\u5de5\u5177<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#23_%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90\" title=\"2.3 \u67e5\u770b\u7cfb\u7edf\u8d44\u6e90\">2.3 \u67e5\u770b\u7cfb\u7edf\u8d44\u6e90<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%B8%89%E3%80%81%E5%AE%89%E8%A3%85_Ollama\" title=\"\u4e09\u3001\u5b89\u88c5 Ollama\">\u4e09\u3001\u5b89\u88c5 Ollama<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#31_%E5%AE%98%E6%96%B9%E8%84%9A%E6%9C%AC%E5%AE%89%E8%A3%85%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%89\" title=\"3.1 \u5b98\u65b9\u811a\u672c\u5b89\u88c5\uff08\u63a8\u8350\uff09\">3.1 \u5b98\u65b9\u811a\u672c\u5b89\u88c5\uff08\u63a8\u8350\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#32_%E9%AA%8C%E8%AF%81%E5%AE%89%E8%A3%85\" title=\"3.2 \u9a8c\u8bc1\u5b89\u88c5\">3.2 \u9a8c\u8bc1\u5b89\u88c5<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#33_%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98\" title=\"3.3 \u5e38\u89c1\u95ee\u9898\">3.3 \u5e38\u89c1\u95ee\u9898<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%9B%9B%E3%80%81%E6%A8%A1%E5%9E%8B%E9%80%89%E5%9E%8B%E6%8C%87%E5%8D%97\" title=\"\u56db\u3001\u6a21\u578b\u9009\u578b\u6307\u5357\">\u56db\u3001\u6a21\u578b\u9009\u578b\u6307\u5357<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#41_%E6%8C%89%E7%A1%AC%E4%BB%B6%E6%8E%A8%E8%8D%90\" title=\"4.1 \u6309\u786c\u4ef6\u63a8\u8350\">4.1 \u6309\u786c\u4ef6\u63a8\u8350<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#42_%E6%8C%89%E9%9C%80%E6%B1%82%E6%8E%A8%E8%8D%90\" title=\"4.2 \u6309\u9700\u6c42\u63a8\u8350\">4.2 \u6309\u9700\u6c42\u63a8\u8350<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-15\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#43_%E6%A8%A1%E5%9E%8B%E5%91%BD%E5%90%8D%E8%A7%84%E5%88%99\" title=\"4.3 \u6a21\u578b\u547d\u540d\u89c4\u5219\">4.3 \u6a21\u578b\u547d\u540d\u89c4\u5219<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-16\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%BA%94%E3%80%81%E4%B8%8B%E8%BD%BD%E4%B8%8E%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B\" title=\"\u4e94\u3001\u4e0b\u8f7d\u4e0e\u8fd0\u884c\u6a21\u578b\">\u4e94\u3001\u4e0b\u8f7d\u4e0e\u8fd0\u884c\u6a21\u578b<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-17\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#51_%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B\" title=\"5.1 \u4e0b\u8f7d\u6a21\u578b\">5.1 \u4e0b\u8f7d\u6a21\u578b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-18\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#52_%E6%9F%A5%E7%9C%8B%E5%B7%B2%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B\" title=\"5.2 \u67e5\u770b\u5df2\u4e0b\u8f7d\u6a21\u578b\">5.2 \u67e5\u770b\u5df2\u4e0b\u8f7d\u6a21\u578b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-19\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#53_%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B%EF%BC%88%E4%BA%A4%E4%BA%92%E5%BC%8F%EF%BC%89\" title=\"5.3 \u8fd0\u884c\u6a21\u578b\uff08\u4ea4\u4e92\u5f0f\uff09\">5.3 \u8fd0\u884c\u6a21\u578b\uff08\u4ea4\u4e92\u5f0f\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-20\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#54_%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B%EF%BC%88%E5%8D%95%E6%AC%A1%E9%97%AE%E7%AD%94%EF%BC%89\" title=\"5.4 \u8fd0\u884c\u6a21\u578b\uff08\u5355\u6b21\u95ee\u7b54\uff09\">5.4 \u8fd0\u884c\u6a21\u578b\uff08\u5355\u6b21\u95ee\u7b54\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-21\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#55_%E5%A4%9A%E8%BD%AE%E5%AF%B9%E8%AF%9D%EF%BC%88%E5%B8%A6%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%89\" title=\"5.5 \u591a\u8f6e\u5bf9\u8bdd\uff08\u5e26\u4e0a\u4e0b\u6587\uff09\">5.5 \u591a\u8f6e\u5bf9\u8bdd\uff08\u5e26\u4e0a\u4e0b\u6587\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-22\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#56_%E5%B8%B8%E7%94%A8%E8%BF%90%E8%A1%8C%E5%8F%82%E6%95%B0\" title=\"5.6 \u5e38\u7528\u8fd0\u884c\u53c2\u6570\">5.6 \u5e38\u7528\u8fd0\u884c\u53c2\u6570<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-23\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%85%AD%E3%80%81%E9%85%8D%E7%BD%AE_Ollama_%E6%9C%8D%E5%8A%A1\" title=\"\u516d\u3001\u914d\u7f6e Ollama \u670d\u52a1\">\u516d\u3001\u914d\u7f6e Ollama \u670d\u52a1<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-24\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#61_%E9%BB%98%E8%AE%A4_API_%E5%9C%B0%E5%9D%80\" title=\"6.1 \u9ed8\u8ba4 API \u5730\u5740\">6.1 \u9ed8\u8ba4 API \u5730\u5740<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-25\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#62_%E9%AA%8C%E8%AF%81_API_%E6%98%AF%E5%90%A6%E6%AD%A3%E5%B8%B8\" title=\"6.2 \u9a8c\u8bc1 API \u662f\u5426\u6b63\u5e38\">6.2 \u9a8c\u8bc1 API \u662f\u5426\u6b63\u5e38<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-26\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#63_%E8%AE%A9%E5%A4%96%E9%83%A8%E8%AE%BE%E5%A4%87%E8%AE%BF%E9%97%AE%EF%BC%88%E6%9A%B4%E9%9C%B2%E5%88%B0%E5%B1%80%E5%9F%9F%E7%BD%91%EF%BC%89\" title=\"6.3 \u8ba9\u5916\u90e8\u8bbe\u5907\u8bbf\u95ee\uff08\u66b4\u9732\u5230\u5c40\u57df\u7f51\uff09\">6.3 \u8ba9\u5916\u90e8\u8bbe\u5907\u8bbf\u95ee\uff08\u66b4\u9732\u5230\u5c40\u57df\u7f51\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-27\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#64_%E9%98%B2%E7%81%AB%E5%A2%99%E6%94%BE%E8%A1%8C%EF%BC%88%E5%A6%82%E6%9C%89_UFW%EF%BC%89\" title=\"6.4 \u9632\u706b\u5899\u653e\u884c\uff08\u5982\u6709 UFW\uff09\">6.4 \u9632\u706b\u5899\u653e\u884c\uff08\u5982\u6709 UFW\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-28\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#65_%E6%9F%A5%E7%9C%8B%E8%99%9A%E6%8B%9F%E6%9C%BA_IP\" title=\"6.5 \u67e5\u770b\u865a\u62df\u673a IP\">6.5 \u67e5\u770b\u865a\u62df\u673a IP<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-29\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%B8%83%E3%80%81%E9%85%8D%E7%BD%AE%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\" title=\"\u4e03\u3001\u914d\u7f6e\u5f00\u673a\u81ea\u542f\">\u4e03\u3001\u914d\u7f6e\u5f00\u673a\u81ea\u542f<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-30\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%85%AB%E3%80%81%E5%B8%B8%E7%94%A8_API_%E6%8E%A5%E5%8F%A3\" title=\"\u516b\u3001\u5e38\u7528 API \u63a5\u53e3\">\u516b\u3001\u5e38\u7528 API \u63a5\u53e3<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-31\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#81_%E6%9F%A5%E7%9C%8B%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8\" title=\"8.1 \u67e5\u770b\u6a21\u578b\u5217\u8868\">8.1 \u67e5\u770b\u6a21\u578b\u5217\u8868<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-32\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#82_%E7%94%9F%E6%88%90%E6%96%87%E6%9C%AC%EF%BC%88apigenerate%EF%BC%89\" title=\"8.2 \u751f\u6210\u6587\u672c\uff08\/api\/generate\uff09\">8.2 \u751f\u6210\u6587\u672c\uff08\/api\/generate\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-33\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#83_%E5%AF%B9%E8%AF%9D%EF%BC%88apichat%EF%BC%89\" title=\"8.3 \u5bf9\u8bdd\uff08\/api\/chat\uff09\">8.3 \u5bf9\u8bdd\uff08\/api\/chat\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-34\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#84_OpenAI_%E5%85%BC%E5%AE%B9%E6%8E%A5%E5%8F%A3\" title=\"8.4 OpenAI \u517c\u5bb9\u63a5\u53e3\">8.4 OpenAI \u517c\u5bb9\u63a5\u53e3<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-35\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#85_%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA\" title=\"8.5 \u6d41\u5f0f\u8f93\u51fa\">8.5 \u6d41\u5f0f\u8f93\u51fa<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-36\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E4%B9%9D%E3%80%81%E6%8E%A5%E5%85%A5%E7%AC%AC%E4%B8%89%E6%96%B9%E5%B7%A5%E5%85%B7\" title=\"\u4e5d\u3001\u63a5\u5165\u7b2c\u4e09\u65b9\u5de5\u5177\">\u4e5d\u3001\u63a5\u5165\u7b2c\u4e09\u65b9\u5de5\u5177<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-37\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#91_Trae_Cursor_Continue\" title=\"9.1 Trae \/ Cursor \/ Continue\">9.1 Trae \/ Cursor \/ Continue<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-38\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#92_Dify_Open_WebUI\" title=\"9.2 Dify \/ Open WebUI\">9.2 Dify \/ Open WebUI<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-39\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#93_%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%BF%AB%E9%80%9F%E8%B0%83%E7%94%A8\" title=\"9.3 \u547d\u4ee4\u884c\u5feb\u901f\u8c03\u7528\">9.3 \u547d\u4ee4\u884c\u5feb\u901f\u8c03\u7528<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-40\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%8D%81%E3%80%81%E6%A8%A1%E5%9E%8B%E7%AE%A1%E7%90%86\" title=\"\u5341\u3001\u6a21\u578b\u7ba1\u7406\">\u5341\u3001\u6a21\u578b\u7ba1\u7406<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-41\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#101_%E6%9F%A5%E7%9C%8B%E5%B7%B2%E5%AE%89%E8%A3%85%E6%A8%A1%E5%9E%8B\" title=\"10.1 \u67e5\u770b\u5df2\u5b89\u88c5\u6a21\u578b\">10.1 \u67e5\u770b\u5df2\u5b89\u88c5\u6a21\u578b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-42\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#102_%E5%88%A0%E9%99%A4%E6%A8%A1%E5%9E%8B\" title=\"10.2 \u5220\u9664\u6a21\u578b\">10.2 \u5220\u9664\u6a21\u578b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-43\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#103_%E6%9B%B4%E6%96%B0%E6%A8%A1%E5%9E%8B\" title=\"10.3 \u66f4\u65b0\u6a21\u578b\">10.3 \u66f4\u65b0\u6a21\u578b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-44\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#104_%E6%B8%85%E7%90%86%E7%BC%93%E5%AD%98\" title=\"10.4 \u6e05\u7406\u7f13\u5b58\">10.4 \u6e05\u7406\u7f13\u5b58<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-45\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#105_%E6%9F%A5%E7%9C%8B%E6%A8%A1%E5%9E%8B%E7%9B%AE%E5%BD%95%E5%A4%A7%E5%B0%8F\" title=\"10.5 \u67e5\u770b\u6a21\u578b\u76ee\u5f55\u5927\u5c0f\">10.5 \u67e5\u770b\u6a21\u578b\u76ee\u5f55\u5927\u5c0f<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-46\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#106_%E4%BF%AE%E6%94%B9%E6%A8%A1%E5%9E%8B%E5%AD%98%E5%82%A8%E7%9B%AE%E5%BD%95\" title=\"10.6 \u4fee\u6539\u6a21\u578b\u5b58\u50a8\u76ee\u5f55\">10.6 \u4fee\u6539\u6a21\u578b\u5b58\u50a8\u76ee\u5f55<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-47\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%8D%81%E4%B8%80%E3%80%81%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96\" title=\"\u5341\u4e00\u3001\u6027\u80fd\u4f18\u5316\">\u5341\u4e00\u3001\u6027\u80fd\u4f18\u5316<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-48\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#111_%E9%99%8D%E4%BD%8E%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3\" title=\"11.1 \u964d\u4f4e\u4e0a\u4e0b\u6587\u7a97\u53e3\">11.1 \u964d\u4f4e\u4e0a\u4e0b\u6587\u7a97\u53e3<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-49\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#112_%E5%87%8F%E5%B0%91%E6%9C%80%E5%A4%A7%E8%BE%93%E5%87%BA%E9%95%BF%E5%BA%A6\" title=\"11.2 \u51cf\u5c11\u6700\u5927\u8f93\u51fa\u957f\u5ea6\">11.2 \u51cf\u5c11\u6700\u5927\u8f93\u51fa\u957f\u5ea6<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-50\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#113_%E9%99%8D%E4%BD%8E%E6%B8%A9%E5%BA%A6%EF%BC%88%E5%87%8F%E5%B0%91%E9%9A%8F%E6%9C%BA%E6%80%A7%EF%BC%89\" title=\"11.3 \u964d\u4f4e\u6e29\u5ea6\uff08\u51cf\u5c11\u968f\u673a\u6027\uff09\">11.3 \u964d\u4f4e\u6e29\u5ea6\uff08\u51cf\u5c11\u968f\u673a\u6027\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-51\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#114_%E7%BB%84%E5%90%88%E4%BD%BF%E7%94%A8\" title=\"11.4 \u7ec4\u5408\u4f7f\u7528\">11.4 \u7ec4\u5408\u4f7f\u7528<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-52\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#115_%E6%A8%A1%E5%9E%8B%E5%B8%B8%E9%A9%BB%E6%98%BE%E5%AD%98\" title=\"11.5 \u6a21\u578b\u5e38\u9a7b\u663e\u5b58\">11.5 \u6a21\u578b\u5e38\u9a7b\u663e\u5b58<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-53\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%8D%81%E4%BA%8C%E3%80%81%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5\" title=\"\u5341\u4e8c\u3001\u6545\u969c\u6392\u67e5\">\u5341\u4e8c\u3001\u6545\u969c\u6392\u67e5<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-54\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#121_%E6%9F%A5%E7%9C%8B_Ollama_%E6%97%A5%E5%BF%97\" title=\"12.1 \u67e5\u770b Ollama \u65e5\u5fd7\">12.1 \u67e5\u770b Ollama \u65e5\u5fd7<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-55\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#122_%E5%AE%9E%E6%97%B6%E7%9B%91%E6%8E%A7%E6%97%A5%E5%BF%97\" title=\"12.2 \u5b9e\u65f6\u76d1\u63a7\u65e5\u5fd7\">12.2 \u5b9e\u65f6\u76d1\u63a7\u65e5\u5fd7<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-56\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#123_%E6%A3%80%E6%9F%A5%E6%9C%8D%E5%8A%A1%E7%8A%B6%E6%80%81\" title=\"12.3 \u68c0\u67e5\u670d\u52a1\u72b6\u6001\">12.3 \u68c0\u67e5\u670d\u52a1\u72b6\u6001<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-57\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#124_%E9%87%8D%E5%90%AF%E6%9C%8D%E5%8A%A1\" title=\"12.4 \u91cd\u542f\u670d\u52a1\">12.4 \u91cd\u542f\u670d\u52a1<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-58\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#125_%E5%B8%B8%E8%A7%81%E9%94%99%E8%AF%AF%E5%8F%8A%E8%A7%A3%E5%86%B3\" title=\"12.5 \u5e38\u89c1\u9519\u8bef\u53ca\u89e3\u51b3\">12.5 \u5e38\u89c1\u9519\u8bef\u53ca\u89e3\u51b3<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-59\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%8D%81%E4%B8%89%E3%80%81%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E9%80%9F%E6%9F%A5\" title=\"\u5341\u4e09\u3001\u5e38\u7528\u547d\u4ee4\u901f\u67e5\">\u5341\u4e09\u3001\u5e38\u7528\u547d\u4ee4\u901f\u67e5<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-60\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=16450\/#%E5%8D%81%E5%9B%9B%E3%80%81%E6%80%BB%E7%BB%93\" title=\"\u5341\u56db\u3001\u603b\u7ed3\">\u5341\u56db\u3001\u603b\u7ed3<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%A1%AC%E4%BB%B6%E9%85%8D%E7%BD%AE\"><\/span>\u4e00\u3001\u865a\u62df\u673a\u786c\u4ef6\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"11_%E6%8E%A8%E8%8D%90%E9%85%8D%E7%BD%AE%EF%BC%88%E5%9F%BA%E4%BA%8E%E5%AE%9E%E6%B5%8B%EF%BC%89\"><\/span>1.1 \u63a8\u8350\u914d\u7f6e\uff08\u57fa\u4e8e\u5b9e\u6d4b\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u786c\u4ef6<\/th>\n<th style=\"text-align: left;\">\u63a8\u8350\u503c<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>CPU \u6838\u5fc3\u6570<\/strong><\/td>\n<td style=\"text-align: left;\"><strong>4 \u6838<\/strong><\/td>\n<td style=\"text-align: left;\">VMware \u5b98\u65b9\u5efa\u8bae\u4e0d\u8d85\u8fc7 4 \u6838\uff0c\u8fc7\u591a\u53cd\u800c\u589e\u52a0\u8c03\u5ea6\u5f00\u9500<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u5185\u5b58 (RAM)<\/strong><\/td>\n<td style=\"text-align: left;\"><strong>32 GB<\/strong><\/td>\n<td style=\"text-align: left;\">7B \u6a21\u578b\u7ea6\u9700 14-16GB\uff0c\u5efa\u8bae\u9884\u7559\u4f59\u91cf<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u786c\u76d8<\/strong><\/td>\n<td style=\"text-align: left;\"><strong>500 GB<\/strong><\/td>\n<td style=\"text-align: left;\">\u6a21\u578b\u6587\u4ef6\u7ea6 4-5GB\/\u4e2a\uff0c\u65e5\u5fd7\u548c\u7f13\u5b58\u9700\u989d\u5916\u7a7a\u95f4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u7f51\u7edc<\/strong><\/td>\n<td style=\"text-align: left;\"><strong>NAT \/ \u6865\u63a5<\/strong><\/td>\n<td style=\"text-align: left;\">NAT \u53ef\u8bbf\u95ee\u5916\u7f51\uff1b\u6865\u63a5\u53ef\u8ba9\u5916\u90e8\u8bbe\u5907\u8bbf\u95ee\u865a\u62df\u673a\u670d\u52a1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"12_%E5%85%B3%E9%94%AE%E8%AE%BE%E7%BD%AE%E8%AF%B4%E6%98%8E\"><\/span>1.2 \u5173\u952e\u8bbe\u7f6e\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u8bbe\u7f6e\u9879<\/th>\n<th style=\"text-align: left;\">\u5efa\u8bae\u503c<\/th>\n<th style=\"text-align: left;\">\u539f\u56e0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u5904\u7406\u5668\u6570\u91cf<\/strong><\/td>\n<td style=\"text-align: left;\">1<\/td>\n<td style=\"text-align: left;\">\u5355\u8def CPU \u66f4\u7a33\u5b9a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u6bcf\u4e2a\u5904\u7406\u5668\u5185\u6838\u6570<\/strong><\/td>\n<td style=\"text-align: left;\">4<\/td>\n<td style=\"text-align: left;\">\u865a\u62df\u673a\u6838\u5fc3\u603b\u6570\u4e0d\u80fd\u8d85\u8fc7\u5bbf\u4e3b\u673a\u903b\u8f91\u7ebf\u7a0b\u6570<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u865a\u62df\u5316\u5f15\u64ce<\/strong><\/td>\n<td style=\"text-align: left;\">\u2705 \u5f00\u542f Intel VT-x\/EPT \u6216 AMD-V\/RVI<\/td>\n<td style=\"text-align: left;\">\u63d0\u5347 CPU \u865a\u62df\u5316\u6027\u80fd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u5185\u5b58\u9884\u7559<\/strong><\/td>\n<td style=\"text-align: left;\">\u5168\u90e8\u9884\u7559<\/td>\n<td style=\"text-align: left;\">\u907f\u514d\u5185\u5b58\u56de\u6536\u5bfc\u81f4\u63a8\u7406\u5361\u987f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\u26a0\ufe0f <strong>\u6ce8\u610f<\/strong>\uff1a\u82e5\u5bbf\u4e3b\u673a\u4e3a <strong>8 \u6838 16 \u7ebf\u7a0b<\/strong>\uff08\u5982 AMD Ryzen 7 5700X\uff09\uff0c\u865a\u62df\u673a\u6838\u5fc3\u603b\u6570\uff08\u5904\u7406\u5668\u6570 \u00d7 \u6bcf\u6838\u6570\uff09\u4e0d\u5f97\u8d85\u8fc7 <strong>16<\/strong>\uff0c\u5426\u5219 VMware \u4f1a\u62a5\u9519\u65e0\u6cd5\u542f\u52a8\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81Ubuntu_%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87\"><\/span>\u4e8c\u3001Ubuntu \u73af\u5883\u51c6\u5907<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"21_%E7%B3%BB%E7%BB%9F%E6%9B%B4%E6%96%B0\"><\/span>2.1 \u7cfb\u7edf\u66f4\u65b0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"22_%E5%AE%89%E8%A3%85%E5%9F%BA%E7%A1%80%E5%B7%A5%E5%85%B7\"><\/span>2.2 \u5b89\u88c5\u57fa\u7840\u5de5\u5177<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo apt install curl git net-tools -y<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"23_%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90\"><\/span>2.3 \u67e5\u770b\u7cfb\u7edf\u8d44\u6e90<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code># \u67e5\u770b\u5185\u5b58\nfree -h\n\n# \u67e5\u770b CPU \u4fe1\u606f\nlscpu\n\n# \u67e5\u770b\u78c1\u76d8\ndf -h<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%89%E3%80%81%E5%AE%89%E8%A3%85_Ollama\"><\/span>\u4e09\u3001\u5b89\u88c5 Ollama<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"31_%E5%AE%98%E6%96%B9%E8%84%9A%E6%9C%AC%E5%AE%89%E8%A3%85%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%89\"><\/span>3.1 \u5b98\u65b9\u811a\u672c\u5b89\u88c5\uff08\u63a8\u8350\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"32_%E9%AA%8C%E8%AF%81%E5%AE%89%E8%A3%85\"><\/span>3.2 \u9a8c\u8bc1\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama --version\nsudo systemctl status ollama<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"33_%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98\"><\/span>3.3 \u5e38\u89c1\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><strong>\u4e0b\u8f7d\u6162<\/strong>\uff1a\u8bbe\u7f6e\u4ee3\u7406\u73af\u5883\u53d8\u91cf\u540e\u518d\u6267\u884c\u5b89\u88c5\u811a\u672c<\/li>\n<li><strong><code>ollama<\/code> \u547d\u4ee4\u672a\u627e\u5230<\/strong>\uff1a\u5b89\u88c5\u811a\u672c\u53ef\u80fd\u672a\u52a0\u5165 PATH\uff0c\u91cd\u542f\u7ec8\u7aef\u6216\u6267\u884c <code>source ~\/.bashrc<\/code><\/li>\n<\/ul>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%9B%9B%E3%80%81%E6%A8%A1%E5%9E%8B%E9%80%89%E5%9E%8B%E6%8C%87%E5%8D%97\"><\/span>\u56db\u3001\u6a21\u578b\u9009\u578b\u6307\u5357<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"41_%E6%8C%89%E7%A1%AC%E4%BB%B6%E6%8E%A8%E8%8D%90\"><\/span>4.1 \u6309\u786c\u4ef6\u63a8\u8350<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u5185\u5b58\/\u663e\u5b58<\/th>\n<th style=\"text-align: left;\">\u63a8\u8350\u6a21\u578b<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">16 GB<\/td>\n<td style=\"text-align: left;\"><code>llama3.2:3b<\/code><\/td>\n<td style=\"text-align: left;\">\u8f7b\u91cf\uff0c\u901f\u5ea6\u5feb\uff0c\u9002\u5408\u65e5\u5e38\u5bf9\u8bdd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">32 GB<\/td>\n<td style=\"text-align: left;\"><code>qwen2.5:7b<\/code><\/td>\n<td style=\"text-align: left;\"><strong>\u9996\u9009<\/strong>\uff0c\u4e2d\u6587\u80fd\u529b\u6700\u5f3a\uff0c\u5de5\u5177\u8c03\u7528\u652f\u6301\u597d<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">32 GB<\/td>\n<td style=\"text-align: left;\"><code>deepseek-r1:7b<\/code><\/td>\n<td style=\"text-align: left;\">\u63a8\u7406\u80fd\u529b\u5f3a\uff0c\u4e2d\u6587\u8f83\u597d<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">32 GB<\/td>\n<td style=\"text-align: left;\"><code>llama3.1:8b<\/code><\/td>\n<td style=\"text-align: left;\">\u82f1\u6587\u80fd\u529b\u5f3a\uff0c\u5de5\u5177\u8c03\u7528\u6700\u7a33\u5b9a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">64 GB+<\/td>\n<td style=\"text-align: left;\"><code>qwen2.5:14b<\/code><\/td>\n<td style=\"text-align: left;\">\u6548\u679c\u66f4\u597d\uff0c\u901f\u5ea6\u8f83\u6162<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"42_%E6%8C%89%E9%9C%80%E6%B1%82%E6%8E%A8%E8%8D%90\"><\/span>4.2 \u6309\u9700\u6c42\u63a8\u8350<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u9700\u6c42<\/th>\n<th style=\"text-align: left;\">\u63a8\u8350\u6a21\u578b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u4e2d\u6587 + \u7f16\u7a0b + \u5de5\u5177\u8c03\u7528<\/strong><\/td>\n<td style=\"text-align: left;\"><code>qwen2.5:7b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u7f16\u7a0b\u4e13\u7528<\/strong><\/td>\n<td style=\"text-align: left;\"><code>deepseek-coder:6.7b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u82f1\u6587\u901a\u7528<\/strong><\/td>\n<td style=\"text-align: left;\"><code>llama3.1:8b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u901f\u5ea6\u4f18\u5148<\/strong><\/td>\n<td style=\"text-align: left;\"><code>llama3.2:3b<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"43_%E6%A8%A1%E5%9E%8B%E5%91%BD%E5%90%8D%E8%A7%84%E5%88%99\"><\/span>4.3 \u6a21\u578b\u547d\u540d\u89c4\u5219<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama pull &lt;\u6a21\u578b\u540d&gt;:&lt;\u7248\u672c\u53f7&gt;<\/code><\/pre>\n<p>\u5e38\u7528\u7248\u672c\uff1a<\/p>\n<ul>\n<li><code>latest<\/code>\uff1a\u6700\u65b0\u7248<\/li>\n<li><code>7b<\/code>\u3001<code>8b<\/code>\u3001<code>14b<\/code>\uff1a\u53c2\u6570\u89c4\u6a21<\/li>\n<li><code>q4_0<\/code>\u3001<code>q4_K_M<\/code>\uff1a\u91cf\u5316\u7248\u672c\uff08\u66f4\u5c0f\u66f4\u5feb\uff09<\/li>\n<\/ul>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BA%94%E3%80%81%E4%B8%8B%E8%BD%BD%E4%B8%8E%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B\"><\/span>\u4e94\u3001\u4e0b\u8f7d\u4e0e\u8fd0\u884c\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"51_%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B\"><\/span>5.1 \u4e0b\u8f7d\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama pull qwen2.5:7b<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"52_%E6%9F%A5%E7%9C%8B%E5%B7%B2%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B\"><\/span>5.2 \u67e5\u770b\u5df2\u4e0b\u8f7d\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama list<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"53_%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B%EF%BC%88%E4%BA%A4%E4%BA%92%E5%BC%8F%EF%BC%89\"><\/span>5.3 \u8fd0\u884c\u6a21\u578b\uff08\u4ea4\u4e92\u5f0f\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b<\/code><\/pre>\n<p>\u8fdb\u5165\u540e\u76f4\u63a5\u8f93\u5165\u95ee\u9898\uff0c<code>\/exit<\/code> \u9000\u51fa\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"54_%E8%BF%90%E8%A1%8C%E6%A8%A1%E5%9E%8B%EF%BC%88%E5%8D%95%E6%AC%A1%E9%97%AE%E7%AD%94%EF%BC%89\"><\/span>5.4 \u8fd0\u884c\u6a21\u578b\uff08\u5355\u6b21\u95ee\u7b54\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b &quot;\u4ecb\u7ecd\u4e00\u4e0b\u81ea\u5df1&quot;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"55_%E5%A4%9A%E8%BD%AE%E5%AF%B9%E8%AF%9D%EF%BC%88%E5%B8%A6%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%89\"><\/span>5.5 \u591a\u8f6e\u5bf9\u8bdd\uff08\u5e26\u4e0a\u4e0b\u6587\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama chat --model qwen2.5:7b --system &quot;\u4f60\u662f Linux \u7ec8\u7aef\u4e13\u5bb6&quot;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"56_%E5%B8%B8%E7%94%A8%E8%BF%90%E8%A1%8C%E5%8F%82%E6%95%B0\"><\/span>5.6 \u5e38\u7528\u8fd0\u884c\u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<th style=\"text-align: left;\">\u793a\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>--num-ctx<\/code><\/td>\n<td style=\"text-align: left;\">\u4e0a\u4e0b\u6587\u7a97\u53e3\u5927\u5c0f<\/td>\n<td style=\"text-align: left;\"><code>--num-ctx 2048<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>--num-predict<\/code><\/td>\n<td style=\"text-align: left;\">\u6700\u5927\u8f93\u51fa\u957f\u5ea6<\/td>\n<td style=\"text-align: left;\"><code>--num-predict 512<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>--temperature<\/code><\/td>\n<td style=\"text-align: left;\">\u968f\u673a\u6027\uff080-1\uff09<\/td>\n<td style=\"text-align: left;\"><code>--temperature 0.1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>--keep-alive<\/code><\/td>\n<td style=\"text-align: left;\">\u6a21\u578b\u4fdd\u7559\u5728\u663e\u5b58\u4e2d\u7684\u65f6\u95f4<\/td>\n<td style=\"text-align: left;\"><code>--keep-alive 5m<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%85%AD%E3%80%81%E9%85%8D%E7%BD%AE_Ollama_%E6%9C%8D%E5%8A%A1\"><\/span>\u516d\u3001\u914d\u7f6e Ollama \u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"61_%E9%BB%98%E8%AE%A4_API_%E5%9C%B0%E5%9D%80\"><\/span>6.1 \u9ed8\u8ba4 API \u5730\u5740<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>text<\/p>\n<pre><code>http:\/\/localhost:11434<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"62_%E9%AA%8C%E8%AF%81_API_%E6%98%AF%E5%90%A6%E6%AD%A3%E5%B8%B8\"><\/span>6.2 \u9a8c\u8bc1 API \u662f\u5426\u6b63\u5e38<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/api\/tags<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"63_%E8%AE%A9%E5%A4%96%E9%83%A8%E8%AE%BE%E5%A4%87%E8%AE%BF%E9%97%AE%EF%BC%88%E6%9A%B4%E9%9C%B2%E5%88%B0%E5%B1%80%E5%9F%9F%E7%BD%91%EF%BC%89\"><\/span>6.3 \u8ba9\u5916\u90e8\u8bbe\u5907\u8bbf\u95ee\uff08\u66b4\u9732\u5230\u5c40\u57df\u7f51\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4fee\u6539\u670d\u52a1\u76d1\u542c\u5730\u5740\uff1a<\/p>\n<p>bash<\/p>\n<pre><code>sudo systemctl edit ollama<\/code><\/pre>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>text<\/p>\n<pre><code>[Service]\nEnvironment=&quot;OLLAMA_HOST=0.0.0.0:11434&quot;<\/code><\/pre>\n<p>\u91cd\u542f\u670d\u52a1\uff1a<\/p>\n<p>bash<\/p>\n<pre><code>sudo systemctl daemon-reload\nsudo systemctl restart ollama<\/code><\/pre>\n<p>\u9a8c\u8bc1\uff1a<\/p>\n<p>bash<\/p>\n<pre><code>sudo netstat -tlnp | grep 11434\n# \u5e94\u663e\u793a 0.0.0.0:11434 \u6216 :::11434<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"64_%E9%98%B2%E7%81%AB%E5%A2%99%E6%94%BE%E8%A1%8C%EF%BC%88%E5%A6%82%E6%9C%89_UFW%EF%BC%89\"><\/span>6.4 \u9632\u706b\u5899\u653e\u884c\uff08\u5982\u6709 UFW\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo ufw allow 11434\/tcp<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"65_%E6%9F%A5%E7%9C%8B%E8%99%9A%E6%8B%9F%E6%9C%BA_IP\"><\/span>6.5 \u67e5\u770b\u865a\u62df\u673a IP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ip addr show | grep &quot;inet &quot; | grep -v 127.0.0.1<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%83%E3%80%81%E9%85%8D%E7%BD%AE%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\"><\/span>\u4e03\u3001\u914d\u7f6e\u5f00\u673a\u81ea\u542f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>bash<\/p>\n<pre><code>sudo systemctl enable ollama\nsudo systemctl is-enabled ollama\n# \u8f93\u51fa\u5e94\u4e3a enabled<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%85%AB%E3%80%81%E5%B8%B8%E7%94%A8_API_%E6%8E%A5%E5%8F%A3\"><\/span>\u516b\u3001\u5e38\u7528 API \u63a5\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"81_%E6%9F%A5%E7%9C%8B%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8\"><\/span>8.1 \u67e5\u770b\u6a21\u578b\u5217\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/api\/tags<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"82_%E7%94%9F%E6%88%90%E6%96%87%E6%9C%AC%EF%BC%88apigenerate%EF%BC%89\"><\/span>8.2 \u751f\u6210\u6587\u672c\uff08\/api\/generate\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/api\/generate -d &#039;{\n  &quot;model&quot;: &quot;qwen2.5:7b&quot;,\n  &quot;prompt&quot;: &quot;\u4f60\u597d&quot;,\n  &quot;stream&quot;: false\n}&#039;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"83_%E5%AF%B9%E8%AF%9D%EF%BC%88apichat%EF%BC%89\"><\/span>8.3 \u5bf9\u8bdd\uff08\/api\/chat\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/api\/chat -d &#039;{\n  &quot;model&quot;: &quot;qwen2.5:7b&quot;,\n  &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u4f60\u597d&quot;}],\n  &quot;stream&quot;: false\n}&#039;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"84_OpenAI_%E5%85%BC%E5%AE%B9%E6%8E%A5%E5%8F%A3\"><\/span>8.4 OpenAI \u517c\u5bb9\u63a5\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/v1\/chat\/completions -H &quot;Content-Type: application\/json&quot; -d &#039;{\n  &quot;model&quot;: &quot;qwen2.5:7b&quot;,\n  &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u4f60\u597d&quot;}]\n}&#039;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"85_%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA\"><\/span>8.5 \u6d41\u5f0f\u8f93\u51fa<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>curl http:\/\/localhost:11434\/api\/chat -d &#039;{\n  &quot;model&quot;: &quot;qwen2.5:7b&quot;,\n  &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u4f60\u597d&quot;}],\n  &quot;stream&quot;: true\n}&#039;<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B9%9D%E3%80%81%E6%8E%A5%E5%85%A5%E7%AC%AC%E4%B8%89%E6%96%B9%E5%B7%A5%E5%85%B7\"><\/span>\u4e5d\u3001\u63a5\u5165\u7b2c\u4e09\u65b9\u5de5\u5177<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"91_Trae_Cursor_Continue\"><\/span>9.1 Trae \/ Cursor \/ Continue<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u914d\u7f6e\u9879<\/th>\n<th style=\"text-align: left;\">\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">API \u5730\u5740<\/td>\n<td style=\"text-align: left;\"><code>http:\/\/&lt;\u865a\u62df\u673aIP&gt;:11434\/v1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u6a21\u578b ID<\/td>\n<td style=\"text-align: left;\"><code>qwen2.5:7b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">API \u5bc6\u94a5<\/td>\n<td style=\"text-align: left;\">\u4efb\u610f\u586b\u5199\uff08\u5982 <code>ollama<\/code>\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u4e0a\u4e0b\u6587\u7a97\u53e3<\/td>\n<td style=\"text-align: left;\">\u8f93\u5165 <code>8192<\/code> \/ \u8f93\u51fa <code>4096<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"92_Dify_Open_WebUI\"><\/span>9.2 Dify \/ Open WebUI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728\u6a21\u578b\u4f9b\u5e94\u5546\u914d\u7f6e\u4e2d\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u914d\u7f6e\u9879<\/th>\n<th style=\"text-align: left;\">\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">\u6a21\u578b\u540d\u79f0<\/td>\n<td style=\"text-align: left;\"><code>qwen2.5:7b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">API \u5730\u5740<\/td>\n<td style=\"text-align: left;\"><code>http:\/\/&lt;\u865a\u62df\u673aIP&gt;:11434<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u7c7b\u578b<\/td>\n<td style=\"text-align: left;\">LLM \/ Chat<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"93_%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%BF%AB%E9%80%9F%E8%B0%83%E7%94%A8\"><\/span>9.3 \u547d\u4ee4\u884c\u5feb\u901f\u8c03\u7528<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code># \u5355\u6b21\u95ee\u7b54\nollama run qwen2.5:7b &quot;\u4f60\u597d&quot;\n\n# \u7ba1\u9053\u8f93\u5165\necho &quot;\u4f60\u597d&quot; | ollama run qwen2.5:7b\n\n# \u4fdd\u5b58\u8f93\u51fa\u5230\u6587\u4ef6\nollama run qwen2.5:7b &quot;\u5199\u4e00\u4e2a\u5feb\u901f\u6392\u5e8f&quot; &gt; output.txt<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%81%E3%80%81%E6%A8%A1%E5%9E%8B%E7%AE%A1%E7%90%86\"><\/span>\u5341\u3001\u6a21\u578b\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"101_%E6%9F%A5%E7%9C%8B%E5%B7%B2%E5%AE%89%E8%A3%85%E6%A8%A1%E5%9E%8B\"><\/span>10.1 \u67e5\u770b\u5df2\u5b89\u88c5\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama list<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"102_%E5%88%A0%E9%99%A4%E6%A8%A1%E5%9E%8B\"><\/span>10.2 \u5220\u9664\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama rm &lt;\u6a21\u578b\u540d&gt;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"103_%E6%9B%B4%E6%96%B0%E6%A8%A1%E5%9E%8B\"><\/span>10.3 \u66f4\u65b0\u6a21\u578b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama pull &lt;\u6a21\u578b\u540d&gt;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"104_%E6%B8%85%E7%90%86%E7%BC%93%E5%AD%98\"><\/span>10.4 \u6e05\u7406\u7f13\u5b58<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama prune<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"105_%E6%9F%A5%E7%9C%8B%E6%A8%A1%E5%9E%8B%E7%9B%AE%E5%BD%95%E5%A4%A7%E5%B0%8F\"><\/span>10.5 \u67e5\u770b\u6a21\u578b\u76ee\u5f55\u5927\u5c0f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>du -sh ~\/.ollama\/models<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"106_%E4%BF%AE%E6%94%B9%E6%A8%A1%E5%9E%8B%E5%AD%98%E5%82%A8%E7%9B%AE%E5%BD%95\"><\/span>10.6 \u4fee\u6539\u6a21\u578b\u5b58\u50a8\u76ee\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo systemctl edit ollama<\/code><\/pre>\n<p>\u6dfb\u52a0\uff1a<\/p>\n<p>text<\/p>\n<pre><code>[Service]\nEnvironment=&quot;OLLAMA_MODELS=\/\u65b0\u8def\u5f84\/ollama_models&quot;<\/code><\/pre>\n<p>\u91cd\u542f\uff1a<\/p>\n<p>bash<\/p>\n<pre><code>sudo systemctl daemon-reload\nsudo systemctl restart ollama<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%81%E4%B8%80%E3%80%81%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96\"><\/span>\u5341\u4e00\u3001\u6027\u80fd\u4f18\u5316<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"111_%E9%99%8D%E4%BD%8E%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AA%97%E5%8F%A3\"><\/span>11.1 \u964d\u4f4e\u4e0a\u4e0b\u6587\u7a97\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b --num-ctx 2048<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"112_%E5%87%8F%E5%B0%91%E6%9C%80%E5%A4%A7%E8%BE%93%E5%87%BA%E9%95%BF%E5%BA%A6\"><\/span>11.2 \u51cf\u5c11\u6700\u5927\u8f93\u51fa\u957f\u5ea6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b --num-predict 512<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"113_%E9%99%8D%E4%BD%8E%E6%B8%A9%E5%BA%A6%EF%BC%88%E5%87%8F%E5%B0%91%E9%9A%8F%E6%9C%BA%E6%80%A7%EF%BC%89\"><\/span>11.3 \u964d\u4f4e\u6e29\u5ea6\uff08\u51cf\u5c11\u968f\u673a\u6027\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b --temperature 0.1<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"114_%E7%BB%84%E5%90%88%E4%BD%BF%E7%94%A8\"><\/span>11.4 \u7ec4\u5408\u4f7f\u7528<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b --num-ctx 1024 --num-predict 512 --temperature 0.1<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"115_%E6%A8%A1%E5%9E%8B%E5%B8%B8%E9%A9%BB%E6%98%BE%E5%AD%98\"><\/span>11.5 \u6a21\u578b\u5e38\u9a7b\u663e\u5b58<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>ollama run qwen2.5:7b --keep-alive 10m<\/code><\/pre>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%81%E4%BA%8C%E3%80%81%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5\"><\/span>\u5341\u4e8c\u3001\u6545\u969c\u6392\u67e5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"121_%E6%9F%A5%E7%9C%8B_Ollama_%E6%97%A5%E5%BF%97\"><\/span>12.1 \u67e5\u770b Ollama \u65e5\u5fd7<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo journalctl -u ollama -n 50 --no-pager<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"122_%E5%AE%9E%E6%97%B6%E7%9B%91%E6%8E%A7%E6%97%A5%E5%BF%97\"><\/span>12.2 \u5b9e\u65f6\u76d1\u63a7\u65e5\u5fd7<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo journalctl -u ollama -f<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"123_%E6%A3%80%E6%9F%A5%E6%9C%8D%E5%8A%A1%E7%8A%B6%E6%80%81\"><\/span>12.3 \u68c0\u67e5\u670d\u52a1\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo systemctl status ollama<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"124_%E9%87%8D%E5%90%AF%E6%9C%8D%E5%8A%A1\"><\/span>12.4 \u91cd\u542f\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash<\/p>\n<pre><code>sudo systemctl restart ollama<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"125_%E5%B8%B8%E8%A7%81%E9%94%99%E8%AF%AF%E5%8F%8A%E8%A7%A3%E5%86%B3\"><\/span>12.5 \u5e38\u89c1\u9519\u8bef\u53ca\u89e3\u51b3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u9519\u8bef<\/th>\n<th style=\"text-align: left;\">\u539f\u56e0<\/th>\n<th style=\"text-align: left;\">\u89e3\u51b3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>model not found<\/code><\/td>\n<td style=\"text-align: left;\">\u6a21\u578b\u672a\u4e0b\u8f7d\u6216\u540d\u79f0\u9519\u8bef<\/td>\n<td style=\"text-align: left;\"><code>ollama pull &lt;\u6b63\u786e\u6a21\u578b\u540d&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>connection refused<\/code><\/td>\n<td style=\"text-align: left;\">\u670d\u52a1\u672a\u8fd0\u884c<\/td>\n<td style=\"text-align: left;\"><code>sudo systemctl start ollama<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>CUDA driver version insufficient<\/code><\/td>\n<td style=\"text-align: left;\">NVIDIA \u9a71\u52a8\u592a\u65e7<\/td>\n<td style=\"text-align: left;\">\u66f4\u65b0\u9a71\u52a8\u6216\u5347\u7ea7 Ollama<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>model not loaded<\/code><\/td>\n<td style=\"text-align: left;\">\u663e\u5b58\u4e0d\u8db3<\/td>\n<td style=\"text-align: left;\">\u6362\u66f4\u5c0f\u7684\u6a21\u578b\u6216\u91cf\u5316\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>unable to open database file<\/code><\/td>\n<td style=\"text-align: left;\">\u6743\u9650\u95ee\u9898<\/td>\n<td style=\"text-align: left;\">\u68c0\u67e5 <code>~\/.ollama<\/code> \u76ee\u5f55\u6743\u9650<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%81%E4%B8%89%E3%80%81%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E9%80%9F%E6%9F%A5\"><\/span>\u5341\u4e09\u3001\u5e38\u7528\u547d\u4ee4\u901f\u67e5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u64cd\u4f5c<\/th>\n<th style=\"text-align: left;\">\u547d\u4ee4<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">\u5b89\u88c5 Ollama<\/td>\n<td style=\"text-align: left;\"><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u67e5\u770b\u7248\u672c<\/td>\n<td style=\"text-align: left;\"><code>ollama --version<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u67e5\u770b\u6a21\u578b\u5217\u8868<\/td>\n<td style=\"text-align: left;\"><code>ollama list<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u4e0b\u8f7d\u6a21\u578b<\/td>\n<td style=\"text-align: left;\"><code>ollama pull &lt;\u6a21\u578b\u540d&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u8fd0\u884c\u6a21\u578b\uff08\u4ea4\u4e92\uff09<\/td>\n<td style=\"text-align: left;\"><code>ollama run &lt;\u6a21\u578b\u540d&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u8fd0\u884c\u6a21\u578b\uff08\u5355\u6b21\uff09<\/td>\n<td style=\"text-align: left;\"><code>ollama run &lt;\u6a21\u578b\u540d&gt; &quot;\u95ee\u9898&quot;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u591a\u8f6e\u5bf9\u8bdd<\/td>\n<td style=\"text-align: left;\"><code>ollama chat --model &lt;\u6a21\u578b\u540d&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u5220\u9664\u6a21\u578b<\/td>\n<td style=\"text-align: left;\"><code>ollama rm &lt;\u6a21\u578b\u540d&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u67e5\u770b\u670d\u52a1\u72b6\u6001<\/td>\n<td style=\"text-align: left;\"><code>sudo systemctl status ollama<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u542f\u52a8\u670d\u52a1<\/td>\n<td style=\"text-align: left;\"><code>sudo systemctl start ollama<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u505c\u6b62\u670d\u52a1<\/td>\n<td style=\"text-align: left;\"><code>sudo systemctl stop ollama<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u91cd\u542f\u670d\u52a1<\/td>\n<td style=\"text-align: left;\"><code>sudo systemctl restart ollama<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u67e5\u770b\u65e5\u5fd7<\/td>\n<td style=\"text-align: left;\"><code>sudo journalctl -u ollama -n 50<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u9a8c\u8bc1 API<\/td>\n<td style=\"text-align: left;\"><code>curl http:\/\/localhost:11434\/api\/tags<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%81%E5%9B%9B%E3%80%81%E6%80%BB%E7%BB%93\"><\/span>\u5341\u56db\u3001\u603b\u7ed3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u9636\u6bb5<\/th>\n<th style=\"text-align: left;\">\u5173\u952e\u64cd\u4f5c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u865a\u62df\u673a\u914d\u7f6e<\/strong><\/td>\n<td style=\"text-align: left;\">CPU 4 \u6838\uff0c\u5185\u5b58 32GB\uff0c\u5f00\u542f\u865a\u62df\u5316\u5f15\u64ce<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u5b89\u88c5 Ollama<\/strong><\/td>\n<td style=\"text-align: left;\"><code>curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u6a21\u578b\u9009\u62e9<\/strong><\/td>\n<td style=\"text-align: left;\">\u4e2d\u6587\u9996\u9009 <code>qwen2.5:7b<\/code>\uff0c\u82f1\u6587\u9996\u9009 <code>llama3.1:8b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u4e0b\u8f7d\u6a21\u578b<\/strong><\/td>\n<td style=\"text-align: left;\"><code>ollama pull qwen2.5:7b<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u8fd0\u884c\u63a8\u7406<\/strong><\/td>\n<td style=\"text-align: left;\"><code>ollama run qwen2.5:7b &quot;\u4f60\u597d&quot;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u66b4\u9732\u670d\u52a1<\/strong><\/td>\n<td style=\"text-align: left;\"><code>OLLAMA_HOST=0.0.0.0:11434<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u63a5\u5165\u5de5\u5177<\/strong><\/td>\n<td style=\"text-align: left;\">API \u5730\u5740 <code>http:\/\/&lt;\u865a\u62df\u673aIP&gt;:11434\/v1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u65e5\u5e38\u8fd0\u7ef4<\/strong><\/td>\n<td style=\"text-align: left;\"><code>ollama list<\/code> \/ <code>ollama pull<\/code> \/ <code>ollama rm<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<button class=\"simplefavorite-button\" data-postid=\"16450\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u6863\u6574\u7406\u81ea\u5b9e\u9645\u90e8\u7f72\u7ecf\u9a8c\uff0c\u6db5\u76d6\u865a\u62df\u673a\u914d\u7f6e\u3001\u6a21\u578b\u9009\u62e9\u3001Ollama \u5b89\u88c5\u3001GPU \u52a0\u901f\u3001\u670d\u52a1\u66b4\u9732\u3001\u65e5\u5e38 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1308],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/16450"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16450"}],"version-history":[{"count":1,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/16450\/revisions"}],"predecessor-version":[{"id":16451,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/16450\/revisions\/16451"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16450"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}