{"id":79145,"date":"2026-03-01T08:48:55","date_gmt":"2026-03-01T00:48:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/79145.html"},"modified":"2026-03-01T08:48:55","modified_gmt":"2026-03-01T00:48:55","slug":"phi-3-mini-4k-instruct%e4%b8%8eubuntu%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%9a%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83%e9%83%a8%e7%bd%b2%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/79145.html","title":{"rendered":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357"},"content":{"rendered":"<h2>Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668&#xff1a;\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357<\/h2>\n<p>\u5982\u679c\u4f60\u662f\u4e00\u540d\u8fd0\u7ef4\u5de5\u7a0b\u5e08&#xff0c;\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u65e2\u8f7b\u91cf\u53c8\u5f3a\u5927\u7684\u8bed\u8a00\u6a21\u578b\u6765\u90e8\u7f72\u5230\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u4e0a&#xff0c;\u90a3\u4e48Phi-3-mini-4k-instruct\u5f88\u53ef\u80fd\u5c31\u662f\u4f60\u7684\u83dc\u3002\u8fd9\u4e2a\u7531\u5fae\u8f6f\u5f00\u6e90\u7684\u6a21\u578b&#xff0c;\u867d\u7136\u53ea\u670938\u4ebf\u53c2\u6570&#xff0c;\u4f46\u5728\u5e38\u8bc6\u3001\u903b\u8f91\u63a8\u7406\u3001\u4ee3\u7801\u751f\u6210\u7b49\u4efb\u52a1\u4e0a\u7684\u8868\u73b0&#xff0c;\u636e\u8bf4\u80fd\u548c\u4e00\u4e9b\u53c2\u6570\u591a\u597d\u51e0\u500d\u7684\u6a21\u578b\u63b0\u63b0\u624b\u8155\u3002<\/p>\n<p>\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u5b83\u975e\u5e38\u201c\u82d7\u6761\u201d&#xff0c;\u5bf9\u786c\u4ef6\u8981\u6c42\u4e0d\u9ad8&#xff0c;\u7279\u522b\u9002\u5408\u5728\u8d44\u6e90\u6709\u9650\u7684\u751f\u4ea7\u73af\u5883\u4e2d\u8fd0\u884c\u3002\u4eca\u5929&#xff0c;\u6211\u5c31\u6765\u624b\u628a\u624b\u5e26\u4f60\u8d70\u4e00\u904d&#xff0c;\u5982\u4f55\u5728Ubuntu\u670d\u52a1\u5668\u4e0a&#xff0c;\u628aPhi-3-mini-4k-instruct\u7a33\u7a33\u5f53\u5f53\u5730\u90e8\u7f72\u8d77\u6765&#xff0c;\u5e76\u4e14\u505a\u597d\u5b89\u5168\u8bbe\u7f6e\u548c\u6027\u80fd\u76d1\u63a7&#xff0c;\u8ba9\u5b83\u771f\u6b63\u80fd\u4e3a\u4f60\u6240\u7528\u3002<\/p>\n<h3>1. \u90e8\u7f72\u524d\u51c6\u5907&#xff1a;\u4e86\u89e3\u4f60\u7684\u201c\u65b0\u5458\u5de5\u201d<\/h3>\n<p>\u5728\u5f00\u59cb\u52a8\u624b\u4e4b\u524d&#xff0c;\u6211\u4eec\u5f97\u5148\u641e\u6e05\u695a\u6211\u4eec\u8981\u90e8\u7f72\u7684\u662f\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u5b83\u9700\u8981\u4ec0\u4e48\u6837\u7684\u73af\u5883\u3002\u8fd9\u5c31\u50cf\u62db\u8058\u65b0\u5458\u5de5\u524d&#xff0c;\u603b\u5f97\u770b\u770b\u4ed6\u7684\u7b80\u5386\u548c\u5c97\u4f4d\u8981\u6c42\u3002<\/p>\n<p>Phi-3-mini-4k-instruct\u662f\u4e00\u4e2a\u6307\u4ee4\u5fae\u8c03\u6a21\u578b&#xff0c;\u7b80\u5355\u8bf4&#xff0c;\u5c31\u662f\u4f60\u7528\u5bf9\u8bdd\u7684\u65b9\u5f0f\u544a\u8bc9\u5b83\u8981\u505a\u4ec0\u4e48&#xff0c;\u5b83\u5c31\u80fd\u7ed9\u4f60\u751f\u6210\u76f8\u5e94\u7684\u6587\u672c\u3001\u4ee3\u7801\u6216\u8005\u7b54\u6848\u3002\u5b83\u7684\u201c4k\u201d\u6307\u7684\u662f\u4e0a\u4e0b\u6587\u957f\u5ea6&#xff0c;\u5927\u6982\u80fd\u5904\u7406\u51e0\u5343\u4e2a\u5355\u8bcd\u7684\u5bf9\u8bdd&#xff0c;\u5bf9\u4e8e\u5f88\u591a\u65e5\u5e38\u4efb\u52a1\u6765\u8bf4\u5df2\u7ecf\u8db3\u591f\u4e86\u3002<\/p>\n<p>\u6839\u636e\u5b98\u65b9\u8d44\u6599&#xff0c;\u8fd9\u4e2a\u6a21\u578b\u5728\u8bad\u7ec3\u65f6\u7279\u522b\u6ce8\u91cd\u9ad8\u8d28\u91cf\u548c\u63a8\u7406\u80fd\u529b&#xff0c;\u8fd8\u7ecf\u8fc7\u4e86\u5b89\u5168\u5bf9\u9f50&#xff0c;\u7528\u8d77\u6765\u76f8\u5bf9\u66f4\u653e\u5fc3\u4e00\u4e9b\u3002\u5b83\u4e3b\u8981\u64c5\u957f\u7684\u662f\u82f1\u6587\u4efb\u52a1&#xff0c;\u5f53\u7136&#xff0c;\u7b80\u5355\u7684\u4e2d\u6587\u4e5f\u80fd\u5e94\u4ed8&#xff0c;\u4f46\u6548\u679c\u53ef\u80fd\u6ca1\u90a3\u4e48\u597d\u3002<\/p>\n<p>\u786c\u4ef6\u8981\u6c42\u53c2\u8003&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58&#xff1a;\u81f3\u5c118GB RAM&#xff08;\u8fd0\u884c\u91cf\u5316\u7248\u6a21\u578b\u65f6&#xff0c;2-4GB\u4e5f\u53ef\u80fd\u591f\u7528&#xff0c;\u4f46\u9884\u7559\u591a\u4e00\u4e9b\u603b\u662f\u597d\u7684&#xff09;\u3002<\/li>\n<li>\u5b58\u50a8&#xff1a;\u6a21\u578b\u6587\u4ef6\u672c\u8eab\u5927\u7ea62.2GB\u52307.6GB\u4e0d\u7b49&#xff08;\u53d6\u51b3\u4e8e\u4f60\u9009\u62e9\u7684\u7cbe\u5ea6&#xff09;&#xff0c;\u5efa\u8bae\u9884\u755910GB\u4ee5\u4e0a\u7684\u78c1\u76d8\u7a7a\u95f4\u3002<\/li>\n<li>CPU&#xff1a;\u73b0\u4ee3\u7684\u591a\u6838CPU\u5373\u53ef&#xff0c;\u5f53\u7136&#xff0c;\u6709GPU&#xff08;\u5c24\u5176\u662fNVIDIA GPU&#xff09;\u7684\u8bdd&#xff0c;\u63a8\u7406\u901f\u5ea6\u4f1a\u5feb\u5f88\u591a\u3002<\/li>\n<li>\u7cfb\u7edf&#xff1a;\u6211\u4eec\u4eca\u5929\u7684\u6218\u573a\u662f Ubuntu 20.04 LTS \u6216\u66f4\u9ad8\u7248\u672c\u3002\u5176\u4ed6Linux\u53d1\u884c\u7248\u6b65\u9aa4\u7c7b\u4f3c&#xff0c;\u4f46\u5305\u7ba1\u7406\u547d\u4ee4\u53ef\u80fd\u4e0d\u540c\u3002<\/li>\n<\/ul>\n<p>\u597d\u4e86&#xff0c;\u80cc\u666f\u4e86\u89e3\u5b8c\u6bd5&#xff0c;\u6211\u4eec\u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u5f00\u59cb\u5b9e\u6218\u3002<\/p>\n<h3>2. \u7cfb\u7edf\u73af\u5883\u914d\u7f6e\u4e0eOllama\u5b89\u88c5<\/h3>\n<p>\u6211\u4eec\u5c06\u4f7f\u7528Ollama\u6765\u7ba1\u7406\u548c\u8fd0\u884cPhi-3\u6a21\u578b\u3002Ollama\u5c31\u50cf\u4e00\u4e2a\u6a21\u578b\u7684\u201c\u5e94\u7528\u5546\u5e97\u201d\u52a0\u201c\u542f\u52a8\u5668\u201d&#xff0c;\u80fd\u5e2e\u4f60\u7701\u53bb\u5f88\u591a\u624b\u52a8\u914d\u7f6e\u7684\u9ebb\u70e6\u3002<\/p>\n<h4>2.1 \u7cfb\u7edf\u66f4\u65b0\u4e0e\u4f9d\u8d56\u5b89\u88c5<\/h4>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u662f\u6700\u65b0\u7684&#xff0c;\u5e76\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u5de5\u5177\u3002<\/p>\n<p># \u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\u5e76\u5347\u7ea7\u73b0\u6709\u5305<br \/>\nsudo apt update &amp;&amp; sudo apt upgrade -y<\/p>\n<p># \u5b89\u88c5\u4e00\u4e9b\u5e38\u7528\u7684\u5de5\u5177\u548c\u4f9d\u8d56&#xff0c;\u6bd4\u5982curl\u3001wget\u3001git\u7b49<br \/>\nsudo apt install -y curl wget git build-essential<\/p>\n<p>\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u6709NVIDIA GPU&#xff0c;\u5e76\u4e14\u5e0c\u671b\u7528GPU\u6765\u52a0\u901f\u6a21\u578b\u63a8\u7406&#xff0c;\u90a3\u4e48\u8fd8\u9700\u8981\u5b89\u88c5CUDA\u9a71\u52a8\u548c\u5de5\u5177\u5305\u3002\u8fd9\u4e00\u6b65\u6bd4\u8f83\u7e41\u7410&#xff0c;\u4e14\u53d6\u51b3\u4e8e\u4f60\u7684\u5177\u4f53\u663e\u5361\u578b\u53f7\u548cUbuntu\u7248\u672c\u3002\u4f60\u53ef\u4ee5\u53c2\u8003NVIDIA\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u7528 nvidia-smi \u547d\u4ee4\u6765\u9a8c\u8bc1\u9a71\u52a8\u662f\u5426\u6b63\u5e38\u3002<\/p>\n<h4>2.2 \u5b89\u88c5Ollama<\/h4>\n<p>Ollama\u63d0\u4f9b\u4e86\u975e\u5e38\u4fbf\u6377\u7684\u4e00\u952e\u5b89\u88c5\u811a\u672c\u3002<\/p>\n<p># \u4f7f\u7528\u5b98\u65b9\u811a\u672c\u5b89\u88c5Ollama<br \/>\ncurl -fsSL https:\/\/ollama.com\/install.sh | sh<\/p>\n<p>\u8fd9\u4e2a\u811a\u672c\u4f1a\u81ea\u52a8\u6dfb\u52a0Ollama\u7684\u4ed3\u5e93\u3001\u5b89\u88c5\u8f6f\u4ef6\u5305&#xff0c;\u5e76\u8bbe\u7f6e\u7cfb\u7edf\u670d\u52a1\u3002\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;Ollama\u670d\u52a1\u5e94\u8be5\u5df2\u7ecf\u8fd0\u884c\u8d77\u6765\u4e86\u3002\u4f60\u53ef\u4ee5\u68c0\u67e5\u4e00\u4e0b\u5b83\u7684\u72b6\u6001&#xff1a;<\/p>\n<p># \u68c0\u67e5Ollama\u670d\u52a1\u72b6\u6001<br \/>\nsudo systemctl status ollama<\/p>\n<p>\u5982\u679c\u770b\u5230\u72b6\u6001\u662f active (running)&#xff0c;\u90a3\u5c31\u6ca1\u95ee\u9898\u4e86\u3002\u4f60\u8fd8\u53ef\u4ee5\u8fd0\u884c\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u6765\u6d4b\u8bd5Ollama\u662f\u5426\u6b63\u5e38\u5de5\u4f5c&#xff1a;<\/p>\n<p># \u62c9\u53d6\u5e76\u8fd0\u884c\u4e00\u4e2a\u8d85\u5c0f\u7684\u6d4b\u8bd5\u6a21\u578b&#xff08;\u53ef\u9009&#xff09;<br \/>\nollama run llama2:7b-chat &#034;Hello&#034;<\/p>\n<p>\u6ce8\u610f&#xff0c;\u4e0a\u9762\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4e0b\u8f7d\u4e00\u4e2a\u51e0GB\u7684\u6a21\u578b&#xff0c;\u5982\u679c\u4f60\u53ea\u662f\u60f3\u5feb\u901f\u6d4b\u8bd5\u8fde\u63a5&#xff0c;\u53ef\u4ee5\u8df3\u8fc7\u3002\u6211\u4eec\u7684\u91cd\u70b9\u662fPhi-3\u3002<\/p>\n<h3>3. \u62c9\u53d6\u4e0e\u8fd0\u884cPhi-3-mini-4k-instruct\u6a21\u578b<\/h3>\n<p>Ollama\u5b89\u88c5\u597d\u4e86&#xff0c;\u63a5\u4e0b\u6765\u5c31\u662f\u8bf7\u51fa\u6211\u4eec\u4eca\u5929\u7684\u4e3b\u89d2\u3002<\/p>\n<h4>3.1 \u62c9\u53d6\u6a21\u578b<\/h4>\n<p>Ollama\u7684\u6a21\u578b\u5e93\u91cc\u6709Phi-3&#xff0c;\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u7528\u547d\u4ee4\u62c9\u53d6\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u5b83\u4f1a\u62c9\u53d6\u4e00\u4e2a\u5e73\u8861\u4e86\u901f\u5ea6\u548c\u8d28\u91cf\u7684\u91cf\u5316\u7248\u672c&#xff08;\u901a\u5e38\u662fQ4\u91cf\u5316&#xff09;\u3002<\/p>\n<p># \u62c9\u53d6Phi-3-mini-4k-instruct\u6a21\u578b<br \/>\nollama pull phi3:instruct<\/p>\n<p>\u4f60\u4f1a\u770b\u5230\u4e0b\u8f7d\u8fdb\u5ea6\u6761\u3002\u6a21\u578b\u4e0d\u5927&#xff0c;\u5927\u7ea62.2GB&#xff0c;\u5728\u4e00\u822c\u7684\u670d\u52a1\u5668\u5e26\u5bbd\u4e0b&#xff0c;\u51e0\u5206\u949f\u5c31\u80fd\u641e\u5b9a\u3002<\/p>\n<h4>3.2 \u9996\u6b21\u8fd0\u884c\u4e0e\u6d4b\u8bd5<\/h4>\n<p>\u6a21\u578b\u62c9\u53d6\u5b8c\u6210\u540e&#xff0c;\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u4e86\u3002<\/p>\n<p># \u4ee5\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u6a21\u5f0f\u8fd0\u884c\u6a21\u578b<br \/>\nollama run phi3:instruct<\/p>\n<p>\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u540e&#xff0c;\u4f60\u4f1a\u8fdb\u5165\u4e00\u4e2a\u5bf9\u8bdd\u754c\u9762&#xff0c;\u63d0\u793a\u7b26\u5927\u6982\u662f &gt;&gt;&gt;\u3002\u8fd9\u65f6&#xff0c;\u4f60\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u95ee\u9898&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<p>&gt;&gt;&gt; \u7528Python\u5199\u4e00\u4e2a\u51fd\u6570&#xff0c;\u8ba1\u7b97\u6590\u6ce2\u90a3\u5951\u6570\u5217\u7684\u7b2cn\u9879\u3002<\/p>\n<p>\u6a21\u578b\u4f1a\u5f00\u59cb\u601d\u8003&#xff08;\u5b9e\u9645\u4e0a\u662f\u5728\u751f\u6210\u6587\u672c&#xff09;&#xff0c;\u7136\u540e\u8f93\u51fa\u4ee3\u7801\u548c\u89e3\u91ca\u3002\u8f93\u5165 \/bye \u53ef\u4ee5\u9000\u51fa\u5bf9\u8bdd\u6a21\u5f0f\u3002<\/p>\n<p>\u9664\u4e86\u4ea4\u4e92\u6a21\u5f0f&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f20\u5165\u4e00\u4e2a\u95ee\u9898\u6765\u83b7\u53d6\u5355\u6b21\u56de\u7b54&#xff1a;<\/p>\n<p># \u5355\u6b21\u63d0\u95ee\u6a21\u5f0f<br \/>\nollama run phi3:instruct &#034;\u8bf7\u7528\u4e00\u53e5\u8bdd\u89e3\u91ca\u4ec0\u4e48\u662f\u4e91\u8ba1\u7b97\u3002&#034;<\/p>\n<p>\u5982\u679c\u770b\u5230\u6a21\u578b\u80fd\u6b63\u5e38\u751f\u6210\u8fde\u8d2f\u3001\u76f8\u5173\u7684\u56de\u7b54&#xff0c;\u90a3\u4e48\u606d\u559c\u4f60&#xff0c;\u6700\u57fa\u672c\u7684\u90e8\u7f72\u5df2\u7ecf\u6210\u529f\u4e86&#xff01;\u6a21\u578b\u5df2\u7ecf\u53ef\u4ee5\u5728\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u4e86\u3002<\/p>\n<h3>4. \u751f\u4ea7\u73af\u5883\u5b89\u5168\u4e0e\u7f51\u7edc\u914d\u7f6e<\/h3>\n<p>\u80fd\u8ba9\u6a21\u578b\u8dd1\u8d77\u6765\u53ea\u662f\u7b2c\u4e00\u6b65\u3002\u5728\u751f\u4ea7\u73af\u5883&#xff0c;\u6211\u4eec\u53ef\u4e0d\u80fd\u8ba9\u5b83\u201c\u88f8\u5954\u201d\u3002\u6211\u4eec\u9700\u8981\u8003\u8651\u5982\u4f55\u5b89\u5168\u5730\u63d0\u4f9bAPI\u670d\u52a1&#xff0c;\u4ee5\u53ca\u5982\u4f55\u7ba1\u7406\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<h4>4.1 \u914d\u7f6eOllama\u670d\u52a1\u76d1\u542c\u5730\u5740<\/h4>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;Ollama\u7684\u670d\u52a1\u53ea\u76d1\u542c\u672c\u673a&#xff08;127.0.0.1&#xff09;\u3002\u8fd9\u610f\u5473\u7740\u53ea\u6709\u670d\u52a1\u5668\u81ea\u5df1\u4e0a\u7684\u7a0b\u5e8f\u80fd\u8bbf\u95ee\u5b83\u3002\u5982\u679c\u6211\u4eec\u60f3\u4ece\u540c\u4e00\u5185\u7f51\u7684\u5176\u4ed6\u673a\u5668\u8c03\u7528&#xff0c;\u6216\u8005\u901a\u8fc7\u4e00\u4e2aWeb\u5e94\u7528\u6765\u8c03\u7528&#xff0c;\u5c31\u9700\u8981\u4fee\u6539\u914d\u7f6e\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u505c\u6b62Ollama\u670d\u52a1&#xff1a;<\/p>\n<p>sudo systemctl stop ollama<\/p>\n<p>\u7136\u540e&#xff0c;\u7f16\u8f91Ollama\u7684\u73af\u5883\u914d\u7f6e\u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u4ef6\u7684\u4f4d\u7f6e\u53ef\u80fd\u56e0\u5b89\u88c5\u65b9\u5f0f\u800c\u5f02&#xff0c;\u901a\u5e38\u5728 \/etc\/systemd\/system\/ollama.service \u6216\u901a\u8fc7 systemctl edit ollama \u521b\u5efa\u8986\u76d6\u6587\u4ef6\u3002\u8fd9\u91cc\u6211\u4eec\u91c7\u7528\u4e00\u4e2a\u66f4\u76f4\u63a5\u7684\u65b9\u6cd5&#xff0c;\u4fee\u6539\u670d\u52a1\u542f\u52a8\u53c2\u6570\u3002<\/p>\n<p>\u67e5\u770bOllama\u670d\u52a1\u7684\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>sudo systemctl cat ollama<\/p>\n<p>\u4f60\u53ef\u80fd\u4f1a\u770b\u5230 ExecStart \u547d\u4ee4\u3002\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u8986\u76d6\u6587\u4ef6\u6765\u4fee\u6539\u5b83&#xff1a;<\/p>\n<p># \u4e3aollama\u670d\u52a1\u521b\u5efa\u914d\u7f6e\u76ee\u5f55&#xff08;\u5982\u679c\u4e0d\u5b58\u5728&#xff09;<br \/>\nsudo mkdir -p \/etc\/systemd\/system\/ollama.service.d<\/p>\n<p># \u521b\u5efa\u8986\u76d6\u914d\u7f6e\u6587\u4ef6<br \/>\nsudo nano \/etc\/systemd\/system\/ollama.service.d\/override.conf<\/p>\n<p>\u5728\u6253\u5f00\u7684\u6587\u4ef6\u4e2d&#xff0c;\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9&#xff08;\u5982\u679c\u4f60\u60f3\u5141\u8bb8\u6240\u6709IP\u8bbf\u95ee&#xff0c;\u4f7f\u7528 0.0.0.0&#xff1b;\u5982\u679c\u53ea\u5141\u8bb8\u7279\u5b9a\u7f51\u7edc&#xff0c;\u8bf7\u66ff\u6362\u4e3a\u4f60\u7684\u670d\u52a1\u5668IP&#xff09;&#xff1a;<\/p>\n<p>[Service]<br \/>\nEnvironment&#061;&#034;OLLAMA_HOST&#061;0.0.0.0&#034;<br \/>\nEnvironment&#061;&#034;OLLAMA_ORIGINS&#061;*&#034; # \u6ce8\u610f&#xff1a;\u8fd9\u5728\u751f\u4ea7\u73af\u5883\u9700\u8c28\u614e\u8bbe\u7f6e&#xff0c;\u6700\u597d\u6307\u5b9a\u5177\u4f53\u57df\u540d\u6216IP<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<ul>\n<li>OLLAMA_HOST&#061;0.0.0.0 \u8ba9Ollama\u76d1\u542c\u6240\u6709\u7f51\u7edc\u63a5\u53e3\u3002<\/li>\n<li>OLLAMA_ORIGINS&#061;* \u5141\u8bb8\u6240\u6709\u6765\u6e90\u7684\u8de8\u57df\u8bf7\u6c42\u3002\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u8fd9\u5b58\u5728\u5b89\u5168\u98ce\u9669&#xff0c;\u4f60\u5e94\u8be5\u5c06\u5176\u8bbe\u7f6e\u4e3a\u4f60\u7684\u524d\u7aef\u5e94\u7528\u6216API\u7f51\u5173\u7684\u786e\u5207\u5730\u5740&#xff0c;\u4f8b\u5982 http:\/\/your-domain.com:8080\u3002<\/li>\n<\/ul>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff08;\u5728nano\u4e2d\u6309 Ctrl&#043;X&#xff0c;\u7136\u540e\u6309 Y&#xff0c;\u518d\u6309 Enter&#xff09;\u3002<\/p>\n<p>\u91cd\u65b0\u52a0\u8f7dsystemd\u914d\u7f6e\u5e76\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p>sudo systemctl daemon-reload<br \/>\nsudo systemctl restart ollama<\/p>\n<p>\u518d\u6b21\u68c0\u67e5\u670d\u52a1\u72b6\u6001\u548c\u76d1\u542c\u7aef\u53e3&#xff1a;<\/p>\n<p>sudo systemctl status ollama<br \/>\nsudo netstat -tlnp | grep 11434  # Ollama\u9ed8\u8ba4\u4f7f\u752811434\u7aef\u53e3<\/p>\n<p>\u4f60\u5e94\u8be5\u80fd\u770b\u5230Ollama\u6b63\u5728\u76d1\u542c 0.0.0.0:11434\u3002<\/p>\n<h4>4.2 \u4f7f\u7528\u9632\u706b\u5899\u9650\u5236\u8bbf\u95ee&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff09;<\/h4>\n<p>\u8ba9\u670d\u52a1\u76d1\u542c\u6240\u6709IP\u5f88\u5371\u9669&#xff0c;\u6211\u4eec\u5fc5\u987b\u7528\u9632\u706b\u5899&#xff08;\u5982UFW&#xff09;\u6765\u9650\u5236\u8c01\u53ef\u4ee5\u8bbf\u95ee11434\u7aef\u53e3\u3002<\/p>\n<p>\u5047\u8bbe\u4f60\u7684\u670d\u52a1\u5668IP\u662f 192.168.1.100&#xff0c;\u800c\u4f60\u53ea\u5141\u8bb8\u6765\u81ea 192.168.1.0\/24 \u8fd9\u4e2a\u5185\u7f51\u7f51\u6bb5\u7684\u8bbf\u95ee&#xff0c;\u6216\u8005\u53ea\u5141\u8bb8\u4f60\u81ea\u5df1\u7684\u7ba1\u7406IP&#xff08;203.0.113.5&#xff09;\u8bbf\u95ee\u3002<\/p>\n<p># \u5b89\u88c5UFW&#xff08;\u5982\u679c\u5c1a\u672a\u5b89\u88c5&#xff09;<br \/>\nsudo apt install -y ufw<\/p>\n<p># \u8bbe\u7f6e\u9ed8\u8ba4\u7b56\u7565&#xff08;\u62d2\u7edd\u6240\u6709\u5165\u7ad9&#xff0c;\u5141\u8bb8\u6240\u6709\u51fa\u7ad9&#xff09;<br \/>\nsudo ufw default deny incoming<br \/>\nsudo ufw default allow outgoing<\/p>\n<p># \u5141\u8bb8SSH\u7aef\u53e3&#xff08;\u786e\u4fdd\u4f60\u4e0d\u4f1a\u628a\u81ea\u5df1\u9501\u5728\u5916\u9762&#xff01;&#xff09;<br \/>\nsudo ufw allow 22\/tcp<\/p>\n<p># \u5141\u8bb8\u7279\u5b9aIP\u6bb5\u8bbf\u95eeOllama\u7aef\u53e3<br \/>\n# \u793a\u4f8b1&#xff1a;\u5141\u8bb8\u6574\u4e2a\u5185\u7f51\u7f51\u6bb5<br \/>\nsudo ufw allow from 192.168.1.0\/24 to any port 11434 proto tcp<br \/>\n# \u793a\u4f8b2&#xff1a;\u53ea\u5141\u8bb8\u5355\u4e2a\u7ba1\u7406IP<br \/>\n# sudo ufw allow from 203.0.113.5 to any port 11434 proto tcp<\/p>\n<p># \u542f\u7528UFW<br \/>\nsudo ufw enable<br \/>\n# \u67e5\u770b\u89c4\u5219<br \/>\nsudo ufw status numbered<\/p>\n<p>\u91cd\u8981\u5b89\u5168\u63d0\u793a&#xff1a; \u76f4\u63a5\u5411\u516c\u7f51\u66b4\u9732Ollama\u7684API\u7aef\u53e3&#xff08;11434&#xff09;\u662f\u975e\u5e38\u5371\u9669\u7684&#xff0c;\u56e0\u4e3a\u5b83\u6ca1\u6709\u5185\u7f6e\u7684\u5f3a\u8ba4\u8bc1\u673a\u5236\u3002\u66f4\u5b89\u5168\u7684\u505a\u6cd5\u662f&#xff1a;<\/p>\n<li>\u4f7f\u7528\u53cd\u5411\u4ee3\u7406&#xff1a;\u901a\u8fc7Nginx\u6216Apache\u914d\u7f6e\u53cd\u5411\u4ee3\u7406&#xff0c;\u5e76\u8bbe\u7f6eHTTP Basic\u8ba4\u8bc1\u3001API\u5bc6\u94a5\u6216\u7ed3\u5408OAuth\u3002<\/li>\n<li>VPN\/\u5185\u7f51\u8bbf\u95ee&#xff1a;\u786e\u4fddOllama\u670d\u52a1\u53ea\u5728\u5185\u7f51\u8fd0\u884c&#xff0c;\u901a\u8fc7VPN\u8bbf\u95ee\u5185\u90e8\u7f51\u7edc\u540e\u518d\u8c03\u7528API\u3002<\/li>\n<li>API\u7f51\u5173&#xff1a;\u4f7f\u7528Kong\u3001Tyk\u7b49API\u7f51\u5173\u6765\u7ba1\u7406\u8ba4\u8bc1\u3001\u9650\u6d41\u548c\u5ba1\u8ba1\u3002<\/li>\n<h3>5. \u901a\u8fc7API\u8c03\u7528\u4e0e\u96c6\u6210\u6d4b\u8bd5<\/h3>\n<p>\u73b0\u5728&#xff0c;\u6211\u4eec\u7684\u6a21\u578b\u670d\u52a1\u5df2\u7ecf\u5728\u5b89\u5168\u8fb9\u754c\u5185\u8fd0\u884c\u8d77\u6765\u4e86\u3002\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u901a\u8fc7\u5b83\u7684API\u6765\u8c03\u7528&#xff0c;\u8fd9\u662f\u96c6\u6210\u5230\u5176\u4ed6\u5e94\u7528\u4e2d\u7684\u5173\u952e\u3002<\/p>\n<p>Ollama\u63d0\u4f9b\u4e86\u517c\u5bb9OpenAI API\u98ce\u683c\u7684\u63a5\u53e3&#xff0c;\u8fd9\u5927\u5927\u964d\u4f4e\u4e86\u96c6\u6210\u96be\u5ea6\u3002<\/p>\n<h4>5.1 \u57fa\u672c\u7684\u804a\u5929API\u8c03\u7528<\/h4>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 curl \u547d\u4ee4\u6765\u6d4b\u8bd5API&#xff1a;<\/p>\n<p># \u5411\u672c\u673a\u8fd0\u884c\u7684Ollama\u53d1\u9001\u4e00\u4e2a\u804a\u5929\u8bf7\u6c42<br \/>\ncurl http:\/\/localhost:11434\/api\/chat -d &#039;{<br \/>\n  &#034;model&#034;: &#034;phi3:instruct&#034;,<br \/>\n  &#034;messages&#034;: [<br \/>\n    { &#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;\u4f60\u597d&#xff0c;\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1\u3002&#034; }<br \/>\n  ],<br \/>\n  &#034;stream&#034;: false<br \/>\n}&#039;<\/p>\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38&#xff0c;\u4f60\u4f1a\u6536\u5230\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u54cd\u5e94&#xff0c;\u5176\u4e2d\u5305\u542b\u6a21\u578b\u751f\u6210\u7684\u56de\u7b54\u3002<\/p>\n<h4>5.2 \u4f7f\u7528Python\u5ba2\u6237\u7aef\u96c6\u6210<\/h4>\n<p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u66f4\u5e38\u7528\u7f16\u7a0b\u8bed\u8a00\u6765\u8c03\u7528\u3002\u8fd9\u91cc\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u793a\u4f8b&#xff1a;<\/p>\n<p>\u9996\u5148&#xff0c;\u5b89\u88c5requests\u5e93&#xff1a;<\/p>\n<p>pip install requests<\/p>\n<p>\u7136\u540e&#xff0c;\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c test_phi3_api.py&#xff1a;<\/p>\n<p>import requests<br \/>\nimport json<\/p>\n<p>def ask_phi3(question, server_url&#061;&#034;http:\/\/localhost:11434&#034;):<br \/>\n    &#034;&#034;&#034;\u5411\u90e8\u7f72\u597d\u7684Phi-3\u6a21\u578b\u63d0\u95ee&#034;&#034;&#034;<br \/>\n    url &#061; f&#034;{server_url}\/api\/chat&#034;<br \/>\n    payload &#061; {<br \/>\n        &#034;model&#034;: &#034;phi3:instruct&#034;,<br \/>\n        &#034;messages&#034;: [{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: question}],<br \/>\n        &#034;stream&#034;: False<br \/>\n    }<br \/>\n    headers &#061; {&#039;Content-Type&#039;: &#039;application\/json&#039;}<\/p>\n<p>    try:<br \/>\n        response &#061; requests.post(url, data&#061;json.dumps(payload), headers&#061;headers, timeout&#061;60)<br \/>\n        response.raise_for_status()  # \u68c0\u67e5HTTP\u9519\u8bef<br \/>\n        result &#061; response.json()<br \/>\n        return result[&#039;message&#039;][&#039;content&#039;]<br \/>\n    except requests.exceptions.RequestException as e:<br \/>\n        return f&#034;\u8bf7\u6c42\u51fa\u9519: {e}&#034;<br \/>\n    except KeyError as e:<br \/>\n        return f&#034;\u89e3\u6790\u54cd\u5e94\u51fa\u9519: {e}&#034;<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    # \u6d4b\u8bd5\u95ee\u9898<br \/>\n    test_questions &#061; [<br \/>\n        &#034;Python\u4e2d\u5982\u4f55\u5feb\u901f\u53cd\u8f6c\u4e00\u4e2a\u5217\u8868&#xff1f;&#034;,<br \/>\n        &#034;\u5199\u4e00\u6bb5\u7b80\u5355\u7684SQL\u67e5\u8be2&#xff0c;\u4ece&#096;users&#096;\u8868\u4e2d\u9009\u62e9\u6240\u6709\u6d3b\u8dc3\u7528\u6237\u3002&#034;,<br \/>\n        &#034;\u7528\u4e00\u53e5\u8bdd\u603b\u7ed3\u654f\u6377\u5f00\u53d1\u7684\u6838\u5fc3\u601d\u60f3\u3002&#034;<br \/>\n    ]<\/p>\n<p>    for q in test_questions:<br \/>\n        print(f&#034;\u95ee: {q}&#034;)<br \/>\n        answer &#061; ask_phi3(q)<br \/>\n        print(f&#034;\u7b54: {answer}\\\\n{&#039;-&#039;*40}&#034;)<\/p>\n<p>\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c&#xff0c;\u770b\u770b\u6a21\u578b\u662f\u5426\u80fd\u8fd4\u56de\u5408\u7406\u7684\u7b54\u6848\u3002\u8fd9\u9a8c\u8bc1\u4e86\u4f60\u7684API\u63a5\u53e3\u5de5\u4f5c\u6b63\u5e38&#xff0c;\u53ef\u4ee5\u88ab\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u8c03\u7528\u3002<\/p>\n<h3>6. \u7cfb\u7edf\u76d1\u63a7\u4e0e\u7ef4\u62a4\u6307\u5357<\/h3>\n<p>\u5c06\u6a21\u578b\u90e8\u7f72\u4e3a\u957f\u671f\u8fd0\u884c\u7684\u670d\u52a1&#xff0c;\u76d1\u63a7\u5176\u5065\u5eb7\u72b6\u6001\u548c\u8d44\u6e90\u6d88\u8017\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n<h4>6.1 \u76d1\u63a7Ollama\u670d\u52a1\u72b6\u6001<\/h4>\n<p>\u4f7f\u7528systemctl\u53ef\u4ee5\u65b9\u4fbf\u5730\u67e5\u770b\u670d\u52a1\u72b6\u6001\u548c\u65e5\u5fd7&#xff1a;<\/p>\n<p># \u67e5\u770b\u5b9e\u65f6\u65e5\u5fd7<br \/>\nsudo journalctl -u ollama -f<\/p>\n<p># \u67e5\u770b\u670d\u52a1\u72b6\u6001\u6458\u8981<br \/>\nsudo systemctl status ollama &#8211;no-pager -l<\/p>\n<p>\u5728\u65e5\u5fd7\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u770b\u5230\u6a21\u578b\u7684\u52a0\u8f7d\u60c5\u51b5\u3001API\u8bf7\u6c42\u8bb0\u5f55\u548c\u4efb\u4f55\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<h4>6.2 \u76d1\u63a7\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5<\/h4>\n<p>\u6a21\u578b\u8fd0\u884c\u65f6\u4f1a\u6d88\u8017CPU\u548c\u5185\u5b58\u3002\u6211\u4eec\u53ef\u4ee5\u7528\u4e00\u4e9b\u5e38\u7528\u5de5\u5177\u6765\u76d1\u63a7&#xff1a;<\/p>\n<p># \u67e5\u770b\u8fdb\u7a0b\u8d44\u6e90\u5360\u7528&#xff08;\u627e\u5230ollama\u8fdb\u7a0b\u7684PID&#xff09;<br \/>\ntop -p $(pgrep -f ollama)<\/p>\n<p># \u6216\u8005\u7528htop\u66f4\u76f4\u89c2&#xff08;\u5982\u679c\u5df2\u5b89\u88c5&#xff09;<br \/>\n# sudo apt install htop<br \/>\n# htop<\/p>\n<p># \u67e5\u770b\u5185\u5b58\u4f7f\u7528\u6982\u51b5<br \/>\nfree -h<\/p>\n<p># \u67e5\u770bGPU\u4f7f\u7528\u60c5\u51b5&#xff08;\u5982\u679c\u6709NVIDIA GPU&#xff09;<br \/>\nnvidia-smi<\/p>\n<p>\u4f60\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u76d1\u63a7\u547d\u4ee4\u96c6\u6210\u5230\u4f60\u7684\u8fd0\u7ef4\u76d1\u63a7\u7cfb\u7edf&#xff08;\u5982Zabbix, Prometheus&#043;Grafana&#xff09;\u4e2d&#xff0c;\u4e3aOllama\u670d\u52a1\u8bbe\u7f6e\u544a\u8b66\u9608\u503c&#xff08;\u4f8b\u5982&#xff0c;\u5185\u5b58\u4f7f\u7528\u8d85\u8fc780%\u65f6\u544a\u8b66&#xff09;\u3002<\/p>\n<h4>6.3 \u6a21\u578b\u66f4\u65b0\u4e0e\u7ef4\u62a4<\/h4>\n<p>\u6a21\u578b\u53ef\u80fd\u4f1a\u6709\u66f4\u65b0\u7248\u672c\u3002Ollama\u4f7f\u5f97\u66f4\u65b0\u6a21\u578b\u53d8\u5f97\u5f88\u7b80\u5355&#xff1a;<\/p>\n<p># \u62c9\u53d6\u6a21\u578b\u7684\u6700\u65b0\u7248\u672c&#xff08;\u5982\u679c\u6709&#xff09;<br \/>\nollama pull phi3:instruct<\/p>\n<p># \u5220\u9664\u65e7\u7684\u6a21\u578b\u7248\u672c\u4ee5\u91ca\u653e\u7a7a\u95f4&#xff08;\u8c28\u614e\u64cd\u4f5c&#xff0c;\u786e\u4fdd\u65b0\u7248\u672c\u8fd0\u884c\u6b63\u5e38\u540e\u518d\u8fdb\u884c&#xff09;<br \/>\n# ollama rm phi3:instruct<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u540c\u65f6\u4fdd\u7559\u591a\u4e2a\u4e0d\u540c\u91cf\u5316\u7cbe\u5ea6\u6216\u4e0d\u540c\u7248\u672c\u7684Phi-3\u6a21\u578b&#xff0c;\u901a\u8fc7\u5728\u8fd0\u884c\u65f6\u6307\u5b9a\u4e0d\u540c\u7684\u6807\u7b7e\u6765\u4f7f\u7528\u3002<\/p>\n<h3>7. \u603b\u7ed3\u4e0e\u540e\u7eed\u5efa\u8bae<\/h3>\n<p>\u8d70\u5b8c\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u4f60\u5e94\u8be5\u5df2\u7ecf\u6210\u529f\u5730\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4e86\u4e00\u4e2a\u53ef\u4ee5\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u7684Phi-3-mini-4k-instruct\u6a21\u578b\u670d\u52a1\u3002\u6574\u4e2a\u8fc7\u7a0b\u4ece\u7cfb\u7edf\u51c6\u5907\u3001\u5b89\u5168\u914d\u7f6e\u5230API\u96c6\u6210\u548c\u76d1\u63a7&#xff0c;\u8986\u76d6\u4e86\u8fd0\u7ef4\u5de5\u7a0b\u5e08\u9700\u8981\u5173\u6ce8\u7684\u6838\u5fc3\u73af\u8282\u3002<\/p>\n<p>\u5b9e\u9645\u7528\u4e0b\u6765&#xff0c;Phi-3-mini\u5728\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u4e0b\u8868\u73b0\u786e\u5b9e\u4ee4\u4eba\u5370\u8c61\u6df1\u523b&#xff0c;\u54cd\u5e94\u901f\u5ea6\u5f88\u5feb&#xff0c;\u5bf9\u4e8e\u4ee3\u7801\u751f\u6210\u3001\u6587\u672c\u6458\u8981\u3001\u95ee\u7b54\u7b49\u4efb\u52a1\u8db3\u591f\u80dc\u4efb\u3002\u5b89\u5168\u65b9\u9762&#xff0c;\u901a\u8fc7\u9632\u706b\u5899\u548c\u7f51\u7edc\u9694\u79bb\u505a\u597d\u7b2c\u4e00\u9053\u9632\u7ebf\u81f3\u5173\u91cd\u8981&#xff0c;\u957f\u8fdc\u6765\u770b&#xff0c;\u7ed3\u5408\u53cd\u5411\u4ee3\u7406\u548c\u8ba4\u8bc1\u673a\u5236\u4f1a\u8ba9\u670d\u52a1\u66f4\u7a33\u56fa\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6253\u7b97\u6df1\u5165\u4f7f\u7528&#xff0c;\u4e0b\u4e00\u6b65\u53ef\u4ee5\u8003\u8651\u7ed3\u5408LangChain\u7b49\u6846\u67b6\u6784\u5efa\u66f4\u590d\u6742\u7684AI\u5e94\u7528\u6d41\u6c34\u7ebf&#xff0c;\u6216\u8005\u9488\u5bf9\u4f60\u7684\u7279\u5b9a\u4e1a\u52a1\u6570\u636e\u5bf9\u6a21\u578b\u8fdb\u884c\u5fae\u8c03\u3002\u90e8\u7f72\u53ea\u662f\u8d77\u70b9&#xff0c;\u5982\u4f55\u8ba9\u8fd9\u4e2a\u201c\u8f7b\u91cf\u7ea7\u5927\u8111\u201d\u5728\u4f60\u7684\u4e1a\u52a1\u573a\u666f\u4e2d\u53d1\u6325\u6700\u5927\u4ef7\u503c&#xff0c;\u624d\u662f\u66f4\u6709\u8da3\u7684\u6311\u6218\u3002<\/p>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668&#xff1a;\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357<br \/>\n\u5982\u679c\u4f60\u662f\u4e00\u540d\u8fd0\u7ef4\u5de5\u7a0b\u5e08&#xff0c;\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u65e2\u8f7b\u91cf\u53c8\u5f3a\u5927\u7684\u8bed\u8a00\u6a21\u578b\u6765\u90e8\u7f72\u5230\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u4e0a&#xff0c;\u90a3\u4e48Phi-3-mini-4k-instruct\u5f88\u53ef\u80fd\u5c31\u662f\u4f60\u7684\u83dc\u3002\u8fd9\u4e2a\u7531\u5fae\u8f6f\u5f00\u6e90\u7684\u6a21\u578b&#xff0c;\u867d\u7136\u53ea\u670938\u4ebf\u53c2\u6570&#xff0c;\u4f46\u5728\u5e38\u8bc6\u3001\u903b\u8f91\u63a8\u7406\u3001\u4ee3\u7801\u751f\u6210\u7b49\u4efb\u52a1\u4e0a\u7684\u8868\u73b0&#xff0c;\u636e\u8bf4\u80fd\u548c\u4e00\u4e9b\u53c2\u6570\u591a\u597d\u51e0\u500d\u7684\u6a21\u578b\u63b0\u63b0\u624b\u8155\u3002<br \/>\n\u66f4\u91cd\u8981\u7684\u662f&amp;#xff0<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7591,8797,126,956],"topic":[],"class_list":["post-79145","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-phi-3","tag-ollama","tag-956"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/79145.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668&#xff1a;\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 \u5982\u679c\u4f60\u662f\u4e00\u540d\u8fd0\u7ef4\u5de5\u7a0b\u5e08&#xff0c;\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u65e2\u8f7b\u91cf\u53c8\u5f3a\u5927\u7684\u8bed\u8a00\u6a21\u578b\u6765\u90e8\u7f72\u5230\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u4e0a&#xff0c;\u90a3\u4e48Phi-3-mini-4k-instruct\u5f88\u53ef\u80fd\u5c31\u662f\u4f60\u7684\u83dc\u3002\u8fd9\u4e2a\u7531\u5fae\u8f6f\u5f00\u6e90\u7684\u6a21\u578b&#xff0c;\u867d\u7136\u53ea\u670938\u4ebf\u53c2\u6570&#xff0c;\u4f46\u5728\u5e38\u8bc6\u3001\u903b\u8f91\u63a8\u7406\u3001\u4ee3\u7801\u751f\u6210\u7b49\u4efb\u52a1\u4e0a\u7684\u8868\u73b0&#xff0c;\u636e\u8bf4\u80fd\u548c\u4e00\u4e9b\u53c2\u6570\u591a\u597d\u51e0\u500d\u7684\u6a21\u578b\u63b0\u63b0\u624b\u8155\u3002 \u66f4\u91cd\u8981\u7684\u662f&amp;#xff0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/79145.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-01T00:48:55+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79145.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/79145.html\",\"name\":\"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-01T00:48:55+00:00\",\"dateModified\":\"2026-03-01T00:48:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/79145.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/79145.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79145.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/79145.html","og_locale":"zh_CN","og_type":"article","og_title":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668&#xff1a;\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 \u5982\u679c\u4f60\u662f\u4e00\u540d\u8fd0\u7ef4\u5de5\u7a0b\u5e08&#xff0c;\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u65e2\u8f7b\u91cf\u53c8\u5f3a\u5927\u7684\u8bed\u8a00\u6a21\u578b\u6765\u90e8\u7f72\u5230\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u4e0a&#xff0c;\u90a3\u4e48Phi-3-mini-4k-instruct\u5f88\u53ef\u80fd\u5c31\u662f\u4f60\u7684\u83dc\u3002\u8fd9\u4e2a\u7531\u5fae\u8f6f\u5f00\u6e90\u7684\u6a21\u578b&#xff0c;\u867d\u7136\u53ea\u670938\u4ebf\u53c2\u6570&#xff0c;\u4f46\u5728\u5e38\u8bc6\u3001\u903b\u8f91\u63a8\u7406\u3001\u4ee3\u7801\u751f\u6210\u7b49\u4efb\u52a1\u4e0a\u7684\u8868\u73b0&#xff0c;\u636e\u8bf4\u80fd\u548c\u4e00\u4e9b\u53c2\u6570\u591a\u597d\u51e0\u500d\u7684\u6a21\u578b\u63b0\u63b0\u624b\u8155\u3002 \u66f4\u91cd\u8981\u7684\u662f&amp;#xff0","og_url":"https:\/\/www.wsisp.com\/helps\/79145.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-01T00:48:55+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/79145.html","url":"https:\/\/www.wsisp.com\/helps\/79145.html","name":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-01T00:48:55+00:00","dateModified":"2026-03-01T00:48:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/79145.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/79145.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/79145.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Phi-3-mini-4k-instruct\u4e0eUbuntu\u670d\u52a1\u5668\uff1a\u751f\u4ea7\u73af\u5883\u90e8\u7f72\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=79145"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79145\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=79145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=79145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=79145"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=79145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}