[{"data":1,"prerenderedAt":456},["ShallowReactive",2],{"navigation":3,"post-\u002Fposts\u002F2025\u002Fdeploy-deepseek-r1-for-free":20,"surroundPosts-\u002Fposts\u002F2025\u002Fdeploy-deepseek-r1-for-free":443},[4,8,12,16],{"title":5,"path":6,"stem":7},"首页","\u002F","00.index",{"title":9,"path":10,"stem":11},"文章","\u002Fposts","01.posts",{"title":13,"path":14,"stem":15},"动态","\u002Fmoments","02.moments",{"title":17,"path":18,"stem":19},"关于","\u002Fabout","09.about",{"id":21,"title":22,"body":23,"class":420,"cover":421,"coverSize":420,"date":422,"description":29,"draft":423,"extension":424,"hideComments":423,"location":420,"meta":425,"navigation":426,"path":427,"readingTime":428,"seo":433,"sitemap":434,"stem":436,"tags":437,"time":420,"weather":420,"__hash__":442},"posts\u002Fposts\u002F2025\u002F20250211.deploy-deepseek-r1-for-free.md","零成本部署！阿里云百炼 + Open WebUI 打造专属 DeepSeek-R1",{"type":24,"value":25,"toc":413},"minimark",[26,30,34,37,40,43,46,49,52,56,81,85,258,262,277,280,300,303,322,325,328,331,334,374,377,382,385,388,397,400,403,406,409],[27,28,29],"p",{},"大家好，众所周知，国产之光 DeepSeek 现在的热度远比当时 ChatGPT 出来的时候要火多了。泼天的流量再加上各种恶意攻击，导致 DeepSeek 一直存在性能问题。",[31,32],"post-image",{"filename":33},"02.png",[27,35,36],{},"开启了深度思考就经常出现那句经典名言：服务器繁忙，请稍后再试。",[31,38],{"filename":39},"03.png",[27,41,42],{},"以至于社区已经出现了各种搞笑段子：",[31,44],{"filename":45},"01.jpg",[27,47,48],{},"好了，废话不多说，在这样的情况下各大云厂商都纷纷推出了自己的模型部署服务，支持 DeepSeek，并且会赠送很多免费额度。",[27,50,51],{},"今天来教大家如何用阿里云百炼平台和开源工具 Open WebUI，零成本部署专属的 DeepSeek R1 模型！全程无需复杂代码，跟着我做就能拥有企业级 AI 服务！我只花了不到半小时就完成了整个服务的部署，并且本视频的脚本有一部分就是由我自己部署的 DeepSeek-R1 来写的。",[53,54,55],"h2",{"id":55},"前期准备",[57,58,59,63,78],"ol",{},[60,61,62],"li",{},"注册阿里云账号并实名认证（已有账号可跳过）",[60,64,65,66,73,74],{},"进入 ",[67,68,72],"a",{"href":69,"rel":70},"https:\u002F\u002Fwww.aliyun.com\u002Fproduct\u002Fbailian",[71],"nofollow","阿里云百炼"," 的管理控制台，开通大模型服务，获取 ",[75,76,77],"code",{},"API KEY",[60,79,80],{},"准备一台有 Docker 环境的服务器，用于部署 WebUI（本机部署亦可）",[53,82,84],{"id":83},"open-webui-部署","Open WebUI 部署",[57,86,87,193,251],{},[60,88,89,90,95],{},"通过 Docker Compose 直接部署 ",[67,91,94],{"href":92,"rel":93},"https:\u002F\u002Fgithub.com\u002Fopen-webui\u002Fopen-webui",[71],"open-webui",[96,97,102],"pre",{"className":98,"code":99,"language":100,"meta":101,"style":101},"language-yaml shiki shiki-themes material-theme-lighter github-light github-dark","version: '3'\nservices:\n  openwebui:\n    image: ghcr.io\u002Fopen-webui\u002Fopen-webui:0.5.12（版本号可更新为当前最新 tag 版本号，或使用 main 拉取最新）\n    ports:\n      - '3000:8080'\n    volumes:\n      - .\u002Fdata:\u002Fapp\u002Fbackend\u002Fdata\n","yaml","",[75,103,104,128,137,145,156,164,177,185],{"__ignoreMap":101},[105,106,109,113,117,121,125],"span",{"class":107,"line":108},"line",1,[105,110,112],{"class":111},"sQzsp","version",[105,114,116],{"class":115},"sP7_E",":",[105,118,120],{"class":119},"sjJ54"," '",[105,122,124],{"class":123},"s_sjI","3",[105,126,127],{"class":119},"'\n",[105,129,131,134],{"class":107,"line":130},2,[105,132,133],{"class":111},"services",[105,135,136],{"class":115},":\n",[105,138,140,143],{"class":107,"line":139},3,[105,141,142],{"class":111},"  openwebui",[105,144,136],{"class":115},[105,146,148,151,153],{"class":107,"line":147},4,[105,149,150],{"class":111},"    image",[105,152,116],{"class":115},[105,154,155],{"class":123}," ghcr.io\u002Fopen-webui\u002Fopen-webui:0.5.12（版本号可更新为当前最新 tag 版本号，或使用 main 拉取最新）\n",[105,157,159,162],{"class":107,"line":158},5,[105,160,161],{"class":111},"    ports",[105,163,136],{"class":115},[105,165,167,170,172,175],{"class":107,"line":166},6,[105,168,169],{"class":115},"      -",[105,171,120],{"class":119},[105,173,174],{"class":123},"3000:8080",[105,176,127],{"class":119},[105,178,180,183],{"class":107,"line":179},7,[105,181,182],{"class":111},"    volumes",[105,184,136],{"class":115},[105,186,188,190],{"class":107,"line":187},8,[105,189,169],{"class":115},[105,191,192],{"class":123}," .\u002Fdata:\u002Fapp\u002Fbackend\u002Fdata\n",[60,194,195,196,199,200],{},"启动好实例后，通过 ",[75,197,198],{},"http:\u002F\u002Flocalhost:3000\u002F"," 访问 Open WebUI，如果是在云服务器上部署，还有一些域名解析、nginx 代理等操作，这里不再赘述。如果手动设置的 nginx，需要加上 websocket 相关的请求头，具体不赘述，可搜索一下。",[96,201,205],{"className":202,"code":203,"language":204,"meta":101,"style":101},"language-nginx shiki shiki-themes material-theme-lighter github-light github-dark","proxy_http_version 1.1;\nproxy_set_header Upgrade $http_upgrade;\nproxy_set_header Connection $connection_upgrade;\n","nginx",[75,206,207,220,237],{"__ignoreMap":101},[105,208,209,213,217],{"class":107,"line":108},[105,210,212],{"class":211},"smGrS","proxy_http_version ",[105,214,216],{"class":215},"srdBf","1.1",[105,218,219],{"class":115},";\n",[105,221,222,225,229,232,235],{"class":107,"line":130},[105,223,224],{"class":211},"proxy_set_header ",[105,226,228],{"class":227},"su5hD","Upgrade ",[105,230,231],{"class":115},"$",[105,233,234],{"class":227},"http_upgrade",[105,236,219],{"class":115},[105,238,239,241,244,246,249],{"class":107,"line":139},[105,240,224],{"class":211},[105,242,243],{"class":227},"Connection ",[105,245,231],{"class":115},[105,247,248],{"class":227},"connection_upgrade",[105,250,219],{"class":115},[60,252,253,254,257],{},"登录进去之后设置好管理员帐号，如果出现白屏需要等待一段时间，大概率是默认的 OpenAI 的接口卡住了，等后面把 API 改成阿里云百炼的，就不会卡住了。有条件的可以给容器设置好 ",[75,255,256],{},"HTTP_PROXY"," 的代理，后面联网搜索需要用到。",[53,259,261],{"id":260},"deepseek-r1-接入","DeepSeek-R1 接入",[57,263,264],{},[60,265,266,267,270,271,270,274],{},"进入 Open WebUI 的 ",[75,268,269],{},"管理员面板"," -> ",[75,272,273],{},"外部链接",[75,275,276],{},"设置",[31,278],{"filename":279},"04.png",[57,281,282],{"start":130},[60,283,284,285,288,289,291,292,295,296,299],{},"将 OpenAI 的 API 地址改成阿里云百炼的 API 地址：",[75,286,287],{},"https:\u002F\u002Fdashscope.aliyuncs.com\u002Fcompatible-mode\u002Fv1","，秘钥输入百炼获取的 ",[75,290,77],{},"，模型 ID 输入 ",[75,293,294],{},"deepseek-r1","，记得一定要点输入框后面那个 ",[75,297,298],{},"+"," 加号，不然添加不进去。最后点击“保存”按钮。",[31,301],{"filename":302},"12.png",[57,304,305,308],{"start":139},[60,306,307],{},"打开新会话，测试模型响应。",[60,309,310,311,313,314,317,318,321],{},"如果需要使用阿里云百炼支持的其他模型，可在上述模型 ID 中手动添加需要的模型 ID，或者也可以再添加一个外部连接，模型 ID 留空，就可以添加除了 ",[75,312,294],{}," 和 ",[75,315,316],{},"deepseek-v3"," 之外的其他所有模型了。之所以需要这么操作是因为目前如果直接留空的话，默认拉不出 ",[75,319,320],{},"deepseek"," 相关的模型，手动设置 ID 才能使用，估计日后等阿里云百炼彻底支持 DeepSeek 了就不需要那么操作了。",[31,323],{"filename":324},"09.png",[31,326],{"filename":327},"10.png",[31,329],{"filename":330},"11.png",[53,332,333],{"id":333},"设置联网搜索",[57,335,336,344,353,360,367],{},[60,337,338,339],{},"登录 ",[67,340,343],{"href":341,"rel":342},"https:\u002F\u002Fdevelopers.google.com\u002Fcustom-search",[71],"Google 开发者账号",[60,345,346,347,352],{},"去 ",[67,348,351],{"href":349,"rel":350},"https:\u002F\u002Fprogrammablesearchengine.google.com\u002Fcontrolpanel\u002Fall",[71],"可编程搜索引擎"," 添加一个自定义搜索引擎",[60,354,355],{},[67,356,359],{"href":357,"rel":358},"https:\u002F\u002Fdevelopers.google.com\u002Fcustom-search\u002Fv1\u002Fintroduction",[71],"获取密钥",[60,361,362,363],{},"点击引擎名称，",[67,364,366],{"href":349,"rel":365},[71],"获取搜索引擎 ID",[60,368,369,370,373],{},"前往 Open WebUI 设置页面，联网搜索引擎中下拉选择 ",[75,371,372],{},"google_pse","，输入密钥和搜索引擎ID，点击保存。搜索结果数量可设置多一些（会导致 token 消耗多）",[31,375],{"filename":376},"06.png",[57,378,379],{"start":166},[60,380,381],{},"打开新会话，发现已经有「联网搜索」选项",[31,383],{"filename":384},"07.png",[53,386,387],{"id":387},"结语",[27,389,390,391,396],{},"好了，现在你已经拥有属于自己的 DeepSeek-R1 模型了，并且可以免费使用 100 万 Token，自开通起半年有效期。可在 ",[67,392,395],{"href":393,"rel":394},"https:\u002F\u002Fbailian.console.aliyun.com\u002Fdetail\u002Fdeepseek-r1#\u002Fmodel-market\u002Fdetail\u002Fdeepseek-r1",[71],"阿里云百炼 DeepSeek-R1"," 页面实时查看自己剩余的免费额度数量以及过期时间。有一说一，这 Token 消耗还挺快的，一下午已经消耗了 5 万多 Token 了。",[31,398],{"filename":399},"08.png",[27,401,402],{},"同样的，你还可以白嫖腾讯云，同样也有 100万的免费 Token。",[404,405],"hr",{},[407,408],"reward-code",{},[410,411,412],"style",{},"html pre.shiki code .sQzsp, html code.shiki .sQzsp{--shiki-light:#E53935;--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":101,"searchDepth":130,"depth":130,"links":414},[415,416,417,418,419],{"id":55,"depth":130,"text":55},{"id":83,"depth":130,"text":84},{"id":260,"depth":130,"text":261},{"id":333,"depth":130,"text":333},{"id":387,"depth":130,"text":387},null,"png","2025-02-11",false,"md",{},true,"\u002Fposts\u002F2025\u002Fdeploy-deepseek-r1-for-free",{"text":429,"minutes":430,"time":431,"words":432},"5 min read",4.94,296400,988,{"title":22,"description":29},{"loc":427,"lastmod":435},"2025-02-18","posts\u002F2025\u002F20250211.deploy-deepseek-r1-for-free",[438,439,440,441],"技术","人工智能","大语言模型","DeepSeek","leo4ZEdDEANgF-NvFKhxq93mMJOpiEnKbDqFfmqbgPw",[444,450],{"title":445,"path":446,"stem":447,"date":448,"description":449,"children":-1},"如何在 Open WebUI 中显示 DeepSeek-R1 的思考过程","\u002Fposts\u002F2025\u002Fdisplay-deepseek-r1-thinking","posts\u002F2025\u002F20250212.display-deepseek-r1-thinking","2025-02-12","书接上回，咱们部署好了 DeepSeek-R1 之后，发现没办法显示思考过程，只能等结果出来之后查看结果，这个体感上就会感觉响应很慢。",{"title":451,"path":452,"stem":453,"date":454,"description":455,"children":-1},"如何修改 VSCode 侧边栏字体","\u002Fposts\u002F2025\u002Fchange-font-of-vscode-sidebar","posts\u002F2025\u002F20250107.change-font-of-vscode-sidebar","2025-01-07","如果你折腾过 VSCode 自定义字体的话，你应该知道目前 VSCode 只能自定义编辑器以及终端的字体样式，而侧边栏的字体样式是无法自定义的。不过你可以通过 window.zoomLevel 来曲线救国实现侧边栏字号的调整，但字体依旧无法设置，关于这个问题的讨论，可以查看这个存在了近十年但仍未解决的 issue#519。上下文实在太长，有几百个评论，我也没仔细研究其原因。有兴趣的可以研究一下来龙去脉。",1777579131736]