{"id":705,"date":"2024-05-09T08:00:29","date_gmt":"2024-05-09T00:00:29","guid":{"rendered":"https:\/\/www.zhoubin.asia\/?p=705"},"modified":"2024-05-08T12:01:30","modified_gmt":"2024-05-08T04:01:30","slug":"ai","status":"publish","type":"post","link":"https:\/\/www.zhoubin.asia\/index.php\/2024\/05\/09\/ai\/","title":{"rendered":"[AI]\u4f7f\u7528 Ollama \u548c Open WebUI \u5b9e\u73b0\u5927\u8bed\u8a00\u6a21\u578b LLaMA 3 \u7684\u672c\u5730\u90e8\u7f72"},"content":{"rendered":"<p>\u6700\u8fd1\uff0cMeta \u53d1\u5e03\u4e86\u6700\u65b0\u7684 LLaMA 3\u3002\u6211\u8fd9\u8fb9\u5229\u7528 ollama + Open WebUI \u6765\u5b9e\u73b0\u5927\u8bed\u8a00\u6a21\u578b\u7684\u672c\u5730\u90e8\u7f72\u3002<\/p>\n<h2><a href=\"https:\/\/github.com\/ollama\/ollama\">Ollama<\/a> \u5b89\u88c5<\/h2>\n<p>\u6211\u6309\u7167 GitHub \u4e0a\u7684 <a href=\"https:\/\/github.com\/ollama\/ollama\/blob\/main\/docs\/linux.md\">manual install instructions<\/a>\u4e0b\u8f7d\u7a0b\u5e8f\u5e76\u8d4b\u4e88\u6743\u9650\uff1a<\/p>\n<pre><code>sudo curl -L https:\/\/ollama.com\/download\/ollama-linux-amd64 -o \/usr\/bin\/ollama\r\nsudo chmod +x \/usr\/bin\/ollama\r\n<\/code><\/pre>\n<p>\u6211\u5e76\u6ca1\u6709\u5b89\u88c5\u8bf4\u660e\u7684\u90a3\u6837\u4e13\u95e8\u521b\u5efa\u4e00\u4e2a\u8fd0\u884c ollama \u7684\u7528\u6237\uff0c\u4f9d\u7136\u4f7f\u7528\u6211\u672c\u8eab\u7684\u7528\u6237\u540d\u3002<\/p>\n<h2>\u521b\u5efa\u670d\u52a1\u6587\u4ef6<\/h2>\n<p>\u6211\u521b\u5efa\u4e86\u670d\u52a1\u6587\u4ef6 <code>\/etc\/systemd\/system\/ollama.service<\/code>\uff1a<\/p>\n<pre><code>[Unit]\r\nDescription=Ollama Service\r\nAfter=network-online.target\r\n\r\n[Service]\r\nExecStart=\/usr\/bin\/ollama serve\r\nUser=alex\r\nGroup=alex\r\nRestart=always\r\nRestartSec=3\r\nEnvironment=\"OLLAMA_HOST=0.0.0.0\"\r\n\r\n[Install]\r\nWantedBy=default.target\r\n<\/code><\/pre>\n<p>\u6ce8\uff1a\u6211\u8fd9\u91cc\u4e0e\u8bf4\u660e\u91cc\u9762\u6709\u4e00\u70b9\u70b9\u5c0f\u7684\u533a\u522b\uff0c\u4e3b\u8981\u539f\u56e0\u5728 FAQ \u91cc\u9762\u6709\u63d0\u53ca\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-706\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2024\/05\/ollama_service.jpg\" alt=\"\" width=\"1568\" height=\"643\" \/><\/p>\n<h2>CUDA \u5b89\u88c5<\/h2>\n<p>\u8003\u8651\u6211\u5df2\u7ecf\u5b89\u88c5\u8fc7 NVIDIA \u7684\u9a71\u52a8\u4ee5\u53ca CUDA \u4e86\uff0c\u6240\u4ee5\u8fd9\u90e8\u5206\u6211\u4eec\u7701\u7565\u4e0b\uff0c\u7f51\u4e0a\u5f88\u591a\u8fd9\u65b9\u9762\u7684\u6559\u7a0b\u3002<\/p>\n<h2>\u8fd0\u884c Ollama \u670d\u52a1<\/h2>\n<p>\u6211\u542f\u52a8\u4e86 ollama \u670d\u52a1\uff1a<\/p>\n<pre><code>sudo systemctl start ollama\r\n<\/code><\/pre>\n<p>\u4ece\u7136\u540e\u5f00\u59cb\uff0c\u6bcf\u6b21\u542f\u52a8\u90fd\u4f1a\u81ea\u52a8\u8fd0\u884c\u3002<\/p>\n<h2>\u57fa\u672c\u4f7f\u7528<\/h2>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u57fa\u672c\u4f7f\u7528\u662f\uff1a<\/p>\n<pre><code>ollama run llama3\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u81ea\u52a8\u4e0b\u8f7d\u6240\u9700\u7684\u6a21\u578b\u3002\u7136\u540e\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5b83\uff0c\u4f46\u662f\u4f7f\u7528\u65b9\u6cd5\u6709\u70b9\u4e0d\u4fbf\u6377\uff0c\u4e3b\u8981\u5728\u547d\u4ee4\u884c\u5f62\u5f0f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-707\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2024\/05\/ollama_terminal.jpg\" alt=\"\" width=\"1817\" height=\"191\" \/><\/p>\n<h2><a href=\"https:\/\/github.com\/open-webui\/open-webui\">Open WebUI<\/a><\/h2>\n<p>\u4e3a\u4e86\u4f7f\u5176\u66f4\u52a0\u7528\u6237\u53cb\u597d\uff0c\u6211\u4f7f\u7528 Open WebUI \u4f5c\u4e3a\u4ea4\u4e92\u63a5\u53e3\u3002\u5728 fact\uff0collama \u7684 GitHub \u4e5f\u5f15\u5165\u4e86\u5176\u4ed6\u7684 UI \u65b9\u6cd5\uff0c\u6211\u9009\u62e9\u4e86\u7b2c\u4e00\u4e2a\u3002<\/p>\n<p>\u6211\u4f7f\u7528 Docker \u5b89\u88c5\u4e86 Open WebUI\uff1a<\/p>\n<pre><code>docker run -d -p 3000:80 -v open-webui:\/app\/backend\/data --name open-webui --restart always ghcr.io\/open-webui\/open-webui:main\r\n<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 <a href=\"http:\/\/localhost:3000\">http:\/\/localhost:3000<\/a> \u8bbf\u95ee\u5b83\u3002\u4f7f\u7528\u65b9\u6cd5\u7c7b\u4f3c\u4e8e ChatGPT\uff0c\u7b80\u5355\u6613\u7528\u3002<\/p>\n<h2>\u6ce8\u610f<\/h2>\n<p>\u6574\u4e2a\u65b9\u6848\u9700\u8981\u4f7f\u7528\u8ba1\u7b97\u673a HTTP \u7aef\u53e3 3000\uff08\u5916\u90e8\uff09\u30018080\uff08Open WebUI Docker\uff09\u548c 11434\uff08ollama \u670d\u52a1\uff09\u3002\u4f60\u9700\u8981\u5728\u5b89\u88c5\u524d\u786e\u4fdd\u8fd9\u4e9b\u7aef\u53e3\u672a\u88ab\u5360\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\uff0cMeta \u53d1\u5e03\u4e86\u6700\u65b0\u7684 LLaMA 3\u3002\u6211\u8fd9\u8fb9\u5229\u7528 ollama + Open WebUI \u6765\u5b9e\u73b0\u5927\u8bed\u8a00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-705","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/comments?post=705"}],"version-history":[{"count":1,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/705\/revisions"}],"predecessor-version":[{"id":708,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/705\/revisions\/708"}],"wp:attachment":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/media?parent=705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/categories?post=705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/tags?post=705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}