esc0rp 发表于 2024-8-19 05:46:35

两步搭建自己的免费AI助手!Obsidian可用!


    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/52b56840279f421081c86e4e54169b06~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=hu90KJ8knOrL5sRn3lLJYBa0QrE%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/64e56fd709a944d291b9431f8ef6b391~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=cjcbmLnZz8Kerc5maPlnEuTUqVs%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">沙牛提示</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">阅读本文<span style="color: black;">必须</span>6分钟,建一套自己的AI助手!</p><span style="color: black;">倘若</span>你<span style="color: black;">爱好</span>本文,就分享给你的小伙伴!
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/05e25424cbbe40b9884d32daeb5ddf10~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=pmnh4%2Fgk%2Fxlp66lXGQh571FNL0s%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">01 AI</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">随着AI的日益普及,<span style="color: black;">非常多</span>大厂都开放了自己的大语言模型。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本文就来告诉你,<span style="color: black;">怎样</span>在本地,搭建一套随时可用的AI问答系统。</p>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">02 Ollama</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你只<span style="color: black;">必须</span><span style="color: black;">运用</span>一款免费开源的工具:<strong style="color: blue;">Ollama</strong>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Ollama是免费开源的,支持多达<strong style="color: blue;">近2000种大语言模型</strong>,<span style="color: black;">包含</span>阿里通义千问、Meta llama3、Google Gemma等等。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">运用</span>它,你只<span style="color: black;">必须</span><span style="color: black;">根据</span>以下<span style="color: black;">过程</span>进行<span style="color: black;">就可</span>:</p>安装Ollama下载大语言模型进行问答<h1 style="color: black; text-align: left; margin-bottom: 10px;">1. 安装Ollama</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你<span style="color: black;">能够</span>在Ollama的官网 https://ollama.com/ 下载并安装它,它支持Windows、macOS和Linux等主流操作系统。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/d061484bae104796986b81cec36e0f11~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=ZO5L3%2FWzkAwRpyUsCFGMJroVB38%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装之后,它会在后台运行,并默认开机<span style="color: black;">起步</span>,方便<span style="color: black;">咱们</span>随时<span style="color: black;">运用</span>。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/a9f15586d9cf4925a39a17515e975b39~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=bdmcECClaJYLEu13Jdq887PqnFA%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不外</span>,<span style="color: black;">日前</span>Ollama并<span style="color: black;">无</span><span style="color: black;">供给</span>图形界面的客户端,<span style="color: black;">因此</span>……你只能<span style="color: black;">经过</span>命令提示符<span style="color: black;">运用</span>它。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在Ollama安装之后,打开命令提示符,输入 ollama,<span style="color: black;">倘若</span>收到<span style="color: black;">这般</span>的提示,则证明安装成功:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/713fafd875c0499f8563cc4dd37cf019~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=SOUeigYWvYDJh3vVQR%2BueLF8jhw%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">2. 下载大语言模型</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本地安装的Ollama,你<span style="color: black;">能够</span>理解为一个<span style="color: black;">基本</span>平台,<span style="color: black;">此刻</span>,<span style="color: black;">咱们</span><span style="color: black;">必须</span>为这个<span style="color: black;">基本</span>平台,<span style="color: black;">供给</span>大语言模型的支持。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你<span style="color: black;">能够</span>在Ollama官网的 Models 页面,<span style="color: black;">查找</span>到所支持的大语言模型:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/70dca720c2eb4668becf411660be2aa0~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=amzr2823KudrMHcmuvgphtR6ePI%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>点开一个模型,<span style="color: black;">例如</span>Google Gemma:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/7dc91a6995354c69b56bc00458007295~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=w4xr8IFYpyitgGiJ0rhKvuBm5ec%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其中:</p>① <span style="color: black;">表率</span>模型的<span style="color: black;">区别</span>参数版本,B<span style="color: black;">表率</span>Billion,即十亿,9B,<span style="color: black;">表率</span>90亿参数。② 你<span style="color: black;">能够</span>在<span style="color: black;">这儿</span><span style="color: black;">选取</span><span style="color: black;">区别</span>参数的版本。③ <span style="color: black;">选取</span>版本后,复制命令。<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>,把复制的命令 ollama run gemma2:9b,粘贴到命令提示符中,便会<span style="color: black;">起始</span>下载并运行该模型:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/8bfa6759b8f5484082bc90d1d1301a79~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=Rs5cbSHCacHHqswSmiTdT8MVoGg%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">要查看<span style="color: black;">已然</span>下载的模型,<span style="color: black;">能够</span><span style="color: black;">运用</span>命令 ollama list :</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/4789d71976714edb8282552fc1aadf8b~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=ioR5htVDK2gYjMcKfKzlmQevAfM%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">ps:这命令风格真是跟Docker如出一辙。</p>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">3. 进行问答</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装模型后,<span style="color: black;">咱们</span>就<span style="color: black;">能够</span>进行问答了。<span style="color: black;">不外</span>,<span style="color: black;">由于</span><span style="color: black;">无</span>图形界面,<span style="color: black;">因此</span>……你<span style="color: black;">亦</span>只能在命令提示符这种上古神器中,来运行先进的人工智能……</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">运行一个模型,<span style="color: black;">能够</span><span style="color: black;">运用</span>命令 ollama run 模型名<span style="color: black;">叫作</span> ,如运行阿里千问,命令则为 ollama run qwen2:7b</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">好了,<span style="color: black;">此刻</span>,你<span style="color: black;">能够</span>进行提问了:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/f898af152d1c48c58e09bcf368f00d95~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=YPCjOk1EQuAC1m2vpQ6%2BmegrRpU%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">03 弄个图形界面</h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>你愿意折腾的话,<span style="color: black;">亦</span><span style="color: black;">能够</span>为Ollama搭建一个开源的图形界面, 如LobeChat、Open WebUI等等。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">而我<span style="color: black;">选取</span>的,是MaxKB,我把它<span style="color: black;">安排</span>在了自己的群晖NAS上:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/d968b04e123146ccb95adf11b88c24ae~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=Q7dtyZUuX2JH6cXr3Dz2gYPGbGs%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">有了图形界面之后,你便<span style="color: black;">能够</span>在<span style="color: black;">全部</span>局域网中<span style="color: black;">运用</span>Ollama,<span style="color: black;">乃至</span>,<span style="color: black;">由于</span>有公网IP的关系,我还把这个页面放到了网上,无论在哪,都能<span style="color: black;">运用</span>自己家里运行着的大语言模型。</p>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">04 在Obsidian中<span style="color: black;">运用</span></h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你还<span style="color: black;">能够</span>在Obsidian中<span style="color: black;">运用</span>Ollama本地大语言模型,只<span style="color: black;">必须</span>安装插件 Smart Second Brain <span style="color: black;">就可</span>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装并启用后,配置一下插件:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/bfe1f33ede09418880cb9e9815372c98~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=AxSQSo4x2Y9izMAAZeCqu91o7oU%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>,它会索引你的Obsidian资料库。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">然则</span>,<span style="color: black;">针对</span>我<span style="color: black;">包括</span>了1200条笔记、180万字的资料库,再加上<span style="color: black;">无</span>独显的debuff加持,直接给了我一个<span style="color: black;">这般</span>的时长提示:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/86c5ac8a5d7c460c908025a483baeba3~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=BAxQkKNfVsZ3pNhTVAU7HCWAlAI%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不外</span>,即便只是把它<span style="color: black;">做为</span>一个Obsidian中的AI问答工具,还能即时<span style="color: black;">保留</span>为笔记,<span style="color: black;">亦</span>是挺不错的:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-6w9my0ksvp/93843fc6867e4b4cbe65eb7037530919~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723956458&amp;x-signature=owmvX65Rnpidt6mIeKdOEGcYg8E%3D" style="width: 50%; margin-bottom: 20px;"></div>




nqkk58 发表于 2024-10-3 06:18:48

你字句如珍珠,我珍藏这份情。

m5k1umn 发表于 2024-10-19 19:42:37

我完全同意你的看法,期待我们能深入探讨这个问题。

4zhvml8 发表于 2024-10-29 02:55:29

我们有着相似的经历,你的感受我深有体会。

m5k1umn 发表于 2024-10-30 13:25:40

外链发布社区 http://www.fok120.com/

4lqedz 发表于 2024-11-5 09:55:09

我完全赞同你的观点,思考很有深度。

nqkk58 发表于 7 天前

你的见解真是独到,让我受益匪浅。
页: [1]
查看完整版本: 两步搭建自己的免费AI助手!Obsidian可用!