{"id":76911,"date":"2026-02-23T14:45:29","date_gmt":"2026-02-23T06:45:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/76911.html"},"modified":"2026-02-23T14:45:29","modified_gmt":"2026-02-23T06:45:29","slug":"%e5%86%85%e7%bd%91%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%a9%e8%bd%ac%e5%a4%a7%e6%a8%a1%e5%9e%8b%ef%bc%9aollama%e7%a6%bb%e7%ba%bf%e5%ae%89%e8%a3%85%e9%80%9a%e4%b9%89%e5%8d%83%e9%97%ae%e6%9c%ac%e5%9c%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/76911.html","title":{"rendered":"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55"},"content":{"rendered":"<h2>\u5185\u7f51\u73af\u5883\u4e0b\u7684\u4f01\u4e1a\u7ea7\u5927\u6a21\u578b\u90e8\u7f72\u5b9e\u6218&#xff1a;\u4eceOllama\u79bb\u7ebf\u5b89\u88c5\u5230\u79c1\u6709\u5316AI\u5e94\u7528\u6784\u5efa<\/h2>\n<p>\u5728\u91d1\u878d\u98ce\u63a7\u3001\u533b\u7597\u8bca\u65ad\u3001\u6cd5\u5f8b\u6587\u4e66\u5206\u6790\u7b49\u5bf9\u6570\u636e\u9690\u79c1\u548c\u5408\u89c4\u6027\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df&#xff0c;\u4f01\u4e1a\u6838\u5fc3\u6570\u636e\u5982\u540c\u751f\u547d\u7ebf&#xff0c;\u7edd\u4e0d\u5141\u8bb8\u79bb\u5f00\u5185\u90e8\u7f51\u7edc\u3002\u7136\u800c&#xff0c;AI\u5927\u6a21\u578b\u5e26\u6765\u7684\u6548\u7387\u9769\u547d\u53c8\u8ba9\u4eba\u65e0\u6cd5\u5ffd\u89c6\u3002\u5982\u4f55\u5728\u5b8c\u5168\u9694\u79bb\u7684\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5b89\u5168\u3001\u7a33\u5b9a\u5730\u90e8\u7f72\u548c\u8fd0\u884c\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u79c1\u6709\u5316\u5927\u6a21\u578b&#xff0c;\u5e76\u5c06\u5176\u65e0\u7f1d\u96c6\u6210\u5230\u73b0\u6709\u4e1a\u52a1\u7cfb\u7edf\u4e2d&#xff0c;\u6210\u4e3a\u4e86\u8bb8\u591a\u6280\u672f\u56e2\u961f\u9762\u4e34\u7684\u6838\u5fc3\u6311\u6218\u3002\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u4e0b\u8f7d\u4e00\u4e2a\u8f6f\u4ef6\u90a3\u4e48\u7b80\u5355&#xff0c;\u5b83\u6d89\u53ca\u79bb\u7ebf\u4f9d\u8d56\u7ba1\u7406\u3001\u5f02\u6784\u8ba1\u7b97\u8d44\u6e90\u9002\u914d\u3001\u670d\u52a1\u9ad8\u53ef\u7528\u914d\u7f6e\u4ee5\u53ca\u4e0e\u4f01\u4e1a\u7ea7\u5f00\u53d1\u6846\u67b6\u7684\u6df1\u5ea6\u6574\u5408\u3002\u672c\u6587\u5c06\u4ece\u4e00\u4e2a\u771f\u5b9e\u7684\u91d1\u878d\u79d1\u6280\u9879\u76ee\u89c6\u89d2\u51fa\u53d1&#xff0c;\u8be6\u7ec6\u62c6\u89e3\u5728\u65e0\u5916\u7f51\u8bbf\u95ee\u7684Linux\u670d\u52a1\u5668\u4e0a&#xff0c;\u5b8c\u6210Ollama\u5f15\u64ce\u7684\u5b8c\u6574\u79bb\u7ebf\u90e8\u7f72&#xff0c;\u5e76\u4ee5\u901a\u4e49\u5343\u95ee\u6a21\u578b\u4e3a\u4f8b&#xff0c;\u6784\u5efa\u4e00\u4e2a\u53ef\u901a\u8fc7HTTP API\u548cSpringBoot\u5fae\u670d\u52a1\u8c03\u7528\u7684\u5185\u90e8\u667a\u80fd\u95ee\u7b54\u7cfb\u7edf\u3002\u6574\u4e2a\u8fc7\u7a0b\u5c06\u7ed5\u8fc7\u6240\u6709\u5728\u7ebf\u5b89\u88c5\u7684\u201c\u6377\u5f84\u201d&#xff0c;\u76f4\u9762\u5185\u7f51\u90e8\u7f72\u4e2d\u6700\u68d8\u624b\u7684\u5b9e\u9645\u95ee\u9898\u3002<\/p>\n<h3>1. \u6218\u524d\u51c6\u5907&#xff1a;\u7406\u89e3\u5185\u7f51\u90e8\u7f72\u7684\u6838\u5fc3\u903b\u8f91\u4e0e\u8d44\u6e90\u89c4\u5212<\/h3>\n<p>\u5728\u6309\u4e0b\u7b2c\u4e00\u4e2a\u547d\u4ee4\u4e4b\u524d&#xff0c;\u6e05\u6670\u7684\u84dd\u56fe\u6bd4\u76f2\u76ee\u7684\u64cd\u4f5c\u66f4\u91cd\u8981\u3002\u5185\u7f51\u90e8\u7f72\u5927\u6a21\u578b&#xff0c;\u672c\u8d28\u4e0a\u662f\u5728\u6784\u5efa\u4e00\u4e2a\u81ea\u7ed9\u81ea\u8db3\u7684\u201c\u6570\u5b57\u5b64\u5c9b\u201d\u3002\u8fd9\u610f\u5473\u7740\u6240\u6709\u5728\u6807\u51c6\u5728\u7ebf\u6559\u7a0b\u4e2d\u201c\u4e00\u952e\u4e0b\u8f7d\u201d\u7684\u6b65\u9aa4&#xff0c;\u5728\u8fd9\u91cc\u90fd\u9700\u8981\u8f6c\u5316\u4e3a\u201c\u624b\u52a8\u642c\u8fd0\u201d\u548c\u201c\u9884\u5148\u51c6\u5907\u201d\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u4f60\u9700\u8981\u660e\u786e\u90e8\u7f72\u76ee\u6807\u670d\u52a1\u5668\u7684\u201c\u5bb6\u5e95\u201d\u3002\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u770bCPU\u662fx86_64\u8fd8\u662fARM64&#xff0c;\u66f4\u8981\u5173\u6ce8\u5176\u8ba1\u7b97\u80fd\u529b\u6784\u6210\u3002\u4f8b\u5982&#xff0c;\u4e00\u53f0\u7528\u4e8eAI\u63a8\u7406\u7684\u670d\u52a1\u5668\u53ef\u80fd\u914d\u5907\u4e86NVIDIA GPU\u3001AMD GPU&#xff0c;\u6216\u8005\u4ec5\u4f9d\u8d56\u9ad8\u6027\u80fdCPU\u3002\u4e0d\u540c\u7684\u786c\u4ef6\u7ec4\u5408&#xff0c;\u51b3\u5b9a\u4e86\u540e\u7eed\u9700\u8981\u51c6\u5907\u7684\u4f9d\u8d56\u5305\u5b8c\u5168\u4e0d\u540c\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5feb\u901f\u5b8c\u6210\u786c\u4ef6\u5ba1\u8ba1&#xff1a;<\/p>\n<p># \u67e5\u770bCPU\u67b6\u6784<br \/>\narch<br \/>\n# \u6216<br \/>\nuname -m<\/p>\n<p># \u67e5\u770b\u8be6\u7ec6CPU\u4fe1\u606f<br \/>\nlscpu<\/p>\n<p># \u68c0\u67e5NVIDIA GPU&#xff08;\u5982\u679c\u670d\u52a1\u5668\u6709NVIDIA\u9a71\u52a8&#xff09;<br \/>\nnvidia-smi<\/p>\n<p># \u68c0\u67e5AMD GPU&#xff08;\u901a\u8fc7PCI\u8bbe\u5907\u4fe1\u606f&#xff09;<br \/>\nlspci | grep -i amd<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5728\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;lspci\u3001lshw\u7b49\u786c\u4ef6\u63a2\u6d4b\u5de5\u5177\u53ef\u80fd\u9ed8\u8ba4\u672a\u5b89\u88c5\u3002\u4f60\u9700\u8981\u5728\u51c6\u5907\u9636\u6bb5&#xff0c;\u5c31\u5c06\u8fd9\u4e9b\u5de5\u5177\u7684\u5b89\u88c5\u5305&#xff08;\u5982pciutils\u3001usbutils\u7684RPM\u6216DEB\u5305&#xff09;\u7eb3\u5165\u79bb\u7ebf\u8d44\u6e90\u6e05\u5355\u3002<\/p>\n<p>\u5176\u6b21&#xff0c;\u89c4\u5212\u597d\u8f6f\u4ef6\u8d44\u6e90\u7684\u79bb\u7ebf\u4ed3\u5e93\u3002\u4f60\u9700\u8981\u4e00\u4e2a\u4e2d\u95f4\u8df3\u677f\u673a&#xff08;\u5177\u5907\u5916\u7f51\u8bbf\u95ee\u6743\u9650&#xff09;&#xff0c;\u7528\u4e8e\u4e0b\u8f7d\u6240\u6709\u5fc5\u9700\u7684\u5b89\u88c5\u5305\u3001\u4e8c\u8fdb\u5236\u6587\u4ef6\u548c\u6a21\u578b\u6587\u4ef6\u3002\u5efa\u8bae\u6309\u4ee5\u4e0b\u76ee\u5f55\u7ed3\u6784\u8fdb\u884c\u7ec4\u7ec7&#xff0c;\u8fd9\u5c06\u6781\u5927\u907f\u514d\u540e\u7eed\u90e8\u7f72\u65f6\u7684\u6df7\u4e71&#xff1a;<\/p>\n<p>\/offline_packages\/<br \/>\n\u251c\u2500\u2500 ollama\/<br \/>\n\u2502   \u251c\u2500\u2500 ollama-linux-amd64 (\u6216arm64)          # Ollama\u4e3b\u4e8c\u8fdb\u5236\u6587\u4ef6<br \/>\n\u2502   \u2514\u2500\u2500 install_offline.sh                    # \u6211\u4eec\u6539\u9020\u540e\u7684\u79bb\u7ebf\u5b89\u88c5\u811a\u672c<br \/>\n\u251c\u2500\u2500 system_deps\/                              # \u7cfb\u7edf\u7ea7\u4f9d\u8d56\u5305<br \/>\n\u2502   \u251c\u2500\u2500 centos_rpms\/                          # \u9488\u5bf9CentOS\/RHEL\u7684rpm\u5305<br \/>\n\u2502   \u2514\u2500\u2500 ubuntu_debs\/                          # \u9488\u5bf9Ubuntu\/Debian\u7684deb\u5305<br \/>\n\u251c\u2500\u2500 gpu_drivers\/                              # GPU\u76f8\u5173\u4f9d\u8d56<br \/>\n\u2502   \u251c\u2500\u2500 rocm_libs.tar.gz                      # AMD ROCm\u79bb\u7ebf\u5e93&#xff08;\u5982\u679c\u9700\u8981&#xff09;<br \/>\n\u2502   \u2514\u2500\u2500 cuda_driver_offline\/                  # NVIDIA\u9a71\u52a8\u79bb\u7ebf\u5b89\u88c5\u5305&#xff08;\u53ef\u9009&#xff09;<br \/>\n\u251c\u2500\u2500 models\/                                   # \u9884\u4e0b\u8f7d\u7684\u6a21\u578b\u6587\u4ef6<br \/>\n\u2502   \u2514\u2500\u2500 qwen:7b                               # \u4f8b\u5982\u901a\u4e49\u5343\u95ee7B\u6a21\u578b\u6587\u4ef6<br \/>\n\u2514\u2500\u2500 sdk_libs\/                                 # \u5e94\u7528\u5c42\u4f9d\u8d56<br \/>\n    \u251c\u2500\u2500 python_packages\/                      # pip\u79bb\u7ebf\u5305<br \/>\n    \u2514\u2500\u2500 java_maven_deps\/                      # Maven\u4ed3\u5e93\u79bb\u7ebf\u5305<\/p>\n<p>\u8fd9\u4e2a\u4ed3\u5e93\u7ed3\u6784\u662f\u4f60\u672c\u6b21\u90e8\u7f72\u884c\u52a8\u7684\u201c\u5f39\u836f\u5e93\u201d&#xff0c;\u5b83\u7684\u5b8c\u5907\u6027\u76f4\u63a5\u51b3\u5b9a\u4e86\u5185\u7f51\u90e8\u7f72\u7684\u6210\u8d25\u3002<\/p>\n<h3>2. Ollama\u5f15\u64ce\u7684\u201c\u5916\u79d1\u624b\u672f\u5f0f\u201d\u79bb\u7ebf\u5b89\u88c5<\/h3>\n<p>\u6807\u51c6\u7684Ollama\u5b89\u88c5\u811a\u672c\u4f1a\u52a8\u6001\u5730\u4eceGitHub\u548c\u5176\u5b98\u7f51\u62c9\u53d6\u8d44\u6e90&#xff0c;\u8fd9\u5728\u65ad\u7f51\u73af\u5883\u4e0b\u4f1a\u7acb\u523b\u5931\u8d25\u3002\u56e0\u6b64&#xff0c;\u6211\u4eec\u7684\u6838\u5fc3\u7b56\u7565\u662f\u5bf9\u5b98\u65b9\u5b89\u88c5\u811a\u672c\u8fdb\u884c\u201c\u9759\u6001\u5316\u201d\u6539\u9020&#xff0c;\u5c06\u5176\u6240\u6709\u7f51\u7edc\u8bf7\u6c42\u6307\u5411\u6211\u4eec\u9884\u5148\u51c6\u5907\u597d\u7684\u672c\u5730\u6587\u4ef6\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u83b7\u53d6\u5e76\u89e3\u5256\u5b98\u65b9\u811a\u672c\u3002<br \/>\n\u5728\u8df3\u677f\u673a\u4e0a&#xff0c;\u4e0b\u8f7d\u6700\u65b0\u7248\u7684Ollama Linux\u5b89\u88c5\u811a\u672c\u3002\u6211\u4eec\u4ee5\u5b83\u4e3a\u57fa\u7840\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p>curl -fsSL https:\/\/ollama.com\/install.sh -o install.sh<\/p>\n<p>\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u8fd9\u4e2a\u811a\u672c&#xff0c;\u4f60\u4f1a\u53d1\u73b0\u5b83\u7684\u6838\u5fc3\u903b\u8f91\u5305\u62ec&#xff1a;\u68c0\u6d4b\u67b6\u6784\u3001\u4e0b\u8f7d\u5bf9\u5e94\u4e8c\u8fdb\u5236\u6587\u4ef6\u3001\u521b\u5efa\u7cfb\u7edf\u7528\u6237\u3001\u914d\u7f6esystemd\u670d\u52a1\u3001\u68c0\u6d4b\u5e76\u5b89\u88c5GPU\u4f9d\u8d56\u3002\u6211\u4eec\u9700\u8981\u91cd\u70b9\u5173\u6ce8\u5176\u4e2d\u4ee5curl\u6216download\u5f00\u5934\u7684\u884c\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;\u5236\u4f5c\u79bb\u7ebf\u4e8c\u8fdb\u5236\u5305\u4e0e\u4f9d\u8d56\u3002<br \/>\n\u6839\u636e\u76ee\u6807\u670d\u52a1\u5668\u7684\u67b6\u6784&#xff08;\u5047\u8bbe\u4e3ax86_64&#xff09;&#xff0c;\u4eceOllama\u7684GitHub Releases\u9875\u9762\u4e0b\u8f7d\u5bf9\u5e94\u7684\u9759\u6001\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u540c\u65f6&#xff0c;\u5982\u679c\u670d\u52a1\u5668\u6709AMD GPU&#xff0c;\u8fd8\u9700\u8981\u4e0b\u8f7dROCm\u7684\u79bb\u7ebf\u4f9d\u8d56\u5305\u3002<\/p>\n<p>\u9700\u8981\u4e0b\u8f7d\u7684\u6587\u4ef6\u6e05\u5355&#xff1a;<br \/>\n1. https:\/\/github.com\/ollama\/ollama\/releases\/download\/v0.1.31\/ollama-linux-amd64<br \/>\n2. https:\/\/ollama.com\/download\/ollama-linux-amd64-rocm.tgz (\u4ec5AMD GPU\u9700\u8981)<\/p>\n<p>\u5c06\u8fd9\u4e9b\u6587\u4ef6\u653e\u5165\u4e4b\u524d\u89c4\u5212\u597d\u7684\/offline_packages\/ollama\/\u76ee\u5f55\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff1a;\u91cd\u5199\u5b89\u88c5\u811a\u672c\u7684\u5173\u952e\u6bb5\u843d\u3002<br \/>\n\u8fd9\u662f\u6700\u5177\u6280\u5de7\u6027\u7684\u90e8\u5206\u3002\u6211\u4eec\u9700\u8981\u6ce8\u91ca\u6389\u6216\u66ff\u6362\u811a\u672c\u4e2d\u6240\u6709\u4ece\u7f51\u7edc\u4e0b\u8f7d\u7684\u4ee3\u7801&#xff0c;\u6539\u4e3a\u4ece\u672c\u5730\u8def\u5f84\u590d\u5236\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5173\u952e\u4fee\u6539\u793a\u4f8b&#xff08;\u539f\u811a\u672c\u7684\u4e0b\u8f7d\u90e8\u5206&#xff09;&#xff1a;<\/p>\n<p># \u539f\u811a\u672c\u4e2d\u7684\u4e0b\u8f7d\u884c&#xff08;\u9700\u8981\u88ab\u66ff\u6362\u6216\u6ce8\u91ca&#xff09;<br \/>\n# status &#034;Downloading ollama&#8230;&#034;<br \/>\n# curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar -o $TEMP_DIR\/ollama &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}${VER_PARAM}&#034;<\/p>\n<p># \u4fee\u6539\u4e3a\u4ece\u672c\u5730\u8def\u5f84\u590d\u5236<br \/>\nstatus &#034;Copying ollama binary from local offline package&#8230;&#034;<br \/>\ncp \/path\/to\/your\/offline_packages\/ollama\/ollama-linux-${ARCH} $TEMP_DIR\/ollama<\/p>\n<p>\u5bf9\u4e8eAMD ROCm\u4f9d\u8d56\u7684\u5b89\u88c5\u90e8\u5206&#xff0c;\u540c\u6837\u9700\u8981\u4fee\u6539&#xff1a;<\/p>\n<p># \u539f\u811a\u672c<br \/>\n# curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar &#034;https:\/\/ollama.com\/download\/ollama-linux-amd64-rocm.tgz${VER_PARAM}&#034; \\\\<br \/>\n#  | $SUDO tar zx &#8211;owner ollama &#8211;group ollama -C \/usr\/share\/ollama\/lib\/rocm .<\/p>\n<p># \u4fee\u6539\u540e<br \/>\nstatus &#034;Installing AMD ROCm dependencies from local archive&#8230;&#034;<br \/>\n$SUDO tar zxf \/path\/to\/your\/offline_packages\/gpu_drivers\/ollama-linux-amd64-rocm.tgz \\\\<br \/>\n     &#8211;owner ollama &#8211;group ollama -C \/usr\/share\/ollama\/lib\/rocm<\/p>\n<p>\u7b2c\u56db\u6b65&#xff1a;\u5904\u7406\u7cfb\u7edf\u5de5\u5177\u4f9d\u8d56\u3002<br \/>\n\u5b89\u88c5\u811a\u672c\u4f1a\u68c0\u67e5curl\u3001awk\u3001grep\u7b49\u57fa\u7840\u5de5\u5177\u3002\u5728\u5185\u7f51\u7eaf\u51c0\u7cfb\u7edf\u4e2d&#xff0c;\u8fd9\u4e9b\u5de5\u5177\u53ef\u80fd\u4e5f\u4e0d\u5b58\u5728\u3002\u56e0\u6b64&#xff0c;\u4f60\u9700\u8981\u5728\u8fd0\u884c\u6539\u9020\u540e\u7684\u5b89\u88c5\u811a\u672c\u4e4b\u524d&#xff0c;\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684\u79bb\u7ebf\u5305\u7ba1\u7406\u5668\u624b\u52a8\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u3002\u4f8b\u5982&#xff0c;\u5728RHEL\/CentOS\u4e0a&#xff1a;<\/p>\n<p># \u5047\u8bbe\u4f60\u5df2\u7ecf\u5c06\u5bf9\u5e94\u7684rpm\u5305\u653e\u5728\u4e86 \/offline_packages\/system_deps\/centos_rpms\/<br \/>\nsudo rpm -ivh \/offline_packages\/system_deps\/centos_rpms\/curl*.rpm<br \/>\nsudo rpm -ivh \/offline_packages\/system_deps\/centos_rpms\/grep*.rpm<br \/>\n# &#8230; \u5b89\u88c5\u5176\u4ed6\u5fc5\u8981\u5de5\u5177<\/p>\n<p>\u7b2c\u4e94\u6b65&#xff1a;\u6267\u884c\u79bb\u7ebf\u5b89\u88c5\u3002<br \/>\n\u5c06\u4fee\u6539\u597d\u7684install_offline.sh\u811a\u672c\u548c\u6240\u6709\u79bb\u7ebf\u8d44\u6e90&#xff0c;\u901a\u8fc7U\u76d8\u6216\u5185\u90e8\u6587\u4ef6\u670d\u52a1\u5668\u4f20\u8f93\u5230\u76ee\u6807\u5185\u7f51\u673a\u5668\u3002\u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650\u5e76\u8fd0\u884c&#xff1a;<\/p>\n<p>chmod &#043;x install_offline.sh<br \/>\nsudo .\/install_offline.sh<\/p>\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229&#xff0c;\u811a\u672c\u5c06\u4e0d\u518d\u5c1d\u8bd5\u8bbf\u95ee\u4efb\u4f55\u5916\u90e8\u7f51\u7edc&#xff0c;\u800c\u662f\u76f4\u63a5\u4ece\u672c\u5730\u8def\u5f84\u83b7\u53d6\u6240\u6709\u8d44\u6e90&#xff0c;\u5b8c\u6210Ollama\u7684\u5b89\u88c5\u548csystemd\u670d\u52a1\u914d\u7f6e\u3002<\/p>\n<h3>3. \u6a21\u578b\u6587\u4ef6\u7684\u79bb\u7ebf\u5bfc\u5165\u4e0e\u5b58\u50a8\u7b56\u7565\u4f18\u5316<\/h3>\n<p>\u5b89\u88c5\u597dOllama\u5f15\u64ce\u540e&#xff0c;\u4e0b\u4e00\u4e2a\u96be\u9898\u662f\u5982\u4f55\u5728\u6ca1\u6709\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\u201c\u5582\u201d\u7ed9\u5b83\u4e00\u4e2a\u5927\u6a21\u578b\u3002Ollama\u9ed8\u8ba4\u7684\u6a21\u578b\u5b58\u50a8\u8def\u5f84\u662f\/usr\/share\/ollama\/.ollama\/models&#xff0c;\u4f46\u51fa\u4e8e\u6570\u636e\u7ba1\u7406\u548c\u78c1\u76d8\u7a7a\u95f4\u8003\u8651&#xff0c;\u6211\u4eec\u901a\u5e38\u9700\u8981\u81ea\u5b9a\u4e49\u8fd9\u4e2a\u4f4d\u7f6e\u3002<\/p>\n<p>\u65b9\u6cd5\u4e00&#xff1a;\u901a\u8fc7OLLAMA_MODELS\u73af\u5883\u53d8\u91cf&#xff08;\u63a8\u8350&#xff09;\u3002<br \/>\n\u8fd9\u662f\u6700\u5e72\u51c0\u7684\u65b9\u5f0f\u3002\u5728\u542f\u52a8Ollama\u670d\u52a1\u4e4b\u524d&#xff0c;\u901a\u8fc7systemd\u670d\u52a1\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf\u6765\u6307\u5b9a\u6a21\u578b\u5e93\u8def\u5f84\u3002<\/p>\n<li>\u7f16\u8f91Ollama\u7684systemd\u670d\u52a1\u6587\u4ef6&#xff1a;sudo vi \/etc\/systemd\/system\/ollama.service\n<\/li>\n<li>\u5728[Service]\u90e8\u5206\u6dfb\u52a0\u73af\u5883\u53d8\u91cf&#xff0c;\u6307\u5411\u4e00\u4e2a\u7a7a\u95f4\u5145\u8db3\u7684\u5206\u533a&#xff0c;\u6bd4\u5982\/data\/ollama_models&#xff1a;[Service]<br \/>\nEnvironment&#061;&#034;OLLAMA_MODELS&#061;\/data\/ollama_models&#034;<br \/>\nExecStart&#061;\/usr\/bin\/ollama serve<br \/>\nUser&#061;ollama<br \/>\n&#8230;<\/p>\n<\/li>\n<li>\u4fdd\u5b58\u540e&#xff0c;\u91cd\u65b0\u52a0\u8f7dsystemd\u5e76\u91cd\u542f\u670d\u52a1&#xff1a;sudo systemctl daemon-reload<br \/>\nsudo systemctl restart ollama<\/p>\n<\/li>\n<p>\u65b9\u6cd5\u4e8c&#xff1a;\u624b\u52a8\u5bfc\u5165\u6a21\u578b\u6587\u4ef6\u3002<br \/>\n\u73b0\u5728&#xff0c;\u6211\u4eec\u9700\u8981\u5c06\u9884\u5148\u5728\u8df3\u677f\u673a\u4e0a\u4e0b\u8f7d\u597d\u7684\u6a21\u578b\u6587\u4ef6&#xff08;\u4f8b\u5982qwen:7b&#xff09;\u5bfc\u5165\u5230\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u76ee\u5f55\u3002Ollama\u7684\u6a21\u578b\u5b58\u50a8\u5e76\u975e\u7b80\u5355\u7684\u5355\u4e2a\u6587\u4ef6&#xff0c;\u5b83\u5305\u542bblobs\u548cmanifests\u4e24\u4e2a\u5b50\u76ee\u5f55&#xff0c;\u7ed3\u6784\u8f83\u4e3a\u590d\u6742\u3002\u6700\u53ef\u9760\u7684\u65b9\u5f0f\u662f\u5728\u8df3\u677f\u673a\u4e0a&#xff0c;\u5229\u7528Ollama\u7684\u547d\u4ee4\u884c\u5de5\u5177\u5c06\u6a21\u578b\u201c\u62c9\u53d6\u201d\u5230\u672c\u5730&#xff0c;\u7136\u540e\u5c06\u6574\u4e2a.ollama\/models\u76ee\u5f55\u6253\u5305\u3002<\/p>\n<p>\u5728\u8df3\u677f\u673a\u4e0a\u64cd\u4f5c&#xff1a;<\/p>\n<p># 1. \u5728\u8df3\u677f\u673a\u6b63\u5e38\u5b89\u88c5Ollama<br \/>\n# 2. \u62c9\u53d6\u6240\u9700\u6a21\u578b&#xff0c;\u8fd9\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5230\u9ed8\u8ba4\u76ee\u5f55<br \/>\nollama pull qwen:7b<br \/>\n# 3. \u627e\u5230\u6a21\u578b\u5b58\u50a8\u76ee\u5f55\u5e76\u6253\u5305<br \/>\ntar -czf qwen7b_model.tar.gz -C \/usr\/share\/ollama\/.ollama\/models .<\/p>\n<p>\u5c06\u6253\u5305\u597d\u7684qwen7b_model.tar.gz\u4f20\u8f93\u5230\u5185\u7f51\u670d\u52a1\u5668&#xff0c;\u89e3\u538b\u5230\u81ea\u5b9a\u4e49\u7684\u6a21\u578b\u76ee\u5f55&#xff1a;<\/p>\n<p>sudo mkdir -p \/data\/ollama_models<br \/>\nsudo tar -xzf qwen7b_model.tar.gz -C \/data\/ollama_models<br \/>\nsudo chown -R ollama:ollama \/data\/ollama_models<\/p>\n<p>\u5b8c\u6210\u540e&#xff0c;\u5728\u5185\u7f51\u670d\u52a1\u5668\u4e0a&#xff0c;\u4f60\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u8be5\u6a21\u578b&#xff0c;\u800c\u65e0\u9700\u7f51\u7edc\u4e0b\u8f7d&#xff1a;<\/p>\n<p>ollama run qwen:7b<\/p>\n<p>\u63d0\u793a&#xff1a;\u5bf9\u4e8e\u8d85\u5927\u578b\u6a21\u578b&#xff08;\u5982\u767e\u4ebf\u53c2\u6570&#xff09;&#xff0c;\u6a21\u578b\u6587\u4ef6\u53ef\u80fd\u9ad8\u8fbe\u6570\u5341GB\u3002\u5728\u901a\u8fc7\u7269\u7406\u4ecb\u8d28\u4f20\u8f93\u65f6&#xff0c;\u52a1\u5fc5\u4f7f\u7528\u6821\u9a8c\u548c&#xff08;\u5982sha256sum&#xff09;\u786e\u4fdd\u6587\u4ef6\u5b8c\u6574\u6027&#xff0c;\u907f\u514d\u56e0\u4f20\u8f93\u9519\u8bef\u5bfc\u81f4\u540e\u7eed\u52a0\u8f7d\u5931\u8d25\u3002<\/p>\n<h3>4. \u9ad8\u7ea7\u914d\u7f6e&#xff1a;\u591aIP\u7ed1\u5b9a\u3001\u670d\u52a1\u4f18\u5316\u4e0e\u76d1\u63a7<\/h3>\n<p>\u5728\u5185\u7f51\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;Ollama\u670d\u52a1\u53ef\u80fd\u4e0d\u4ec5\u9700\u8981\u88ab\u672c\u673a\u8bbf\u95ee&#xff0c;\u8fd8\u8981\u670d\u52a1\u4e8e\u540c\u4e00\u7f51\u7edc\u4e0b\u7684\u5176\u4ed6\u5e94\u7528\u670d\u52a1\u5668\u3002\u540c\u65f6&#xff0c;\u670d\u52a1\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u89c2\u6d4b\u6027\u4e5f\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p>\u7f51\u7edc\u7ed1\u5b9a\u914d\u7f6e&#xff1a;<br \/>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;Ollama\u670d\u52a1\u53ea\u76d1\u542c127.0.0.1:11434\u3002\u8981\u5141\u8bb8\u5176\u4ed6\u670d\u52a1\u5668\u8bbf\u95ee&#xff0c;\u9700\u8981\u4fee\u6539\u76d1\u542c\u5730\u5740\u3002\u6211\u4eec\u4e4b\u524d\u5df2\u7ecf\u901a\u8fc7OLLAMA_HOST\u73af\u5883\u53d8\u91cf\u505a\u4e86\u521d\u6b65\u914d\u7f6e&#xff08;0.0.0.0:11434&#xff09;\u3002\u4f46\u6709\u65f6\u9700\u6c42\u66f4\u590d\u6742&#xff0c;\u4f8b\u5982\u670d\u52a1\u5668\u6709\u591a\u4e2a\u7f51\u5361&#xff0c;\u4f60\u53ea\u60f3\u8ba9\u670d\u52a1\u76d1\u542c\u5185\u7f51IP&#xff08;\u5982192.168.1.100&#xff09;&#xff0c;\u800c\u4e0d\u662f\u6240\u6709\u63a5\u53e3\u3002\u8fd9\u65f6&#xff0c;\u53ef\u4ee5\u66f4\u7cbe\u786e\u5730\u8bbe\u7f6e&#xff1a;<\/p>\n<p># \u7f16\u8f91\u670d\u52a1\u6587\u4ef6&#xff0c;\u5c06\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u7279\u5b9aIP<br \/>\nsudo vi \/etc\/systemd\/system\/ollama.service<br \/>\n# \u4fee\u6539\u6216\u6dfb\u52a0<br \/>\nEnvironment&#061;&#034;OLLAMA_HOST&#061;192.168.1.100:11434&#034;<\/p>\n<p>systemd\u670d\u52a1\u4f18\u5316&#xff1a;<br \/>\n\u4e3a\u4e86\u63d0\u5347\u670d\u52a1\u7684\u5065\u58ee\u6027&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5bf9systemd\u5355\u5143\u6587\u4ef6\u8fdb\u884c\u4e00\u4e9b\u4f18\u5316\u914d\u7f6e&#xff0c;\u4f8b\u5982\u9650\u5236\u670d\u52a1\u8d44\u6e90\u3001\u914d\u7f6e\u66f4\u7075\u6d3b\u7684\u91cd\u542f\u7b56\u7565\u3002<\/p>\n<p>[Unit]<br \/>\nDescription&#061;Ollama Service<br \/>\nAfter&#061;network-online.target<br \/>\nWants&#061;network-online.target<\/p>\n<p>[Service]<br \/>\nType&#061;simple<br \/>\nUser&#061;ollama<br \/>\nGroup&#061;ollama<br \/>\nEnvironment&#061;&#034;OLLAMA_MODELS&#061;\/data\/ollama_models&#034;<br \/>\nEnvironment&#061;&#034;OLLAMA_HOST&#061;192.168.1.100:11434&#034;<br \/>\nExecStart&#061;\/usr\/bin\/ollama serve<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5s<br \/>\nStartLimitBurst&#061;3<br \/>\nStartLimitInterval&#061;60s<br \/>\n# \u8d44\u6e90\u9650\u5236\u793a\u4f8b (\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574)<br \/>\nLimitNOFILE&#061;65536<br \/>\nLimitMEMLOCK&#061;infinity<br \/>\n# \u5982\u679c\u4f7f\u7528GPU&#xff0c;\u53ef\u80fd\u9700\u8981\u589e\u52a0\u8bbe\u5907\u8bbf\u95ee\u6743\u9650<br \/>\nDeviceAllow&#061;\/dev\/nvidiactl rwm<br \/>\nDeviceAllow&#061;\/dev\/nvidia-uvm rwm<br \/>\nDeviceAllow&#061;\/dev\/nvidia[0-9] rwm<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<p>\u57fa\u7840\u76d1\u63a7\u4e0e\u65e5\u5fd7&#xff1a;<br \/>\nOllama\u81ea\u8eab\u65e5\u5fd7\u53ef\u4ee5\u901a\u8fc7systemd\u7684journalctl\u67e5\u770b&#xff1a;<\/p>\n<p># \u67e5\u770b\u5b9e\u65f6\u65e5\u5fd7<br \/>\nsudo journalctl -u ollama -f<br \/>\n# \u67e5\u770b\u6700\u8fd1100\u884c\u65e5\u5fd7<br \/>\nsudo journalctl -u ollama -n 100<\/p>\n<p>\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883&#xff0c;\u5efa\u8bae\u5c06\u65e5\u5fd7\u5bfc\u51fa\u5230\u96c6\u4e2d\u7684\u65e5\u5fd7\u7cfb\u7edf&#xff08;\u5982ELK&#xff09;\u3002\u540c\u65f6&#xff0c;\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u5065\u5eb7\u68c0\u67e5\u811a\u672c&#xff0c;\u5b9a\u671f\u8c03\u7528Ollama\u7684API\u7aef\u70b9&#xff08;\u5982http:\/\/192.168.1.100:11434\/api\/tags&#xff09;\u6765\u786e\u8ba4\u670d\u52a1\u72b6\u6001&#xff0c;\u5e76\u5c06\u5176\u96c6\u6210\u5230\u73b0\u6709\u7684\u76d1\u63a7\u5e73\u53f0&#xff08;\u5982Zabbix\u3001Prometheus&#xff09;\u4e2d\u3002<\/p>\n<h3>5. \u6784\u5efa\u4f01\u4e1a\u7ea7\u5e94\u7528\u63a5\u53e3&#xff1a;\u4eceHTTP API\u5230SpringBoot\u5fae\u670d\u52a1<\/h3>\n<p>\u5f53Ollama\u670d\u52a1\u5728\u5185\u7f51\u7a33\u5b9a\u8fd0\u884c\u540e&#xff0c;\u4e0b\u4e00\u6b65\u5c31\u662f\u8ba9\u4e1a\u52a1\u7cfb\u7edf\u80fd\u591f\u65b9\u4fbf\u5730\u8c03\u7528\u5b83\u3002Ollama\u539f\u751f\u63d0\u4f9b\u4e86\u7b80\u6d01\u7684HTTP API&#xff0c;\u8fd9\u4e3a\u6211\u4eec\u6784\u5efa\u4e0a\u5c42\u5e94\u7528\u63d0\u4f9b\u4e86\u575a\u5b9e\u57fa\u7840\u3002<\/p>\n<p>\u76f4\u63a5\u4f7f\u7528HTTP API&#xff1a;<br \/>\n\u8fd9\u662f\u6700\u8f7b\u91cf\u3001\u6700\u76f4\u63a5\u7684\u65b9\u5f0f\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u652f\u6301HTTP\u8bf7\u6c42\u7684\u7f16\u7a0b\u8bed\u8a00\u8fdb\u884c\u8c03\u7528\u3002\u4f8b\u5982&#xff0c;\u4e00\u4e2a\u7b80\u5355\u7684\u751f\u6210&#xff08;generate&#xff09;\u63a5\u53e3\u8c03\u7528&#xff1a;<\/p>\n<p>curl http:\/\/192.168.1.100:11434\/api\/generate -H &#034;Content-Type: application\/json&#034; -d &#039;{<br \/>\n  &#034;model&#034;: &#034;qwen:7b&#034;,<br \/>\n  &#034;prompt&#034;: &#034;\u8bf7\u7528\u4e00\u53e5\u8bdd\u89e3\u91ca\u673a\u5668\u5b66\u4e60\u4e2d\u7684\u8fc7\u62df\u5408\u73b0\u8c61\u3002&#034;,<br \/>\n  &#034;stream&#034;: false<br \/>\n}&#039;<\/p>\n<p>\u5bf9\u4e8e\u5bf9\u8bdd&#xff08;chat&#xff09;\u573a\u666f&#xff0c;\u4f7f\u7528messages\u683c\u5f0f\u7684\u63a5\u53e3\u66f4\u5408\u9002&#xff1a;<\/p>\n<p>curl http:\/\/192.168.1.100:11434\/api\/chat -H &#034;Content-Type: application\/json&#034; -d &#039;{<br \/>\n  &#034;model&#034;: &#034;qwen:7b&#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>\u96c6\u6210\u5230SpringBoot\u5fae\u670d\u52a1&#xff08;Java\u751f\u6001&#xff09;&#xff1a;<br \/>\n\u5bf9\u4e8eJava\u6280\u672f\u6808\u7684\u4f01\u4e1a&#xff0c;\u5c06Ollama\u96c6\u6210\u5230SpringBoot\u5e94\u7528\u4e2d\u662f\u76ee\u524d\u975e\u5e38\u6d41\u7545\u7684\u4f53\u9a8c\u3002Spring AI\u9879\u76ee\u63d0\u4f9b\u4e86\u5b98\u65b9\u7684Ollama Starter\u3002<\/p>\n<li>\n<p>\u79bb\u7ebf\u51c6\u5907Maven\u4f9d\u8d56&#xff1a;\u5728\u8df3\u677f\u673a\u4e0a&#xff0c;\u9700\u8981\u5c06\u76f8\u5173\u4f9d\u8d56\u5305\u4e0b\u8f7d\u5230\u672c\u5730Maven\u4ed3\u5e93\u3002<\/p>\n<p>&lt;!&#8211; \u5728\u4f60\u7684\u9879\u76eepom.xml\u4e2d\u58f0\u660e\u4f9d\u8d56 &#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;org.springframework.ai&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;spring-ai-ollama-spring-boot-starter&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;0.8.1&lt;\/version&gt; &lt;!&#8211; \u8bf7\u4f7f\u7528\u6700\u65b0\u7a33\u5b9a\u7248\u672c &#8211;&gt;<br \/>\n&lt;\/dependency&gt;<\/p>\n<p>\u4f7f\u7528mvn dependency:get\u547d\u4ee4\u6216\u5728\u80fd\u8054\u7f51\u7684\u6784\u5efa\u73af\u5883\u4e2d\u6253\u5305\u9879\u76ee&#xff0c;\u7136\u540e\u5c06\u6574\u4e2a\u672c\u5730Maven\u4ed3\u5e93&#xff08;~\/.m2\/repository&#xff09;\u4e2d\u76f8\u5173\u7684jar\u5305\u4f20\u8f93\u5230\u5185\u7f51\u5f00\u53d1\/\u6784\u5efa\u670d\u52a1\u5668\u3002<\/p>\n<\/li>\n<li>\n<p>SpringBoot\u914d\u7f6e&#xff1a;\u5728application.yml\u4e2d\u914d\u7f6eOllama\u8fde\u63a5\u3002<\/p>\n<p>spring:<br \/>\n  ai:<br \/>\n    ollama:<br \/>\n      base-url: http:\/\/192.168.1.100:11434 # \u4f60\u7684\u5185\u7f51Ollama\u670d\u52a1\u5730\u5740<br \/>\n      chat:<br \/>\n        options:<br \/>\n          model: qwen:7b # \u9ed8\u8ba4\u4f7f\u7528\u7684\u6a21\u578b<\/p>\n<\/li>\n<li>\n<p>\u7f16\u5199\u670d\u52a1\u5c42\u4ee3\u7801&#xff1a;\u6ce8\u5165OllamaChatClient\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<p>import org.springframework.ai.chat.client.ChatClient;<br \/>\nimport org.springframework.stereotype.Service;<\/p>\n<p>&#064;Service<br \/>\npublic class AIChatService {<\/p>\n<p>    private final ChatClient chatClient;<\/p>\n<p>    public AIChatService(ChatClient.Builder chatClientBuilder) {<br \/>\n        this.chatClient &#061; chatClientBuilder.build();<br \/>\n    }<\/p>\n<p>    public String chat(String userMessage) {<br \/>\n        return chatClient.prompt()<br \/>\n                .user(userMessage)<br \/>\n                .call()<br \/>\n                .content();<br \/>\n    }<\/p>\n<p>    \/\/ \u66f4\u590d\u6742\u7684\u5bf9\u8bdd&#xff0c;\u5e26\u6d41\u5f0f\u54cd\u5e94<br \/>\n    public Flux&lt;String&gt; chatStream(String userMessage) {<br \/>\n        return chatClient.prompt()<br \/>\n                .user(userMessage)<br \/>\n                .stream()<br \/>\n                .content();<br \/>\n    }<br \/>\n}<\/p>\n<\/li>\n<li>\n<p>\u6784\u5efaRESTful API\u63a7\u5236\u5668&#xff1a;<\/p>\n<p>import org.springframework.web.bind.annotation.*;<br \/>\nimport reactor.core.publisher.Flux;<\/p>\n<p>&#064;RestController<br \/>\n&#064;RequestMapping(&#034;\/api\/ai&#034;)<br \/>\npublic class AIChatController {<\/p>\n<p>    private final AIChatService aiChatService;<\/p>\n<p>    public AIChatController(AIChatService aiChatService) {<br \/>\n        this.aiChatService &#061; aiChatService;<br \/>\n    }<\/p>\n<p>    &#064;PostMapping(&#034;\/chat&#034;)<br \/>\n    public String chat(&#064;RequestBody ChatRequest request) {<br \/>\n        return aiChatService.chat(request.getMessage());<br \/>\n    }<\/p>\n<p>    &#064;GetMapping(value &#061; &#034;\/chat\/stream&#034;, produces &#061; MediaType.TEXT_EVENT_STREAM_VALUE)<br \/>\n    public Flux&lt;String&gt; chatStream(&#064;RequestParam String message) {<br \/>\n        return aiChatService.chatStream(message);<br \/>\n    }<br \/>\n}<\/p>\n<\/li>\n<p>\u8fd9\u6837&#xff0c;\u4f60\u7684\u5185\u90e8\u4e1a\u52a1\u7cfb\u7edf&#xff08;\u5982CRM\u3001OA\u3001\u77e5\u8bc6\u5e93\u7cfb\u7edf&#xff09;\u5c31\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528\u8fd9\u4e9bREST API&#xff0c;\u5b89\u5168\u5730\u4f7f\u7528\u5185\u7f51\u5927\u6a21\u578b\u7684\u80fd\u529b&#xff0c;\u800c\u6570\u636e\u5168\u7a0b\u4e0d\u4f1a\u6d41\u51fa\u5185\u7f51\u73af\u5883\u3002<\/p>\n<h3>6. \u6027\u80fd\u8c03\u4f18\u4e0e\u6545\u969c\u6392\u67e5\u5b9e\u6218\u6307\u5357<\/h3>\n<p>\u90e8\u7f72\u5b8c\u6210\u53ea\u662f\u7b2c\u4e00\u6b65&#xff0c;\u8ba9\u670d\u52a1\u9ad8\u6548\u3001\u7a33\u5b9a\u5730\u8fd0\u884c\u624d\u662f\u957f\u671f\u6311\u6218\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5728\u5185\u7f51\u73af\u5883\u4e2d\u7279\u6709\u7684\u8c03\u4f18\u548c\u6392\u9519\u7ecf\u9a8c\u3002<\/p>\n<p>GPU\u5229\u7528\u7387\u6392\u67e5&#xff1a;<br \/>\n\u5982\u679c\u4f60\u4e3a\u670d\u52a1\u5668\u914d\u5907\u4e86GPU&#xff0c;\u4f46\u53d1\u73b0\u63a8\u7406\u901f\u5ea6\u5e76\u6ca1\u6709\u663e\u8457\u63d0\u5347&#xff0c;\u9996\u5148\u9700\u8981\u786e\u8ba4Ollama\u662f\u5426\u771f\u7684\u5728\u4f7f\u7528GPU\u3002<\/p>\n<ul>\n<li>\u5bf9\u4e8eNVIDIA GPU&#xff0c;\u5728\u8fd0\u884c\u6a21\u578b\u65f6&#xff0c;\u6253\u5f00\u53e6\u4e00\u4e2a\u7ec8\u7aef&#xff0c;\u8fd0\u884cwatch -n 1 nvidia-smi\u3002\u89c2\u5bdfGPU\u7684\u663e\u5b58\u5360\u7528\u548c\u8ba1\u7b97\u5229\u7528\u7387&#xff08;Volatile GPU-Util&#xff09;\u662f\u5426\u6709\u660e\u663e\u4e0a\u5347\u3002\u5982\u679c\u6ca1\u6709&#xff0c;\u53ef\u80fd\u662fCUDA\u7248\u672c\u4e0d\u517c\u5bb9\u6216\u9a71\u52a8\u95ee\u9898\u3002Ollama\u5bf9CUDA\u7248\u672c\u6709\u4e00\u5b9a\u8981\u6c42&#xff0c;\u9700\u8981\u786e\u4fdd\u5185\u7f51\u5b89\u88c5\u7684\u9a71\u52a8\u7248\u672c\u8db3\u591f\u65b0\u3002<\/li>\n<li>\u5bf9\u4e8eAMD GPU&#xff0c;\u60c5\u51b5\u7a0d\u5fae\u590d\u6742\u3002Ollama\u901a\u8fc7ROCm\u5e93\u652f\u6301AMD GPU\u3002\u4f60\u9700\u8981\u68c0\u67e5ROCm\u5e93\u662f\u5426\u88ab\u6b63\u786e\u52a0\u8f7d\u3002\u53ef\u4ee5\u67e5\u770bOllama\u7684\u65e5\u5fd7&#xff0c;\u641c\u7d22\u201cGPU\u201d\u6216\u201cROCm\u201d\u5173\u952e\u5b57\u3002\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u6765\u589e\u52a0\u65e5\u5fd7\u8f93\u51fa&#xff1a;HIP_VISIBLE_DEVICES&#061;0 OLLAMA_DEBUG&#061;1 ollama run qwen:7b\u3002<\/li>\n<\/ul>\n<p>\u5185\u5b58\u4e0e\u663e\u5b58\u7ba1\u7406&#xff1a;<br \/>\n\u5927\u6a21\u578b\u662f\u8d44\u6e90\u6d88\u8017\u5927\u6237\u3002\u52a1\u5fc5\u76d1\u63a7\u670d\u52a1\u5668\u7684\u5185\u5b58\u548c\u663e\u5b58\u4f7f\u7528\u60c5\u51b5\u3002\u5982\u679c\u6a21\u578b\u5728\u52a0\u8f7d\u6216\u63a8\u7406\u8fc7\u7a0b\u4e2d\u88ab\u7cfb\u7edf\u6740\u6b7b&#xff08;OOM Killer&#xff09;&#xff0c;\u4f60\u9700\u8981\u8c03\u6574\u6a21\u578b\u52a0\u8f7d\u53c2\u6570\u6216\u5347\u7ea7\u786c\u4ef6\u3002<\/p>\n<ul>\n<li>\u91cf\u5316\u6a21\u578b&#xff1a;\u5982\u679c\u663e\u5b58\u4e0d\u8db3&#xff0c;\u8003\u8651\u4f7f\u7528\u91cf\u5316\u7248\u672c\u7684\u6a21\u578b\u3002\u4f8b\u5982&#xff0c;qwen:7b\u53ef\u80fd\u6709qwen:7b-q4_0&#xff08;4\u4f4d\u91cf\u5316&#xff09;\u7248\u672c&#xff0c;\u5b83\u80fd\u663e\u8457\u964d\u4f4e\u663e\u5b58\u5360\u7528&#xff0c;\u5bf9\u63a8\u7406\u901f\u5ea6\u7684\u5f71\u54cd\u5374\u76f8\u5bf9\u8f83\u5c0f\u3002\u5728\u5185\u7f51\u90e8\u7f72\u65f6&#xff0c;\u76f4\u63a5\u51c6\u5907\u91cf\u5316\u6a21\u578b\u6587\u4ef6\u5373\u53ef\u3002<\/li>\n<li>\u7cfb\u7edf\u4ea4\u6362\u7a7a\u95f4&#xff1a;\u786e\u4fdd\u670d\u52a1\u5668\u6709\u8db3\u591f\u7684\u4ea4\u6362\u7a7a\u95f4&#xff08;swap&#xff09;&#xff0c;\u4f5c\u4e3a\u5185\u5b58\u4e0d\u8db3\u65f6\u7684\u7f13\u51b2\u3002\u4f46\u8fd9\u4f1a\u4e25\u91cd\u5f71\u54cd\u6027\u80fd&#xff0c;\u4ec5\u4f5c\u4e3a\u9884\u9632\u7cfb\u7edf\u5d29\u6e83\u7684\u6700\u540e\u624b\u6bb5\u3002<\/li>\n<\/ul>\n<p>\u5e38\u89c1\u6545\u969c\u4e0e\u89e3\u51b3\u601d\u8def&#xff1a;<\/p>\n<table>\n<tr>\u6545\u969c\u73b0\u8c61\u53ef\u80fd\u539f\u56e0\u6392\u67e5\u6b65\u9aa4\u4e0e\u89e3\u51b3\u65b9\u6848<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">ollama run \u62a5\u9519 Error: model &#039;xxx&#039; not found<\/td>\n<td style=\"text-align:left\">1. \u6a21\u578b\u672a\u5bfc\u5165\u5230\u81ea\u5b9a\u4e49\u76ee\u5f55\u30022. OLLAMA_MODELS\u73af\u5883\u53d8\u91cf\u672a\u751f\u6548\u6216\u8def\u5f84\u9519\u8bef\u30023. \u6a21\u578b\u6587\u4ef6\u635f\u574f\u3002<\/td>\n<td style=\"text-align:left\">1. echo $OLLAMA_MODELS \u68c0\u67e5\u53d8\u91cf\u30022. ls -la $OLLAMA_MODELS\/blobs\/ \u68c0\u67e5\u6a21\u578b\u6587\u4ef6\u662f\u5426\u5b58\u5728\u30023. \u91cd\u65b0\u4f20\u8f93\u5e76\u6821\u9a8c\u6a21\u578b\u6587\u4ef6\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u670d\u52a1\u542f\u52a8\u5931\u8d25&#xff0c;\u65e5\u5fd7\u663e\u793a permission denied<\/td>\n<td style=\"text-align:left\">1. \u6a21\u578b\u76ee\u5f55\u6743\u9650\u4e0d\u5bf9\u30022. systemd\u670d\u52a1\u7528\u6237ollama\u65e0\u6743\u8bbf\u95ee\u67d0\u4e9b\u8def\u5f84\u3002<\/td>\n<td style=\"text-align:left\">1. sudo chown -R ollama:ollama \/data\/ollama_models\u30022. \u68c0\u67e5\u670d\u52a1\u6587\u4ef6\u4e2dUser\u548cGroup\u8bbe\u7f6e&#xff0c;\u4ee5\u53ca\u76f8\u5173\u76ee\u5f55\u7684\u6743\u9650\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">API\u8bf7\u6c42\u8d85\u65f6\u6216\u65e0\u54cd\u5e94<\/td>\n<td style=\"text-align:left\">1. \u9632\u706b\u5899\u963b\u6b62\u4e8611434\u7aef\u53e3\u30022. OLLAMA_HOST\u7ed1\u5b9a\u5730\u5740\u9519\u8bef\u30023. \u670d\u52a1\u8fdb\u7a0b\u50f5\u6b7b\u3002<\/td>\n<td style=\"text-align:left\">1. sudo firewall-cmd &#8211;list-all \u6216 sudo iptables -L \u68c0\u67e5\u9632\u706b\u5899\u89c4\u5219\u30022. &#096;sudo ss -tlnp<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u63a8\u7406\u901f\u5ea6\u6781\u6162&#xff0c;GPU\u663e\u793a0%\u5229\u7528\u7387<\/td>\n<td style=\"text-align:left\">1. GPU\u9a71\u52a8\u6216\u8ba1\u7b97\u5e93\u672a\u6b63\u786e\u5b89\u88c5\u30022. Ollama\u672a\u68c0\u6d4b\u5230GPU&#xff0c;\u56de\u9000\u5230CPU\u6a21\u5f0f\u30023. \u6a21\u578b\u672c\u8eab\u4e0d\u652f\u6301GPU\u52a0\u901f\u3002<\/td>\n<td style=\"text-align:left\">1. \u68c0\u67e5\u5b89\u88c5\u65e5\u5fd7&#xff0c;\u786e\u8ba4GPU\u4f9d\u8d56\u6b65\u9aa4\u662f\u5426\u6210\u529f\u30022. \u8fd0\u884c ollama ps \u67e5\u770b\u6a21\u578b\u8fd0\u884c\u6a21\u5f0f\u30023. \u5c1d\u8bd5\u4e00\u4e2a\u5df2\u77e5\u652f\u6301GPU\u7684\u5c0f\u6a21\u578b&#xff08;\u5982llama2:7b&#xff09;\u8fdb\u884c\u6d4b\u8bd5\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5efa\u7acb\u5185\u90e8\u77e5\u8bc6\u5e93&#xff1a;<br \/>\n\u5728\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5916\u90e8\u641c\u7d22\u5f15\u64ce\u7684\u5e2e\u52a9\u6709\u9650\u3002\u56e0\u6b64&#xff0c;\u5efa\u8bae\u5c06\u672c\u6b21\u90e8\u7f72\u7684\u6240\u6709\u6b65\u9aa4\u3001\u9047\u5230\u7684\u9519\u8bef\u3001\u89e3\u51b3\u65b9\u6848\u3001\u914d\u7f6e\u6587\u4ef6\u7684\u4fee\u6539\u8bb0\u5f55&#xff0c;\u8be6\u7ec6\u5730\u6574\u7406\u6210\u4e00\u4efd\u5185\u90e8Wiki\u6587\u6863\u3002\u8fd9\u4e0d\u4ec5\u80fd\u5e2e\u52a9\u56e2\u961f\u5176\u4ed6\u6210\u5458&#xff0c;\u4e5f\u662f\u672a\u6765\u8fdb\u884c\u7248\u672c\u5347\u7ea7\u3001\u670d\u52a1\u5668\u8fc1\u79fb\u65f6\u6700\u5b9d\u8d35\u7684\u53c2\u8003\u8d44\u6599\u3002<\/p>\n<p>\u6574\u4e2a\u5185\u7f51\u5927\u6a21\u578b\u90e8\u7f72\u7684\u8fc7\u7a0b&#xff0c;\u5c31\u50cf\u662f\u5728\u4e00\u4e2a\u5c01\u95ed\u7684\u5b9e\u9a8c\u5ba4\u91cc\u642d\u5efa\u4e00\u5957\u7cbe\u5bc6\u7684\u5b9e\u9a8c\u88c5\u7f6e\u3002\u6bcf\u4e00\u4e2a\u96f6\u4ef6\u90fd\u9700\u8981\u4eb2\u624b\u6311\u9009\u3001\u6d4b\u8bd5\u548c\u7ec4\u88c5\u3002\u5f53\u770b\u5230\u5185\u90e8\u7684\u4e1a\u52a1\u7cfb\u7edf\u6210\u529f\u8c03\u7528\u672c\u5730\u6a21\u578b\u5e76\u8fd4\u56de\u7b2c\u4e00\u4e2a\u7b54\u6848\u65f6&#xff0c;\u90a3\u79cd\u5bf9\u6570\u636e\u5b89\u5168\u7684\u638c\u63a7\u611f\u548c\u6280\u672f\u6311\u6218\u88ab\u653b\u514b\u540e\u7684\u6210\u5c31\u611f&#xff0c;\u662f\u5728\u7ebfAPI\u670d\u52a1\u65e0\u6cd5\u7ed9\u4e88\u7684\u3002\u8fd9\u79cd\u5b8c\u5168\u81ea\u4e3b\u53ef\u63a7\u7684AI\u80fd\u529b&#xff0c;\u6b63\u662f\u8bb8\u591a\u5bf9\u6570\u636e\u654f\u611f\u884c\u4e1a\u8fdb\u884c\u667a\u80fd\u5316\u8f6c\u578b\u65f6&#xff0c;\u6700\u575a\u5b9e\u3001\u6700\u53ef\u9760\u7684\u6280\u672f\u57fa\u5ea7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5185\u7f51\u73af\u5883\u4e0b\u7684\u4f01\u4e1a\u7ea7\u5927\u6a21\u578b\u90e8\u7f72\u5b9e\u6218&#xff1a;\u4eceOllama\u79bb\u7ebf\u5b89\u88c5\u5230\u79c1\u6709\u5316AI\u5e94\u7528\u6784\u5efa<br \/>\n\u5728\u91d1\u878d\u98ce\u63a7\u3001\u533b\u7597\u8bca\u65ad\u3001\u6cd5\u5f8b\u6587\u4e66\u5206\u6790\u7b49\u5bf9\u6570\u636e\u9690\u79c1\u548c\u5408\u89c4\u6027\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df&#xff0c;\u4f01\u4e1a\u6838\u5fc3\u6570\u636e\u5982\u540c\u751f\u547d\u7ebf&#xff0c;\u7edd\u4e0d\u5141\u8bb8\u79bb\u5f00\u5185\u90e8\u7f51\u7edc\u3002\u7136\u800c&#xff0c;AI\u5927\u6a21\u578b\u5e26\u6765\u7684\u6548\u7387\u9769\u547d\u53c8\u8ba9\u4eba\u65e0\u6cd5\u5ffd\u89c6\u3002\u5982\u4f55\u5728\u5b8c\u5168\u9694\u79bb\u7684\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5b89\u5168\u3001\u7a33\u5b9a\u5730\u90e8\u7f72\u548c\u8fd0\u884c\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u79c1\u6709\u5316\u5927\u6a21\u578b&#xff0c;\u5e76\u5c06\u5176\u65e0\u7f1d\u96c6\u6210\u5230\u73b0\u6709\u4e1a\u52a1\u7cfb\u7edf\u4e2d&#xff0c;\u6210\u4e3a\u4e86\u8bb8\u591a\u6280\u672f\u56e2\u961f\u9762\u4e34\u7684\u6838\u5fc3\u6311\u6218<\/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":[8362,8361,8363,126],"topic":[],"class_list":["post-76911","post","type-post","status-publish","format-standard","hentry","category-server","tag-8362","tag-8361","tag-ai","tag-ollama"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \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\/76911.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5185\u7f51\u73af\u5883\u4e0b\u7684\u4f01\u4e1a\u7ea7\u5927\u6a21\u578b\u90e8\u7f72\u5b9e\u6218&#xff1a;\u4eceOllama\u79bb\u7ebf\u5b89\u88c5\u5230\u79c1\u6709\u5316AI\u5e94\u7528\u6784\u5efa \u5728\u91d1\u878d\u98ce\u63a7\u3001\u533b\u7597\u8bca\u65ad\u3001\u6cd5\u5f8b\u6587\u4e66\u5206\u6790\u7b49\u5bf9\u6570\u636e\u9690\u79c1\u548c\u5408\u89c4\u6027\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df&#xff0c;\u4f01\u4e1a\u6838\u5fc3\u6570\u636e\u5982\u540c\u751f\u547d\u7ebf&#xff0c;\u7edd\u4e0d\u5141\u8bb8\u79bb\u5f00\u5185\u90e8\u7f51\u7edc\u3002\u7136\u800c&#xff0c;AI\u5927\u6a21\u578b\u5e26\u6765\u7684\u6548\u7387\u9769\u547d\u53c8\u8ba9\u4eba\u65e0\u6cd5\u5ffd\u89c6\u3002\u5982\u4f55\u5728\u5b8c\u5168\u9694\u79bb\u7684\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5b89\u5168\u3001\u7a33\u5b9a\u5730\u90e8\u7f72\u548c\u8fd0\u884c\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u79c1\u6709\u5316\u5927\u6a21\u578b&#xff0c;\u5e76\u5c06\u5176\u65e0\u7f1d\u96c6\u6210\u5230\u73b0\u6709\u4e1a\u52a1\u7cfb\u7edf\u4e2d&#xff0c;\u6210\u4e3a\u4e86\u8bb8\u591a\u6280\u672f\u56e2\u961f\u9762\u4e34\u7684\u6838\u5fc3\u6311\u6218\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/76911.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-23T06:45:29+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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76911.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/76911.html\",\"name\":\"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-23T06:45:29+00:00\",\"dateModified\":\"2026-02-23T06:45:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/76911.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/76911.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76911.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55\"}]},{\"@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":"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \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\/76911.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5185\u7f51\u73af\u5883\u4e0b\u7684\u4f01\u4e1a\u7ea7\u5927\u6a21\u578b\u90e8\u7f72\u5b9e\u6218&#xff1a;\u4eceOllama\u79bb\u7ebf\u5b89\u88c5\u5230\u79c1\u6709\u5316AI\u5e94\u7528\u6784\u5efa \u5728\u91d1\u878d\u98ce\u63a7\u3001\u533b\u7597\u8bca\u65ad\u3001\u6cd5\u5f8b\u6587\u4e66\u5206\u6790\u7b49\u5bf9\u6570\u636e\u9690\u79c1\u548c\u5408\u89c4\u6027\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df&#xff0c;\u4f01\u4e1a\u6838\u5fc3\u6570\u636e\u5982\u540c\u751f\u547d\u7ebf&#xff0c;\u7edd\u4e0d\u5141\u8bb8\u79bb\u5f00\u5185\u90e8\u7f51\u7edc\u3002\u7136\u800c&#xff0c;AI\u5927\u6a21\u578b\u5e26\u6765\u7684\u6548\u7387\u9769\u547d\u53c8\u8ba9\u4eba\u65e0\u6cd5\u5ffd\u89c6\u3002\u5982\u4f55\u5728\u5b8c\u5168\u9694\u79bb\u7684\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5b89\u5168\u3001\u7a33\u5b9a\u5730\u90e8\u7f72\u548c\u8fd0\u884c\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u79c1\u6709\u5316\u5927\u6a21\u578b&#xff0c;\u5e76\u5c06\u5176\u65e0\u7f1d\u96c6\u6210\u5230\u73b0\u6709\u4e1a\u52a1\u7cfb\u7edf\u4e2d&#xff0c;\u6210\u4e3a\u4e86\u8bb8\u591a\u6280\u672f\u56e2\u961f\u9762\u4e34\u7684\u6838\u5fc3\u6311\u6218","og_url":"https:\/\/www.wsisp.com\/helps\/76911.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-23T06:45:29+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/76911.html","url":"https:\/\/www.wsisp.com\/helps\/76911.html","name":"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-23T06:45:29+00:00","dateModified":"2026-02-23T06:45:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/76911.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/76911.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/76911.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5185\u7f51\u670d\u52a1\u5668\u73a9\u8f6c\u5927\u6a21\u578b\uff1aOllama\u79bb\u7ebf\u5b89\u88c5+\u901a\u4e49\u5343\u95ee\u672c\u5730\u5316\u90e8\u7f72\u5b9e\u5f55"}]},{"@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\/76911","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=76911"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/76911\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=76911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=76911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=76911"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=76911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}