id: 2b95338f5f274ebb90ce0285ee16f919
parent_id: 
item_type: 1
item_id: f161e8e69e5e4469ac055de4c1fe3297
item_updated_time: 1764345620988
title_diff: "[{\"diffs\":[[1,\"怎么在家用笔记本上轻松部署和使用DeepSeek R1\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":27}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>怎么在家用笔记本上轻松部署和使用DeepSeek R1?</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"37365\\\"></a>\\\r\\\n<h1>怎么在家用笔记本上轻松部署和使用DeepSeek R1?</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"\\\"><div style=\\\"max-width: 700px;\\\"><p></p><div style=\\\"--en-blockquote: true; box-sizing: border-box; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial;\\\"><div>原文链接: <a href=\\\"http://mp.weixin.qq.com/s?__biz=MzIzMzQyMzUzNw==&amp;mid=2247493295&amp;idx=1&amp;sn=491286a5a24fa0350dc31182fc73a9cb&amp;chksm=e950b56c0e2f80fbb7ebdf53f126b0a1ad00abbe8f2023fde25826e2f032b351eda10d559758&amp;mpshare=1&amp;scene=1&amp;srcid=0129EqoLdzcQFTss8wcKxF0r&amp;sharer_shareinfo=015394b9e1b9a0ccc043e859a750bfd2&amp;sharer_shareinfo_first=015394b9e1b9a0ccc043e859a750bfd2#rd\\\"><span>http://mp.weixin.qq.com/s?__biz=MzIzMzQyMzUzNw==&amp;mid=2247493...</span></a></div></div><p></p><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent;\\\">原创</span><span style=\\\"-webkit-tap-highlight-color: transparent;\\\"> node </span><span style=\\\"-webkit-tap-highlight-color: transparent;\\\"><a style=\\\"-webkit-tap-highlight-color: transparent;\\\"> 字节笔记本 </a></span><span style=\\\"-webkit-tap-highlight-color: transparent;\\\"><em style=\\\"-webkit-tap-highlight-color: transparent;\\\"></em></span></div><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">DeepSeek R1 是由国内团队开发的高性能开源大模型。详细介绍可以看这里：<a href=\\\"https://mp.weixin.qq.com/s?__biz=MzIzMzQyMzUzNw==&amp;mid=2247493159&amp;idx=1&amp;sn=be20c7c3fd5b27df0a6ea8744b34028a&amp;scene=21#wechat_redirect\\\" style=\\\"-webkit-tap-highlight-color: transparent;\\\" target=\\\"_blank\\\">甚至比 OpenAI-O1表现更好! 我测了 DeepSeek R1,结论只有两个字:牛逼!</a></p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\"><img src=\\\":/dfa7d4e8cf6140b8839476f152ff042a\\\" type=\\\"image/jpeg\\\" data-filename=\\\"640.jpg\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; -webkit-tap-highlight-color: transparent; height: auto; width: auto;\\\" width=\\\"auto\\\"/></p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">那本文将介绍其蒸馏版本在普通家用笔记本上的部署和使用，之所以选择蒸馏版本，是因为蒸馏版本通过模型蒸馏技术实现了算力需求的大幅降低。而且在数学、编程等领域表现出众，可处理复杂逻辑推理任务，如果你不了解蒸馏技术文末也会提供相关的拓展知识</p><h2 style=\\\"-webkit-tap-highlight-color: transparent; font-size: 20px; text-align: center; font-weight: bold;\\\">运行环境准备</h2><div style=\\\"-webkit-tap-highlight-color: transparent; text-align: center;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent; color: #07b45a; font-size: 20px; font-weight: bold;\\\">—</span></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">1 支持 AVX2 指令集的 CPU（近几年的笔记本通 常都支持）<br style=\\\"-webkit-tap-highlight-color: transparent;\\\"/>2 内存建议 32GB 以上获得流畅体验<br style=\\\"-webkit-tap-highlight-color: transparent;\\\"/>3 存储空间预留 10GB 以上<br style=\\\"-webkit-tap-highlight-color: transparent;\\\"/>4 可选 NVIDIA 显卡实现 CUDA 加速</p><h2 style=\\\"-webkit-tap-highlight-color: transparent; font-size: 20px; text-align: center; font-weight: bold;\\\">部署步骤详解</h2><div style=\\\"-webkit-tap-highlight-color: transparent; text-align: center;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent; color: #07b45a; font-size: 20px; font-weight: bold;\\\">—</span></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">环境安装：</p><div style=\\\"-webkit-tap-highlight-color: transparent; overflow: auto;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; border-radius: 8px; display: block; overflow-x: auto; background-color: rgb(40,44,52); color: #abb2bf;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- -v 0.14.1</span><br/><span>source /home/$USER/.bashrc</span><br/></pre></div></div></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">获取模型：</p><div style=\\\"-webkit-tap-highlight-color: transparent; overflow: auto;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; border-radius: 8px; display: block; overflow-x: auto; background-color: rgb(40,44,52); color: #abb2bf;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>curl -LO https://huggingface.co/second-state/DeepSeek-R1-Distill-Llama-8B-GGUF/resolve/main/DeepSeek-R1-Distill-Llama-8B-Q5_K_M.gguf</span><br/></pre></div></div></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">下载服务端：</p><div style=\\\"-webkit-tap-highlight-color: transparent; overflow: auto;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; border-radius: 8px; display: block; overflow-x: auto; background-color: rgb(40,44,52); color: #abb2bf;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>curl -LO https://github.com/LlamaEdge/LlamaEdge/releases/latest/download/llama-api-server.wasm</span><br/></pre></div></div></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">部署界面：</p><div style=\\\"-webkit-tap-highlight-color: transparent; overflow: auto;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; border-radius: 8px; display: block; overflow-x: auto; background-color: rgb(40,44,52); color: #abb2bf;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>curl -LO https://github.com/LlamaEdge/chatbot-ui/releases/latest/download/chatbot-ui.tar.gz</span><br/><span>tar xzf chatbot-ui.tar.gz</span><br/></pre></div></div></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">启动服务：</p><div style=\\\"-webkit-tap-highlight-color: transparent; overflow: auto;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; border-radius: 8px; display: block; overflow-x: auto; background-color: rgb(40,44,52); color: #abb2bf;\\\"><div style=\\\"--en-codeblock: true; --en-meta: {&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true}; box-sizing: border-box; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;\\\"><pre><span>wasmedge --dir .:. --nn-preload default:GGML:AUTO:DeepSeek-R1-Distill-Llama-8B-Q5_K_M.gguf llama-api-server.wasm --prompt-template llama-3-chat --ctx-size 8096</span><br/></pre></div></div></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">然后访问 http://localhost:8080 开始对话</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">如果是想通过 API访问，<span style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; background-color: transparent; caret-color: var(--weui-BRAND);\\\">因为提供了OPENAI 接口的兼容处理，请求接口直接就是&quot;http://localhost:8080/v1&quot;,大模型调用时使用 DeepSeek-R1-Distill-Llama-8B</span></p><h2 style=\\\"-webkit-tap-highlight-color: transparent; font-size: 20px; text-align: center; font-weight: bold;\\\">技术解析</h2><div style=\\\"-webkit-tap-highlight-color: transparent; text-align: center;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent; color: #07b45a; font-size: 20px; font-weight: bold;\\\">—</span></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">模型蒸馏技术</span>是通过大模型对小模型的&quot;教导&quot;实现知识迁移</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">在这个过程中，教师模型（大模型）会将其学到的特征、决策边界和推理能力等知识，通过特殊的训练方式传授给学生模型（小模型）</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">具体来说，大模型会生成带有软标签的训练数据，这些软标签包含了更丰富的分布信息，而不是简单的 0/1 分类</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">学生模型通过模仿教师模型的输出分布进行学习，从而在保持核心能力的同时大幅减少参数量，最终实现模型的轻量化</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">DeepSeek R1 正是通过这种技术，<span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">将原始的数百亿参数压缩到了 8B，同时保持了优秀的性能表现</span></p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">Rust + WebAssembly 技术栈的选择体现了现代应用部署的革新思路。Rust 语言以其内存安全和高性能著称，编译后的代码性能<span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">接近 C++。</span>而 WebAssembly 作为一种底层字节码格式，可以将高级语言编译成在浏览器中近乎原生速度运行的代码。</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">这两种技术的结合，整个运行时环境仅需 30MB，还实现了真正的跨平台部署能力。由于 WebAssembly 的沙箱特性，应用运行在隔离的环境中，提供了额外的安全保障。</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">同时，这种架构天然支持容器化部署，可以无缝集成到现代云原生基础设施中，在大模型部署场景下，这种技术组合相比传统的 Python 方案，显著减少了环境依赖，提升了部署效率，降低了维护成本。</p><h2 style=\\\"-webkit-tap-highlight-color: transparent; font-size: 20px; text-align: center; font-weight: bold;\\\">本地有哪些应用场景？</h2><div style=\\\"-webkit-tap-highlight-color: transparent; text-align: center;\\\"><span style=\\\"-webkit-tap-highlight-color: transparent; color: #07b45a; font-size: 20px; font-weight: bold;\\\">—</span></div><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">本地部署的 DeepSeek R1 成为知识管理的得力工具。比如上下文理解，<span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">建立文档间的知识图谱，发现潜在关联</span>，对话形式为用户提供精准的文档解读服务</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">在软件开发领域，类似于实时的代码补全建议，分析代码中的潜在问题。根据代码上下文自动生成单元测试，确保代码质量。<span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">对于复杂的重构需求，能提供详细的重构建议和实施步骤</span>，大大提升开发效率</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">数据分析场景下，本地部署的 DeepSeek R1 可以智能识别数据特征，提供个性化的数据清洗策略。基于数据内容和分析目标，<span style=\\\"-webkit-tap-highlight-color: transparent; font-weight: bold;\\\">生成专业的分析报告</span>，包括数据趋势、异常值检测和相关性分析。甚至能数据可视化，可深成适合的图表类型，直观地展示数据的变化！</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\">欢迎加入我们的星球：[字节笔记本星球]，共同探索 AI 技术的无限可能！</p><p style=\\\"-webkit-tap-highlight-color: transparent; letter-spacing: 0.05em; min-height: 1em; word-wrap: break-word; text-align: justify;\\\"><br style=\\\"-webkit-tap-highlight-color: transparent;\\\"/></p></div></div><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; display: flex;\\\"><div style=\\\"-webkit-tap-highlight-color: transparent; color: rgba(0,0,0,.3);\\\"><span style=\\\"-webkit-tap-highlight-color: transparent;\\\">修改于</span></div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":14577}]"
metadata_diff: {"new":{"id":"f161e8e69e5e4469ac055de4c1fe3297","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348854167,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:04:35.721Z
created_time: 2025-11-28T21:04:35.721Z
type_: 13