{"id":84425,"date":"2026-07-26T12:51:00","date_gmt":"2026-07-26T04:51:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/84425.html"},"modified":"2026-07-26T12:51:00","modified_gmt":"2026-07-26T04:51:00","slug":"deepseek-r1-api%e9%80%9f%e6%88%90%ef%bc%9a%e5%85%8d%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e7%9b%b4%e6%8e%a5%e4%ba%91%e7%ab%af%e8%b0%83%e7%94%a8%e6%bc%94%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/84425.html","title":{"rendered":"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a"},"content":{"rendered":"<h2>DeepSeek-R1 API\u901f\u6210&#xff1a;\u514d\u670d\u52a1\u5668&#xff0c;\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a<\/h2>\n<p>\u4f60\u662f\u4e0d\u662f\u4e5f\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5&#xff1f;\u4f5c\u4e3a\u524d\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u624b\u5934\u6709\u4e2aAI\u529f\u80fd\u539f\u578b\u8981\u5c55\u793a\u7ed9\u4ea7\u54c1\u7ecf\u7406\u6216\u5ba2\u6237\u770b&#xff0c;\u4f46\u540e\u7aef\u540c\u4e8b\u6392\u671f\u7d27\u5f20&#xff0c;\u81f3\u5c11\u5f97\u7b49\u4e24\u5468\u624d\u80fd\u63d0\u4f9b\u63a5\u53e3\u3002\u65f6\u95f4\u4e0d\u7b49\u4eba&#xff0c;\u6f14\u793a\u8feb\u5728\u7709\u776b&#xff0c;\u96be\u9053\u53ea\u80fd\u5e72\u7b49\u7740&#xff1f;<\/p>\n<p>\u522b\u6025&#xff01;\u4eca\u5929\u6211\u8981\u5206\u4eab\u4e00\u4e2a\u771f\u6b63\u80fd\u201c\u6551\u573a\u201d\u7684\u65b9\u6848\u2014\u2014\u4f7f\u7528 DeepSeek-R1 \u7684\u516c\u5f00API\u80fd\u529b&#xff0c;\u5728\u4e0d\u9700\u8981\u4efb\u4f55\u540e\u7aef\u5f00\u53d1\u3001\u4e0d\u90e8\u7f72\u6a21\u578b\u3001\u4e0d\u4e70GPU\u670d\u52a1\u5668\u7684\u524d\u63d0\u4e0b&#xff0c;\u76f4\u63a5\u901a\u8fc7\u6d4f\u89c8\u5668\u6216\u672c\u5730\u4ee3\u7801\u8c03\u7528\u5f3a\u5927\u7684AI\u63a8\u7406\u670d\u52a1&#xff0c;\u5feb\u901f\u5b8c\u6210\u539f\u578b\u6f14\u793a\u3002<\/p>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u6211\u5df2\u7ecf\u5728\u591a\u4e2a\u9879\u76ee\u4e2d\u5b9e\u6d4b\u6210\u529f&#xff0c;\u6700\u5feb10\u5206\u949f\u5185\u5c31\u80fd\u8dd1\u901a\u7b2c\u4e00\u4e2a\u8bf7\u6c42&#xff0c;\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u6587\u672c\u56de\u590d\u3001JSON\u7ed3\u6784\u5316\u8f93\u51fa&#xff0c;\u751a\u81f3\u80fd\u5904\u7406\u590d\u6742\u903b\u8f91\u548c\u89d2\u8272\u626e\u6f14\u5bf9\u8bdd\u3002\u5173\u952e\u662f&#xff1a;\u5b8c\u5168\u7ed5\u8fc7\u540e\u7aef\u6392\u671f&#xff0c;\u524d\u7aef\u72ec\u7acb\u95ed\u73af\u641e\u5b9a\u3002<\/p>\n<p>\u672c\u6587\u4e13\u4e3a\u50cf\u4f60\u6211\u4e00\u6837\u7684\u524d\u7aef\u5f00\u53d1\u8005\u8bbe\u8ba1&#xff0c;\u5185\u5bb9\u4ece\u96f6\u5f00\u59cb&#xff0c;\u624b\u628a\u624b\u6559\u4f60\u5982\u4f55\u5229\u7528CSDN\u661f\u56fe\u5e73\u53f0\u63d0\u4f9b\u7684\u9884\u7f6e\u955c\u50cf\u73af\u5883&#xff0c;\u5feb\u901f\u83b7\u53d6\u53ef\u7528\u7684API\u7aef\u70b9&#xff0c;\u5e76\u901a\u8fc7JavaScript\u8f7b\u677e\u96c6\u6210\u5230\u4f60\u7684\u7f51\u9875\u539f\u578b\u4e2d\u3002\u65e0\u8bba\u4f60\u662f\u60f3\u505a\u667a\u80fd\u5ba2\u670ddemo\u3001\u81ea\u52a8\u751f\u6210\u8868\u5355\u6570\u636e&#xff0c;\u8fd8\u662f\u6a21\u62dfAI\u52a9\u624b\u4ea4\u4e92\u6d41\u7a0b&#xff0c;\u8fd9\u5957\u65b9\u6848\u90fd\u80fd\u7acb\u523b\u4e0a\u624b\u3002<\/p>\n<p>\u6211\u4eec\u4f1a\u4e00\u6b65\u6b65\u8d70\u5b8c&#xff1a;\u73af\u5883\u9009\u62e9 \u2192 \u83b7\u53d6API\u5bc6\u94a5 \u2192 \u53d1\u9001HTTP\u8bf7\u6c42 \u2192 \u5904\u7406\u54cd\u5e94 \u2192 \u524d\u7aef\u96c6\u6210 \u2192 \u53c2\u6570\u8c03\u4f18 \u2192 \u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u3002\u8fc7\u7a0b\u4e2d\u8fd8\u4f1a\u544a\u8bc9\u4f60\u54ea\u4e9b\u53c2\u6570\u6700\u5b9e\u7528\u3001\u600e\u4e48\u907f\u514d\u8d85\u65f6\u3001\u5982\u4f55\u8ba9\u8fd4\u56de\u7ed3\u679c\u66f4\u7a33\u5b9a\u53ef\u9884\u6d4b\u3002<\/p>\n<p>\u5b66\u5b8c\u8fd9\u7bc7&#xff0c;\u4f60\u4e0d\u4ec5\u80fd\u505a\u51fa\u4e00\u4e2a\u770b\u5f97\u89c1\u6478\u5f97\u7740\u7684AI\u6f14\u793a\u9875\u9762&#xff0c;\u66f4\u91cd\u8981\u7684\u662f\u638c\u63e1\u4e86\u4e00\u79cd\u201c\u524d\u7aef\u76f4\u8fde\u5927\u6a21\u578b\u201d\u7684\u65b0\u601d\u7ef4\u6a21\u5f0f\u3002\u4ee5\u540e\u518d\u6709\u7c7b\u4f3c\u9700\u6c42&#xff0c;\u518d\u4e5f\u4e0d\u7528\u82e6\u7b49\u540e\u7aef&#xff0c;\u81ea\u5df1\u5c31\u80fd\u5feb\u901f\u9a8c\u8bc1\u60f3\u6cd5&#xff0c;\u63d0\u5347\u4f60\u5728\u56e2\u961f\u4e2d\u7684\u6280\u672f\u8bdd\u8bed\u6743\u3002<\/p>\n<p>\u51c6\u5907\u597d\u4e86\u5417&#xff1f;\u8ba9\u6211\u4eec\u5f00\u59cb\u5427&#xff01;<\/p>\n<h3>1. \u7406\u89e3DeepSeek-R1&#xff1a;\u4e3a\u4ec0\u4e48\u5b83\u9002\u5408\u524d\u7aef\u5feb\u901f\u8c03\u7528<\/h3>\n<h4>1.1 \u4ec0\u4e48\u662fDeepSeek-R1&#xff1f;\u5c0f\u767d\u4e5f\u80fd\u61c2\u7684\u6280\u672f\u5b9a\u4f4d<\/h4>\n<p>\u6211\u4eec\u5148\u6765\u641e\u6e05\u695a\u4e00\u4ef6\u4e8b&#xff1a;DeepSeek-R1 \u5230\u5e95\u662f\u4e2a\u4ec0\u4e48\u4e1c\u897f&#xff1f;\u4f60\u53ef\u4ee5\u628a\u5b83\u60f3\u8c61\u6210\u4e00\u4e2a\u201c\u8d85\u7ea7\u5927\u8111\u201d&#xff0c;\u4e13\u95e8\u64c5\u957f\u52a8\u8111\u7b4b\u89e3\u51b3\u95ee\u9898&#xff0c;\u800c\u4e0d\u662f\u7b80\u5355\u5730\u80cc\u8bf5\u7b54\u6848\u3002<\/p>\n<p>\u4f20\u7edf\u7684\u804a\u5929\u673a\u5668\u4eba\u53ef\u80fd\u66f4\u50cf\u662f\u201c\u8bb0\u5fc6\u9ad8\u624b\u201d&#xff0c;\u4f60\u95ee\u5b83\u95ee\u9898&#xff0c;\u5b83\u4ece\u5df2\u6709\u7684\u77e5\u8bc6\u5e93\u91cc\u627e\u76f8\u4f3c\u7684\u5185\u5bb9\u62fc\u51d1\u56de\u7b54\u3002\u800c DeepSeek-R1 \u662f\u4e2a\u201c\u601d\u8003\u578b\u9009\u624b\u201d&#xff0c;\u5b83\u4f1a\u4e00\u6b65\u6b65\u63a8\u7406\u3001\u5206\u6790\u3001\u62c6\u89e3\u95ee\u9898&#xff0c;\u6700\u540e\u7ed9\u51fa\u7ecf\u8fc7\u6df1\u601d\u719f\u8651\u7684\u7b54\u6848\u3002\u6bd4\u5982\u4f60\u8ba9\u5b83\u89e3\u4e00\u9053\u6570\u5b66\u9898&#xff0c;\u5b83\u4e0d\u4f1a\u76f4\u63a5\u544a\u8bc9\u4f60\u7ed3\u679c&#xff0c;\u800c\u662f\u50cf\u8001\u5e08\u4e00\u6837\u5199\u51fa\u5b8c\u6574\u7684\u89e3\u9898\u6b65\u9aa4\u3002<\/p>\n<p>\u8fd9\u79cd\u80fd\u529b\u6765\u6e90\u4e8e\u5b83\u7684\u8bad\u7ec3\u65b9\u5f0f\u3002\u6839\u636e\u516c\u5f00\u8d44\u6599&#xff0c;DeepSeek-R1 \u4f7f\u7528\u4e86\u5f3a\u5316\u5b66\u4e60&#xff08;Reinforcement Learning&#xff09;\u6280\u672f&#xff0c;\u5728\u5927\u91cf\u590d\u6742\u7684\u4efb\u52a1\u4e0a\u53cd\u590d\u7ec3\u4e60\u201c\u600e\u4e48\u66f4\u597d\u5730\u601d\u8003\u201d\u3002\u8fd9\u5c31\u50cf\u662f\u8ba9\u4e00\u4e2a\u5b66\u751f\u4e0d\u65ad\u53c2\u52a0\u5965\u6570\u6bd4\u8d5b&#xff0c;\u6bcf\u6b21\u7b54\u5b8c\u9898\u90fd\u5f97\u5230\u53cd\u9988&#xff0c;\u6162\u6162\u5b66\u4f1a\u66f4\u9ad8\u6548\u7684\u89e3\u9898\u7b56\u7565\u3002\u56e0\u6b64\u5b83\u5728\u6570\u5b66\u8ba1\u7b97\u3001\u7f16\u7a0b\u5199\u4ee3\u7801\u3001\u903b\u8f91\u63a8\u7406\u3001\u591a\u8f6e\u5bf9\u8bdd\u8fd9\u4e9b\u9700\u8981\u201c\u52a8\u8111\u5b50\u201d\u7684\u4efb\u52a1\u4e0a\u8868\u73b0\u7279\u522b\u51fa\u8272\u3002<\/p>\n<p>\u5bf9\u524d\u7aef\u5f00\u53d1\u8005\u6765\u8bf4&#xff0c;\u8fd9\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u7528\u5b83\u6765\u751f\u6210\u7ed3\u6784\u6e05\u6670\u7684\u56de\u7b54\u3001\u81ea\u52a8\u8865\u5168\u590d\u6742\u903b\u8f91\u7684\u4ee3\u7801\u7247\u6bb5\u3001\u751a\u81f3\u6a21\u62df\u4e13\u4e1a\u9886\u57df\u7684\u95ee\u7b54\u5bf9\u8bdd&#xff08;\u6bd4\u5982\u6cd5\u5f8b\u54a8\u8be2\u3001\u6280\u672f\u652f\u6301&#xff09;&#xff0c;\u800c\u4e0d\u4ec5\u4ec5\u662f\u505a\u4e00\u4e9b\u7b80\u5355\u7684\u95f2\u804a\u56de\u590d\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u5173\u952e\u70b9&#xff1a;DeepSeek-R1 \u9488\u5bf9\u4e2d\u6587\u548c\u82f1\u6587\u505a\u4e86\u6df1\u5ea6\u4f18\u5316\u3002\u4f60\u5728\u7528\u4e2d\u6587\u63d0\u95ee\u65f6&#xff0c;\u5b83\u7406\u89e3\u5f97\u975e\u5e38\u81ea\u7136&#xff0c;\u4e0d\u4f1a\u51fa\u73b0\u90a3\u79cd\u201c\u7ffb\u8bd1\u8154\u201d\u6216\u8005\u8bed\u4e49\u504f\u5dee\u7684\u95ee\u9898\u3002\u8fd9\u5bf9\u4e8e\u56fd\u5185\u9879\u76ee\u7684\u539f\u578b\u6f14\u793a\u5c24\u4e3a\u91cd\u8981&#xff0c;\u7528\u6237\u4f53\u9a8c\u66f4\u771f\u5b9e\u6d41\u7545\u3002<\/p>\n<p>\u603b\u4e4b&#xff0c;DeepSeek-R1 \u4e0d\u662f\u4e00\u4e2a\u666e\u901a\u7684\u8bed\u8a00\u6a21\u578b&#xff0c;\u800c\u662f\u4e00\u4e2a\u5177\u5907\u201c\u6df1\u5ea6\u601d\u8003\u201d\u80fd\u529b\u7684AI\u63a8\u7406\u5f15\u64ce\u3002\u6b63\u662f\u8fd9\u79cd\u9ad8\u9636\u80fd\u529b&#xff0c;\u8ba9\u5b83\u6210\u4e3a\u524d\u7aef\u505aAI\u529f\u80fd\u6f14\u793a\u7684\u7406\u60f3\u9009\u62e9\u2014\u2014\u4f60\u80fd\u5c55\u793a\u7684\u4e0d\u53ea\u662f\u201c\u4f1a\u8bf4\u8bdd\u201d&#xff0c;\u800c\u662f\u201c\u4f1a\u601d\u8003\u201d\u3002<\/p>\n<h4>1.2 \u4e3a\u4ec0\u4e48\u8bf4\u5b83\u662f\u524d\u7aef\u6551\u661f&#xff1f;\u544a\u522b\u7b49\u5f85\u540e\u7aef\u7684\u65e5\u5b50<\/h4>\n<p>\u4ee5\u524d\u6211\u4eec\u8981\u505a\u4e00\u4e2a\u5e26AI\u529f\u80fd\u7684\u539f\u578b&#xff0c;\u6d41\u7a0b\u901a\u5e38\u662f\u8fd9\u6837\u7684&#xff1a;\u4ea7\u54c1\u63d0\u9700\u6c42 \u2192 \u524d\u7aef\u753b\u754c\u9762 \u2192 \u627e\u540e\u7aef\u540c\u5b66\u5bf9\u63a5API \u2192 \u540e\u7aef\u53bb\u7533\u8bf7\u8d44\u6e90\u3001\u90e8\u7f72\u6a21\u578b\u3001\u5199\u63a5\u53e3 \u2192 \u6d4b\u8bd5\u8054\u8c03 \u2192 \u6700\u7ec8\u4e0a\u7ebf\u3002\u6574\u4e2a\u8fc7\u7a0b\u52a8\u8f84\u4e00\u5468\u8d77\u6b65&#xff0c;\u6709\u65f6\u5019\u8fd8\u56e0\u4e3a\u8d44\u6e90\u95ee\u9898\u4e00\u62d6\u518d\u62d6\u3002<\/p>\n<p>\u4f46\u73b0\u5728\u6709\u4e86\u50cf DeepSeek-R1 \u8fd9\u6837\u7684\u4e91\u7aefAPI\u670d\u52a1&#xff0c;\u6574\u4e2a\u94fe\u6761\u88ab\u5927\u5927\u7f29\u77ed\u4e86\u3002\u4f60\u53ef\u4ee5\u628a\u5b83\u770b\u4f5c\u662f\u4e00\u4e2a\u5df2\u7ecf\u67b6\u8bbe\u597d\u3001\u968f\u65f6\u53ef\u7528\u7684\u201cAI\u63d2\u5ea7\u201d\u3002\u4f60\u4e0d\u9700\u8981\u77e5\u9053\u8fd9\u4e2a\u63d2\u5ea7\u80cc\u540e\u7684\u53d1\u7535\u5382\u662f\u600e\u4e48\u8fd0\u4f5c\u7684&#xff08;\u4e5f\u5c31\u662f\u4e0d\u7528\u5173\u5fc3\u6a21\u578b\u600e\u4e48\u8bad\u7ec3\u3001\u670d\u52a1\u5668\u600e\u4e48\u914d\u7f6e&#xff09;&#xff0c;\u53ea\u8981\u63d2\u4e0a\u63d2\u5934&#xff08;\u8c03\u7528API&#xff09;&#xff0c;\u5c31\u80fd\u901a\u7535\u5de5\u4f5c\u3002<\/p>\n<p>\u5177\u4f53\u5230\u6211\u4eec\u7684\u573a\u666f&#xff0c;\u524d\u7aef\u5de5\u7a0b\u5e08\u53ef\u4ee5\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u63a7\u5236\u53f0\u6216\u8005\u672c\u5730Node.js\u73af\u5883\u4e2d\u53d1\u8d77HTTP\u8bf7\u6c42&#xff0c;\u628a\u7528\u6237\u8f93\u5165\u4f20\u7ed9DeepSeek-R1\u7684API&#xff0c;\u7136\u540e\u62ff\u5230\u8fd4\u56de\u7ed3\u679c\u6e32\u67d3\u5230\u9875\u9762\u4e0a\u3002\u6574\u4e2a\u8fc7\u7a0b\u5b8c\u5168\u8131\u79bb\u540e\u7aef\u7cfb\u7edf&#xff0c;\u4e5f\u4e0d\u9700\u8981\u4f60\u81ea\u5df1\u53bb\u79dfGPU\u670d\u52a1\u5668\u3001\u62c9\u53d6\u6a21\u578b\u6743\u91cd\u3001\u642d\u5efa\u63a8\u7406\u670d\u52a1\u2014\u2014\u8fd9\u4e9b\u7e41\u91cd\u7684\u5de5\u4f5c\u90fd\u5df2\u7ecf\u7531\u5e73\u53f0\u65b9\u5b8c\u6210\u4e86\u3002<\/p>\n<p>\u8fd9\u5e26\u6765\u7684\u597d\u5904\u662f\u663e\u800c\u6613\u89c1\u7684&#xff1a;<\/p>\n<ul>\n<li>\u901f\u5ea6\u6781\u5feb&#xff1a;\u4ece\u96f6\u5230\u7b2c\u4e00\u4e2a\u8bf7\u6c42\u6210\u529f&#xff0c;\u6700\u5feb10\u5206\u949f&#xff1b;<\/li>\n<li>\u6210\u672c\u6781\u4f4e&#xff1a;\u5f88\u591a\u5e73\u53f0\u63d0\u4f9b\u514d\u8d39\u989d\u5ea6&#xff0c;\u8db3\u591f\u505a\u51e0\u6b21\u6f14\u793a&#xff1b;<\/li>\n<li>\u7075\u6d3b\u6027\u5f3a&#xff1a;\u4f60\u60f3\u6539\u63d0\u793a\u8bcd&#xff08;prompt&#xff09;\u3001\u8c03\u6574\u53c2\u6570&#xff0c;\u9a6c\u4e0a\u5c31\u80fd\u770b\u5230\u6548\u679c&#xff1b;<\/li>\n<li>\u72ec\u7acb\u6027\u5f3a&#xff1a;\u4e0d\u518d\u4f9d\u8d56\u4ed6\u4eba\u6392\u671f&#xff0c;\u81ea\u5df1\u638c\u63a7\u8fdb\u5ea6\u3002<\/li>\n<\/ul>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff0c;\u5047\u8bbe\u4f60\u8981\u505a\u4e00\u4e2a\u201cAI\u7b80\u5386\u4f18\u5316\u5668\u201d\u7684demo\u3002\u4f20\u7edf\u505a\u6cd5\u4f60\u9700\u8981\u540e\u7aef\u652f\u6301\u624d\u80fd\u8c03\u7528\u6a21\u578b\u3002\u800c\u73b0\u5728&#xff0c;\u4f60\u53ef\u4ee5\u5728React\u7ec4\u4ef6\u91cc\u76f4\u63a5\u7528fetch\u53d1\u9001\u8bf7\u6c42&#xff0c;\u628a\u7528\u6237\u586b\u5199\u7684\u539f\u59cb\u7b80\u5386\u5185\u5bb9\u4f20\u8fc7\u53bb&#xff0c;\u8ba9DeepSeek-R1\u5e2e\u4f60\u6da6\u8272\u3001\u63d0\u70bc\u4eae\u70b9\u3001\u751f\u6210\u4e13\u4e1a\u8868\u8ff0&#xff0c;\u51e0\u79d2\u949f\u5c31\u80fd\u8fd4\u56de\u4e00\u6bb5\u9ad8\u8d28\u91cf\u7684\u4fee\u6539\u5efa\u8bae\u3002<\/p>\n<p>\u8fd9\u79cd\u201c\u524d\u7aef\u76f4\u8fde\u5927\u6a21\u578b\u201d\u7684\u65b0\u6a21\u5f0f&#xff0c;\u6b63\u5728\u6539\u53d8\u6211\u4eec\u6784\u5efaAI\u5e94\u7528\u7684\u65b9\u5f0f\u3002\u4f60\u4e0d\u518d\u662f\u88ab\u52a8\u7b49\u5f85\u63a5\u53e3\u7684\u6d88\u8d39\u8005&#xff0c;\u800c\u662f\u53ef\u4ee5\u4e3b\u52a8\u9a71\u52a8AI\u80fd\u529b\u7684\u521b\u9020\u8005\u3002<\/p>\n<h4>1.3 CSDN\u661f\u56fe\u5e73\u53f0&#xff1a;\u4e00\u952e\u542f\u52a8\u7684AI\u5b9e\u9a8c\u8231<\/h4>\n<p>\u8bf4\u5230\u8fd9\u91cc\u4f60\u53ef\u80fd\u4f1a\u95ee&#xff1a;\u90a3\u6211\u53bb\u54ea\u91cc\u627e\u8fd9\u4e2aAPI\u5462&#xff1f;\u603b\u4e0d\u80fd\u81ea\u5df1\u4ece\u5934\u642d\u5427&#xff1f;<\/p>\n<p>\u7b54\u6848\u5c31\u662f&#xff1a;CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a\u3002\u8fd9\u662f\u4e00\u4e2a\u4e13\u4e3a\u5f00\u53d1\u8005\u6253\u9020\u7684\u4e00\u7ad9\u5f0fAI\u5b9e\u9a8c\u5e73\u53f0&#xff0c;\u91cc\u9762\u9884\u7f6e\u4e86\u5305\u62ec DeepSeek-R1 \u5728\u5185\u7684\u591a\u79cd\u4e3b\u6d41\u5927\u6a21\u578b\u955c\u50cf\u73af\u5883&#xff0c;\u5168\u90e8\u57fa\u4e8e\u9ad8\u6027\u80fdGPU\u670d\u52a1\u5668\u8fd0\u884c&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3001\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u4e3a\u4e00\u4e2a\u201cAI\u5de5\u5177\u7bb1\u8d85\u5e02\u201d\u3002\u4f60\u60f3\u7528Stable Diffusion\u753b\u56fe&#xff1f;\u6709\u73b0\u6210\u7684\u955c\u50cf\u3002\u60f3\u8dd1LLaMA\u505a\u5fae\u8c03&#xff1f;\u4e5f\u6709\u3002\u73b0\u5728\u4f60\u60f3\u8c03\u7528 DeepSeek-R1 \u505a\u6587\u672c\u751f\u6210&#xff1f;\u540c\u6837\u6709\u5bf9\u5e94\u7684\u955c\u50cf\u53ef\u4ee5\u76f4\u63a5\u542f\u52a8\u3002<\/p>\n<p>\u6700\u5173\u952e\u7684\u662f&#xff0c;\u8fd9\u4e9b\u955c\u50cf\u4e0d\u4ec5\u4ec5\u662f\u628a\u6a21\u578b\u8dd1\u8d77\u6765\u90a3\u4e48\u7b80\u5355\u3002\u5b83\u4eec\u901a\u5e38\u5df2\u7ecf\u96c6\u6210\u4e86\u5e38\u7528\u7684API\u670d\u52a1\u6846\u67b6&#xff08;\u6bd4\u5982vLLM\u3001FastAPI&#xff09;&#xff0c;\u5e76\u4e14\u914d\u7f6e\u597d\u4e86\u5bf9\u5916\u66b4\u9732\u7684\u63a5\u53e3\u5730\u5740\u548c\u8ba4\u8bc1\u673a\u5236\u3002\u4f60\u53ea\u9700\u8981\u70b9\u51fb\u51e0\u4e0b\u9f20\u6807&#xff0c;\u5c31\u80fd\u83b7\u5f97\u4e00\u4e2a\u53ef\u8bbf\u95ee\u7684API\u7aef\u70b9&#xff08;endpoint&#xff09;&#xff0c;\u7136\u540e\u5c31\u53ef\u4ee5\u50cf\u8c03\u7528\u4efb\u4f55Web\u670d\u52a1\u4e00\u6837\u53bb\u4f7f\u7528\u5b83\u3002<\/p>\n<p>\u800c\u4e14\u6574\u4e2a\u8fc7\u7a0b\u975e\u5e38\u5b89\u5168\u53ef\u63a7\u3002\u5e73\u53f0\u4f1a\u4e3a\u4f60\u5206\u914d\u72ec\u7acb\u7684\u8fd0\u884c\u5b9e\u4f8b&#xff0c;\u4e0d\u4f1a\u548c\u5176\u4ed6\u7528\u6237\u6df7\u7528\u8d44\u6e90\u3002\u4f60\u8fd8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u4e0d\u540c\u89c4\u683c\u7684GPU\u673a\u578b&#xff0c;\u6bd4\u5982\u60f3\u8981\u66f4\u5feb\u54cd\u5e94\u5c31\u9009A100&#xff0c;\u9884\u7b97\u6709\u9650\u4e5f\u53ef\u4ee5\u9009\u6027\u4ef7\u6bd4\u66f4\u9ad8\u7684\u5361\u578b\u3002<\/p>\n<p>\u5bf9\u4e8e\u524d\u7aef\u5de5\u7a0b\u5e08\u6765\u8bf4&#xff0c;\u8fd9\u5c31\u50cf\u662f\u62ff\u5230\u4e86\u4e00\u628a\u201c\u4e07\u80fd\u94a5\u5319\u201d&#xff1a;\u4e0d\u7ba1\u4f60\u8981\u505a\u4ec0\u4e48AI\u529f\u80fd\u6f14\u793a&#xff0c;\u90fd\u53ef\u4ee5\u5148\u6765\u8fd9\u91cc\u542f\u52a8\u4e00\u4e2a\u5408\u9002\u7684\u955c\u50cf&#xff0c;\u62ff\u5230API\u5730\u5740&#xff0c;\u7136\u540e\u56de\u5230\u81ea\u5df1\u7684\u524d\u7aef\u9879\u76ee\u4e2d\u8fdb\u884c\u96c6\u6210\u6d4b\u8bd5\u3002\u7b49\u4ea7\u54c1\u786e\u8ba4\u65b9\u5411\u540e\u518d\u4ea4\u7ed9\u540e\u7aef\u6b63\u5f0f\u63a5\u5165\u751f\u4ea7\u73af\u5883&#xff0c;\u5f62\u6210\u4e00\u4e2a\u9ad8\u6548\u7684\u201c\u5148\u8bd5\u540e\u5efa\u201d\u6d41\u7a0b\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u770b\u770b&#xff0c;\u5177\u4f53\u8be5\u600e\u4e48\u64cd\u4f5c\u3002<\/p>\n<h3>2. \u5feb\u901f\u90e8\u7f72&#xff1a;\u4e09\u6b65\u83b7\u53d6\u4f60\u7684\u4e13\u5c5eAPI\u7aef\u70b9<\/h3>\n<h4>2.1 \u767b\u5f55\u4e0e\u9009\u955c\u50cf&#xff1a;\u627e\u5230DeepSeek-R1\u7684\u542f\u52a8\u5165\u53e3<\/h4>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u6253\u5f00CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a\u7684\u5b98\u7f51\u9875\u9762\u3002\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u8d26\u53f7&#xff0c;\u5efa\u8bae\u7528\u624b\u673a\u53f7\u5feb\u901f\u6ce8\u518c\u4e00\u4e2a&#xff0c;\u6574\u4e2a\u8fc7\u7a0b\u4e0d\u4f1a\u8d85\u8fc7\u4e00\u5206\u949f\u3002\u767b\u5f55\u4e4b\u540e&#xff0c;\u4f60\u4f1a\u770b\u5230\u9996\u9875\u63a8\u8350\u7684\u5404\u79cd\u70ed\u95e8AI\u955c\u50cf&#xff0c;\u6db5\u76d6\u56fe\u50cf\u751f\u6210\u3001\u8bed\u97f3\u5408\u6210\u3001\u5927\u6a21\u578b\u63a8\u7406\u7b49\u591a\u4e2a\u7c7b\u522b\u3002<\/p>\n<p>\u6211\u4eec\u7684\u76ee\u6807\u5f88\u660e\u786e&#xff1a;\u627e\u5230\u652f\u6301 DeepSeek-R1 \u7684\u955c\u50cf\u3002\u53ef\u4ee5\u5728\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u201cDeepSeek\u201d\u6216\u8005\u201cDeepSeek-R1\u201d\u8fdb\u884c\u5173\u952e\u8bcd\u67e5\u627e\u3002\u76ee\u524d\u5e73\u53f0\u4e0a\u5e38\u89c1\u7684\u76f8\u5173\u955c\u50cf\u540d\u79f0\u53ef\u80fd\u662f\u201cDeepSeek-R1-Distill-Qwen-32B\u201d\u6216\u201cDeepSeek-R1 \u63a8\u7406\u670d\u52a1\u201d\u8fd9\u7c7b\u547d\u540d\u65b9\u5f0f\u3002<\/p>\n<p>\u627e\u5230\u4e4b\u540e&#xff0c;\u70b9\u51fb\u8fdb\u5165\u955c\u50cf\u8be6\u60c5\u9875\u3002\u8fd9\u91cc\u4f60\u4f1a\u770b\u5230\u4e00\u4e9b\u91cd\u8981\u4fe1\u606f&#xff1a;<\/p>\n<ul>\n<li>\u6a21\u578b\u4ecb\u7ecd&#xff1a;\u8bf4\u660e\u8fd9\u662f\u57fa\u4e8eQwen-32B\u84b8\u998f\u4f18\u5316\u7684\u7248\u672c&#xff0c;\u64c5\u957f\u6570\u5b66\u3001\u7f16\u7a0b\u548c\u590d\u6742\u63a8\u7406&#xff1b;<\/li>\n<li>\u786c\u4ef6\u8981\u6c42&#xff1a;\u901a\u5e38\u4f1a\u6807\u6ce8\u6700\u4f4e\u663e\u5b58\u9700\u6c42&#xff08;\u598224GB\u4ee5\u4e0a&#xff09;&#xff0c;\u5e73\u53f0\u5df2\u81ea\u52a8\u5339\u914d\u5408\u9002GPU\u673a\u578b&#xff1b;<\/li>\n<li>\u529f\u80fd\u7279\u6027&#xff1a;\u662f\u5426\u652f\u6301\u6d41\u5f0f\u8f93\u51fa\u3001JSON\u683c\u5f0f\u751f\u6210\u3001\u591a\u8f6e\u5bf9\u8bdd\u7b49&#xff1b;<\/li>\n<li>\u542f\u52a8\u6309\u94ae&#xff1a;\u9192\u76ee\u7684\u201c\u4e00\u952e\u90e8\u7f72\u201d\u6216\u201c\u7acb\u5373\u542f\u52a8\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u770b\u955c\u50cf\u63cf\u8ff0\u4e2d\u662f\u5426\u6709\u63d0\u5230\u201c\u5df2\u96c6\u6210API\u670d\u52a1\u201d\u6216\u201c\u652f\u6301HTTP\u8c03\u7528\u201d\u3002\u8fd9\u662f\u6211\u4eec\u80fd\u5426\u76f4\u63a5\u8c03\u7528\u7684\u5173\u952e\u3002\u5982\u679c\u53ea\u662f\u547d\u4ee4\u884c\u4ea4\u4e92\u5f0f\u7684\u955c\u50cf&#xff0c;\u5c31\u4e0d\u7b26\u5408\u6211\u4eec\u201c\u514d\u670d\u52a1\u5668\u8c03\u7528\u201d\u7684\u9700\u6c42\u3002<\/p>\n<p>\u786e\u8ba4\u65e0\u8bef\u540e&#xff0c;\u70b9\u51fb\u201c\u4e00\u952e\u90e8\u7f72\u201d\u3002\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4e3a\u4f60\u521b\u5efa\u4e00\u4e2a\u9694\u79bb\u7684\u8fd0\u884c\u73af\u5883&#xff0c;\u5e76\u5728\u51e0\u5206\u949f\u5185\u5b8c\u6210\u521d\u59cb\u5316\u3002\u671f\u95f4\u4f60\u53ef\u4ee5\u770b\u5230\u8fdb\u5ea6\u6761\u663e\u793a\u201c\u521b\u5efa\u5b9e\u4f8b\u2192\u52a0\u8f7d\u955c\u50cf\u2192\u542f\u52a8\u670d\u52a1\u2192\u83b7\u53d6\u5730\u5740\u201d\u7684\u5168\u8fc7\u7a0b\u3002<\/p>\n<p>\u6574\u4e2a\u64cd\u4f5c\u5c31\u50cf\u70b9\u5916\u5356\u4e00\u6837\u7b80\u5355&#xff1a;\u9009\u597d\u5546\u54c1 \u2192 \u4e0b\u5355 \u2192 \u7b49\u914d\u9001 \u2192 \u6536\u8d27\u4f7f\u7528\u3002\u552f\u4e00\u7684\u533a\u522b\u662f&#xff0c;\u4f60\u6536\u5230\u7684\u4e0d\u662f\u4e00\u4e2a\u5b9e\u7269&#xff0c;\u800c\u662f\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684AI\u670d\u52a1\u5b9e\u4f8b\u3002<\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f \u6bcf\u6b21\u90e8\u7f72\u90fd\u4f1a\u5360\u7528\u4e00\u5b9a\u7684\u7b97\u529b\u8d44\u6e90&#xff0c;\u8bf7\u5728\u6d4b\u8bd5\u5b8c\u6210\u540e\u53ca\u65f6\u91ca\u653e\u5b9e\u4f8b&#xff0c;\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u6d88\u8017\u3002<\/p>\n<h4>2.2 \u542f\u52a8\u4e0e\u7b49\u5f85&#xff1a;\u76d1\u63a7\u670d\u52a1\u521d\u59cb\u5316\u5168\u8fc7\u7a0b<\/h4>\n<p>\u70b9\u51fb\u90e8\u7f72\u540e&#xff0c;\u9875\u9762\u4f1a\u8df3\u8f6c\u5230\u5b9e\u4f8b\u7ba1\u7406\u754c\u9762\u3002\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u72b6\u6001\u680f&#xff0c;\u5b9e\u65f6\u66f4\u65b0\u5f53\u524d\u7684\u542f\u52a8\u8fdb\u5ea6\u3002\u5178\u578b\u7684\u51e0\u4e2a\u9636\u6bb5\u5982\u4e0b&#xff1a;<\/p>\n<li>\u521b\u5efa\u5bb9\u5668\u5b9e\u4f8b&#xff1a;\u5e73\u53f0\u6b63\u5728\u4e3a\u4f60\u5206\u914dGPU\u8d44\u6e90&#xff0c;\u521b\u5efa\u72ec\u7acb\u7684\u8fd0\u884c\u6c99\u7bb1&#xff1b;<\/li>\n<li>\u62c9\u53d6\u955c\u50cf\u6587\u4ef6&#xff1a;\u4ece\u4ed3\u5e93\u4e0b\u8f7d\u9884\u88c5\u597d\u7684DeepSeek-R1\u955c\u50cf\u5305&#xff0c;\u5927\u5c0f\u53ef\u80fd\u5728\u51e0\u5341GB\u5de6\u53f3&#xff0c;\u53d6\u51b3\u4e8e\u6a21\u578b\u53c2\u6570\u91cf&#xff1b;<\/li>\n<li>\u52a0\u8f7d\u6a21\u578b\u6743\u91cd&#xff1a;\u5c06\u6a21\u578b\u52a0\u8f7d\u8fdbGPU\u663e\u5b58&#xff0c;\u8fd9\u662f\u6700\u8017\u65f6\u7684\u4e00\u6b65&#xff0c;\u5c24\u5176\u662f32B\u7ea7\u522b\u7684\u5927\u6a21\u578b&#xff1b;<\/li>\n<li>\u542f\u52a8API\u670d\u52a1&#xff1a;\u8fd0\u884cFastAPI\u6216vLLM\u670d\u52a1&#xff0c;\u7ed1\u5b9a\u7aef\u53e3\u5e76\u5f00\u542f\u76d1\u542c&#xff1b;<\/li>\n<li>\u670d\u52a1\u5c31\u7eea&#xff1a;\u72b6\u6001\u53d8\u4e3a\u201c\u8fd0\u884c\u4e2d\u201d&#xff0c;\u5e76\u751f\u6210\u53ef\u8bbf\u95ee\u7684\u516c\u7f51\u5730\u5740\u3002<\/li>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u4e00\u822c\u9700\u89813~8\u5206\u949f&#xff0c;\u5177\u4f53\u65f6\u95f4\u53d6\u51b3\u4e8e\u6a21\u578b\u5927\u5c0f\u548c\u670d\u52a1\u5668\u8d1f\u8f7d\u60c5\u51b5\u3002\u4ee5 DeepSeek-R1-Distill-Qwen-32B \u4e3a\u4f8b&#xff0c;\u7531\u4e8e\u5176\u53c2\u6570\u91cf\u8f83\u5927&#xff0c;\u52a0\u8f7d\u65f6\u95f4\u76f8\u5bf9\u8f83\u957f&#xff0c;\u4f46\u4e00\u65e6\u542f\u52a8\u6210\u529f&#xff0c;\u540e\u7eed\u8bf7\u6c42\u54cd\u5e94\u901f\u5ea6\u975e\u5e38\u5feb\u3002<\/p>\n<p>\u5728\u7b49\u5f85\u671f\u95f4&#xff0c;\u4f60\u53ef\u4ee5\u67e5\u770b\u65e5\u5fd7\u8f93\u51fa\u7a97\u53e3\u3002\u90a3\u91cc\u4f1a\u5b9e\u65f6\u6253\u5370\u670d\u52a1\u542f\u52a8\u7684\u65e5\u5fd7\u4fe1\u606f&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<p>Loading model weights&#8230;<br \/>\nModel loaded successfully in 187s<br \/>\nStarting FastAPI server on 0.0.0.0:8000<br \/>\nUvicorn running on http:\/\/0.0.0.0:8000<br \/>\nAPI service is ready to accept requests<\/p>\n<p>\u5f53\u4f60\u770b\u5230\u6700\u540e\u4e00\u884c\u201cAPI service is ready\u201d\u65f6&#xff0c;\u5c31\u610f\u5473\u7740\u4f60\u7684\u4e13\u5c5eAI\u670d\u52a1\u5df2\u7ecf\u5728\u7ebf\u4e86&#xff01;<\/p>\n<p>\u6b64\u65f6\u9875\u9762\u4e0a\u4f1a\u51fa\u73b0\u4e24\u4e2a\u5173\u952e\u4fe1\u606f&#xff1a;<\/p>\n<ul>\n<li>API Endpoint&#xff1a;\u5f62\u5982 https:\/\/your-instance-id.ai.csdn.net\/v1\/completions \u7684URL\u5730\u5740&#xff1b;<\/li>\n<li>Authorization Key&#xff1a;\u7528\u4e8e\u8eab\u4efd\u9a8c\u8bc1\u7684\u5bc6\u94a5&#xff0c;\u901a\u5e38\u4ee5 sk- \u5f00\u5934\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e24\u4e2a\u5c31\u662f\u4f60\u63a5\u4e0b\u6765\u8981\u4f7f\u7528\u7684\u201c\u901a\u884c\u8bc1\u201d\u3002\u8bf7\u52a1\u5fc5\u59a5\u5584\u4fdd\u7ba1&#xff0c;\u4e0d\u8981\u6cc4\u9732\u7ed9\u4ed6\u4eba\u3002<\/p>\n<p>&#x1f4a1; \u63d0\u793a \u5982\u679c\u957f\u65f6\u95f4\u5361\u5728\u67d0\u4e2a\u9636\u6bb5&#xff08;\u8d85\u8fc710\u5206\u949f&#xff09;&#xff0c;\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u542f\u5b9e\u4f8b\u6216\u8054\u7cfb\u5e73\u53f0\u652f\u6301\u3002\u591a\u6570\u60c5\u51b5\u4e0b\u662f\u7f51\u7edc\u6ce2\u52a8\u5bfc\u81f4\u955c\u50cf\u62c9\u53d6\u7f13\u6162\u3002<\/p>\n<h4>2.3 \u9a8c\u8bc1\u8fde\u63a5&#xff1a;\u7528curl\u6d4b\u8bd5\u7b2c\u4e00\u4e2aAPI\u8bf7\u6c42<\/h4>\n<p>\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u6709\u4e86API\u5730\u5740\u548c\u5bc6\u94a5&#xff0c;\u4e0b\u4e00\u6b65\u5c31\u662f\u9a8c\u8bc1\u80fd\u4e0d\u80fd\u6b63\u5e38\u901a\u4fe1\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 curl \u547d\u4ee4\u5728\u7ec8\u7aef\u4e2d\u53d1\u9001\u4e00\u4e2a\u6d4b\u8bd5\u8bf7\u6c42\u3002<\/p>\n<p>\u5047\u8bbe\u4f60\u7684API endpoint\u662f https:\/\/abc123.ai.csdn.net\/v1\/completions&#xff0c;\u5bc6\u94a5\u662f sk-xxxxxx&#xff0c;\u6211\u4eec\u53ef\u4ee5\u6784\u9020\u8fd9\u6837\u4e00\u4e2a\u8bf7\u6c42&#xff1a;<\/p>\n<p>curl https:\/\/abc123.ai.csdn.net\/v1\/completions \\\\<br \/>\n  -H &#034;Content-Type: application\/json&#034; \\\\<br \/>\n  -H &#034;Authorization: Bearer sk-xxxxxx&#034; \\\\<br \/>\n  -d &#039;{<br \/>\n    &#034;model&#034;: &#034;deepseek-r1&#034;,<br \/>\n    &#034;prompt&#034;: &#034;\u4f60\u597d&#xff0c;\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1\u3002&#034;,<br \/>\n    &#034;max_tokens&#034;: 100,<br \/>\n    &#034;temperature&#034;: 0.7<br \/>\n  }&#039;<\/p>\n<p>\u8ba9\u6211\u4eec\u9010\u884c\u89e3\u91ca\u8fd9\u4e2a\u547d\u4ee4&#xff1a;<\/p>\n<ul>\n<li>\u7b2c\u4e00\u884c\u6307\u5b9a\u76ee\u6807URL&#xff1b;<\/li>\n<li>-H \u8868\u793a\u6dfb\u52a0HTTP\u5934&#xff0c;\u7b2c\u4e00\u4e2a\u662f\u5185\u5bb9\u7c7b\u578b&#xff0c;\u7b2c\u4e8c\u4e2a\u662f\u6388\u6743\u4fe1\u606f&#xff1b;<\/li>\n<li>-d \u540e\u9762\u8ddf\u7740\u8bf7\u6c42\u4f53&#xff0c;\u662f\u4e00\u4e2aJSON\u5bf9\u8c61&#xff0c;\u5305\u542b&#xff1a;<\/li>\n<li>model&#xff1a;\u6307\u5b9a\u8c03\u7528\u7684\u6a21\u578b\u540d\u79f0&#xff1b;<\/li>\n<li>prompt&#xff1a;\u4f60\u8f93\u5165\u7684\u63d0\u793a\u8bcd&#xff1b;<\/li>\n<li>max_tokens&#xff1a;\u9650\u5236\u6700\u5927\u8f93\u51fa\u957f\u5ea6&#xff1b;<\/li>\n<li>temperature&#xff1a;\u63a7\u5236\u8f93\u51fa\u968f\u673a\u6027&#xff0c;\u6570\u503c\u8d8a\u4f4e\u8d8a\u7a33\u5b9a\u3002<\/li>\n<\/ul>\n<p>\u6267\u884c\u8fd9\u6761\u547d\u4ee4\u540e&#xff0c;\u5982\u679c\u4e00\u5207\u6b63\u5e38&#xff0c;\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u54cd\u5e94&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;id&#034;: &#034;cmpl-123&#034;,<br \/>\n  &#034;object&#034;: &#034;text_completion&#034;,<br \/>\n  &#034;created&#034;: 1712345678,<br \/>\n  &#034;model&#034;: &#034;deepseek-r1&#034;,<br \/>\n  &#034;choices&#034;: [<br \/>\n    {<br \/>\n      &#034;text&#034;: &#034;\u6211\u662fDeepSeek-R1&#xff0c;\u4e00\u4e2a\u7531\u6df1\u5ea6\u6c42\u7d22\u5f00\u53d1\u7684\u5927\u578b\u63a8\u7406\u6a21\u578b\u2026\u2026&#034;,<br \/>\n      &#034;index&#034;: 0,<br \/>\n      &#034;finish_reason&#034;: &#034;length&#034;<br \/>\n    }<br \/>\n  ]<br \/>\n}<\/p>\n<p>\u770b\u5230\u8fd9\u6bb5\u56de\u590d&#xff0c;\u606d\u559c\u4f60&#xff01;\u4f60\u5df2\u7ecf\u6210\u529f\u6253\u901a\u4e86\u4ece\u524d\u7aef\u5230AI\u6a21\u578b\u7684\u5b8c\u6574\u94fe\u8def\u3002\u54ea\u6015\u4f60\u73b0\u5728\u4ec0\u4e48\u90fd\u4e0d\u505a&#xff0c;\u5149\u51ed\u8fd9\u4e2a\u7ed3\u679c\u4e5f\u80fd\u5411\u4ea7\u54c1\u7ecf\u7406\u8bc1\u660e&#xff1a;\u201c\u770b&#xff0c;AI\u529f\u80fd\u5df2\u7ecf\u8dd1\u901a\u4e86&#xff01;\u201d<\/p>\n<p>\u5982\u679c\u9047\u5230\u9519\u8bef&#xff0c;\u5e38\u89c1\u539f\u56e0\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u5bc6\u94a5\u9519\u8bef \u2192 \u68c0\u67e5\u662f\u5426\u590d\u5236\u5b8c\u6574&#xff1b;<\/li>\n<li>\u5730\u5740\u5931\u6548 \u2192 \u67e5\u770b\u5b9e\u4f8b\u662f\u5426\u4ecd\u5728\u8fd0\u884c&#xff1b;<\/li>\n<li>JSON\u683c\u5f0f\u4e0d\u5bf9 \u2192 \u4f7f\u7528\u5728\u7ebf\u5de5\u5177\u6821\u9a8c\u8bed\u6cd5&#xff1b;<\/li>\n<li>\u8de8\u57df\u95ee\u9898 \u2192 \u540e\u7eed\u524d\u7aef\u8c03\u7528\u65f6\u9700\u6ce8\u610f\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u95ee\u9898\u6211\u4eec\u540e\u9762\u90fd\u4f1a\u4e00\u4e00\u89e3\u51b3\u3002<\/p>\n<h3>3. \u524d\u7aef\u96c6\u6210&#xff1a;\u5728\u7f51\u9875\u4e2d\u8c03\u7528AI\u751f\u6210\u5185\u5bb9<\/h3>\n<h4>3.1 \u6784\u5efa\u57fa\u7840HTML\u9875\u9762&#xff1a;\u642d\u5efa\u6f14\u793a\u539f\u578b\u6846\u67b6<\/h4>\n<p>\u65e2\u7136API\u5df2\u7ecf\u901a\u4e86&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u628a\u5b83\u5d4c\u5165\u5230\u4e00\u4e2a\u771f\u5b9e\u7684\u7f51\u9875\u73af\u5883\u4e2d\u3002\u4e3a\u4e86\u65b9\u4fbf\u6f14\u793a&#xff0c;\u6211\u4eec\u4ece\u6700\u7b80\u5355\u7684\u9759\u6001\u9875\u9762\u5f00\u59cb\u3002<\/p>\n<p>\u65b0\u5efa\u4e00\u4e2a index.html \u6587\u4ef6&#xff0c;\u5199\u5165\u4ee5\u4e0b\u57fa\u7840\u7ed3\u6784&#xff1a;<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;zh&#034;&gt;<br \/>\n&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034; \/&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;\/&gt;<br \/>\n  &lt;title&gt;AI\u529f\u80fd\u6f14\u793a &#8211; DeepSeek-R1\u8c03\u7528&lt;\/title&gt;<br \/>\n  &lt;style&gt;<br \/>\n    body {<br \/>\n      font-family: &#039;Segoe UI&#039;, sans-serif;<br \/>\n      max-width: 800px;<br \/>\n      margin: 40px auto;<br \/>\n      padding: 20px;<br \/>\n      line-height: 1.6;<br \/>\n    }<br \/>\n    textarea, button, pre {<br \/>\n      width: 100%;<br \/>\n      margin: 10px 0;<br \/>\n      padding: 12px;<br \/>\n      border: 1px solid #ddd;<br \/>\n      border-radius: 6px;<br \/>\n      font-size: 14px;<br \/>\n    }<br \/>\n    button {<br \/>\n      background-color: #007acc;<br \/>\n      color: white;<br \/>\n      cursor: pointer;<br \/>\n      font-weight: bold;<br \/>\n    }<br \/>\n    button:hover {<br \/>\n      background-color: #005a99;<br \/>\n    }<br \/>\n    .loading {<br \/>\n      color: #666;<br \/>\n      font-style: italic;<br \/>\n    }<br \/>\n  &lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n  &lt;h1&gt;&#x1f680; AI\u6587\u6848\u52a9\u624b\u6f14\u793a&lt;\/h1&gt;<br \/>\n  &lt;p&gt;\u8f93\u5165\u4f60\u7684\u539f\u59cb\u60f3\u6cd5&#xff0c;\u8ba9DeepSeek-R1\u5e2e\u4f60\u751f\u6210\u4e13\u4e1a\u8868\u8fbe\u3002&lt;\/p&gt;<\/p>\n<p>  &lt;label for&#061;&#034;prompt&#034;&gt;\u8bf7\u8f93\u5165\u5185\u5bb9&#xff1a;&lt;\/label&gt;<br \/>\n  &lt;textarea id&#061;&#034;prompt&#034; rows&#061;&#034;4&#034; placeholder&#061;&#034;\u4f8b\u5982&#xff1a;\u5e2e\u6211\u5199\u4e00\u6bb5\u5173\u4e8e\u73af\u4fdd\u7684\u4ea7\u54c1\u5ba3\u4f20\u8bed&#034;&gt;&lt;\/textarea&gt;<\/p>\n<p>  &lt;button onclick&#061;&#034;callAI()&#034;&gt;\u8c03\u7528AI\u751f\u6210&lt;\/button&gt;<\/p>\n<p>  &lt;div id&#061;&#034;result&#034;&gt;<br \/>\n    &lt;label&gt;AI\u751f\u6210\u7ed3\u679c&#xff1a;&lt;\/label&gt;<br \/>\n    &lt;pre id&#061;&#034;output&#034;&gt;\u7b49\u5f85\u751f\u6210&#8230;&lt;\/pre&gt;<br \/>\n  &lt;\/div&gt;<\/p>\n<p>  &lt;script src&#061;&#034;app.js&#034;&gt;&lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>\u8fd9\u4e2a\u9875\u9762\u975e\u5e38\u7b80\u6d01\u660e\u4e86&#xff1a;<\/p>\n<ul>\n<li>\u9876\u90e8\u662f\u6807\u9898\u548c\u8bf4\u660e\u6587\u5b57&#xff1b;<\/li>\n<li>\u4e2d\u95f4\u662f\u4e00\u4e2a\u6587\u672c\u8f93\u5165\u6846&#xff0c;\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u4efb\u610f\u63d0\u793a\u8bcd&#xff1b;<\/li>\n<li>\u4e00\u4e2a\u6309\u94ae\u89e6\u53d1AI\u8c03\u7528&#xff1b;<\/li>\n<li>\u5e95\u90e8\u7528 &lt;pre&gt; \u6807\u7b7e\u663e\u793a\u8fd4\u56de\u7ed3\u679c&#xff0c;\u4fdd\u6301\u683c\u5f0f\u6e05\u6670\u3002<\/li>\n<\/ul>\n<p>\u6837\u5f0f\u65b9\u9762\u91c7\u7528\u4e86\u73b0\u4ee3\u5316\u7684UI\u8bbe\u8ba1&#xff0c;\u6d45\u7070\u8272\u8fb9\u6846\u3001\u5706\u89d2\u6309\u94ae\u3001\u5408\u9002\u7684\u884c\u9ad8\u548c\u5b57\u4f53&#xff0c;\u786e\u4fdd\u5728\u624b\u673a\u548c\u7535\u8111\u4e0a\u90fd\u6709\u826f\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u5728\u540c\u76ee\u5f55\u4e0b\u521b\u5efa app.js \u6587\u4ef6&#xff0c;\u7528\u6765\u7f16\u5199\u8c03\u7528API\u7684\u6838\u5fc3\u903b\u8f91\u3002\u6574\u4e2a\u7ed3\u6784\u6e05\u6670\u5206\u79bb&#xff0c;\u4fbf\u4e8e\u7ef4\u62a4\u548c\u6269\u5c55\u3002<\/p>\n<p>\u4f60\u4f1a\u53d1\u73b0&#xff0c;\u8fd9\u4e2a\u9875\u9762\u672c\u8eab\u6ca1\u6709\u4efb\u4f55\u540e\u7aef\u4f9d\u8d56&#xff0c;\u7eaf\u9759\u6001\u6587\u4ef6\u5c31\u80fd\u8fd0\u884c\u3002\u4f60\u53ef\u4ee5\u628a\u5b83\u653e\u5728\u672c\u5730\u78c1\u76d8\u53cc\u51fb\u6253\u5f00&#xff0c;\u6216\u8005\u7528VS Code\u7684Live Server\u63d2\u4ef6\u542f\u52a8\u4e00\u4e2a\u4e34\u65f6\u670d\u52a1\u5668\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u6211\u4eec\u201c\u514d\u670d\u52a1\u5668\u8c03\u7528\u201d\u7684\u6838\u5fc3\u4f18\u52bf&#xff1a;\u6240\u6709AI\u80fd\u529b\u90fd\u901a\u8fc7\u524d\u7aef\u76f4\u63a5\u8bf7\u6c42\u4e91\u7aef\u670d\u52a1\u83b7\u53d6&#xff0c;\u65e0\u9700\u4e2d\u95f4\u5c42\u8f6c\u53d1\u3002<\/p>\n<h4>3.2 \u7f16\u5199JavaScript\u8c03\u7528\u903b\u8f91&#xff1a;\u5b9e\u73b0\u5f02\u6b65\u8bf7\u6c42\u51fd\u6570<\/h4>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u586b\u5145 app.js \u6587\u4ef6&#xff0c;\u5b9e\u73b0\u771f\u6b63\u7684API\u8c03\u7528\u529f\u80fd\u3002<\/p>\n<p>\/\/ \u914d\u7f6eAPI\u4fe1\u606f&#xff08;\u5efa\u8bae\u540e\u671f\u79fb\u81f3\u73af\u5883\u53d8\u91cf&#xff09;<br \/>\nconst API_ENDPOINT &#061; &#039;https:\/\/abc123.ai.csdn.net\/v1\/completions&#039;;<br \/>\nconst API_KEY &#061; &#039;sk-xxxxxx&#039;;<\/p>\n<p>\/\/ \u83b7\u53d6DOM\u5143\u7d20<br \/>\nconst promptInput &#061; document.getElementById(&#039;prompt&#039;);<br \/>\nconst outputArea &#061; document.getElementById(&#039;output&#039;);<\/p>\n<p>\/\/ \u4e3b\u8c03\u7528\u51fd\u6570<br \/>\nasync function callAI() {<br \/>\n  const userPrompt &#061; promptInput.value.trim();<\/p>\n<p>  if (!userPrompt) {<br \/>\n    alert(&#039;\u8bf7\u8f93\u5165\u8981\u5904\u7406\u7684\u5185\u5bb9&#xff01;&#039;);<br \/>\n    return;<br \/>\n  }<\/p>\n<p>  \/\/ \u663e\u793a\u52a0\u8f7d\u72b6\u6001<br \/>\n  outputArea.textContent &#061; &#039;AI\u6b63\u5728\u601d\u8003\u4e2d&#xff0c;\u8bf7\u7a0d\u5019&#8230;&#039;;<br \/>\n  outputArea.className &#061; &#039;loading&#039;;<\/p>\n<p>  try {<br \/>\n    const response &#061; await fetch(API_ENDPOINT, {<br \/>\n      method: &#039;POST&#039;,<br \/>\n      headers: {<br \/>\n        &#039;Content-Type&#039;: &#039;application\/json&#039;,<br \/>\n        &#039;Authorization&#039;: &#096;Bearer ${API_KEY}&#096;<br \/>\n      },<br \/>\n      body: JSON.stringify({<br \/>\n        model: &#039;deepseek-r1&#039;,<br \/>\n        prompt: userPrompt,<br \/>\n        max_tokens: 300,<br \/>\n        temperature: 0.8,<br \/>\n        top_p: 0.9,<br \/>\n        frequency_penalty: 0.3<br \/>\n      })<br \/>\n    });<\/p>\n<p>    if (!response.ok) {<br \/>\n      throw new Error(&#096;HTTP ${response.status}: ${await response.text()}&#096;);<br \/>\n    }<\/p>\n<p>    const data &#061; await response.json();<br \/>\n    const generatedText &#061; data.choices[0].text.trim();<\/p>\n<p>    \/\/ \u66f4\u65b0\u9875\u9762\u663e\u793a<br \/>\n    outputArea.textContent &#061; generatedText;<br \/>\n    outputArea.className &#061; &#039;&#039;;<\/p>\n<p>  } catch (error) {<br \/>\n    console.error(&#039;API\u8c03\u7528\u5931\u8d25:&#039;, error);<br \/>\n    outputArea.textContent &#061; &#096;\u8c03\u7528\u5931\u8d25&#xff1a;${error.message}\\\\n\\\\n\u8bf7\u68c0\u67e5API\u5730\u5740\u548c\u5bc6\u94a5\u662f\u5426\u6b63\u786e&#xff0c;\u6216\u8054\u7cfb\u7ba1\u7406\u5458\u3002&#096;;<br \/>\n    outputArea.className &#061; &#039;&#039;;<br \/>\n  }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u867d\u7136\u4e0d\u957f&#xff0c;\u4f46\u5305\u542b\u4e86\u5b8c\u6574\u7684\u9519\u8bef\u5904\u7406\u548c\u7528\u6237\u4f53\u9a8c\u4f18\u5316&#xff1a;<\/p>\n<ul>\n<li>\u4f7f\u7528 async\/await \u5b9e\u73b0\u5f02\u6b65\u8bf7\u6c42&#xff0c;\u907f\u514d\u963b\u585e\u4e3b\u7ebf\u7a0b&#xff1b;<\/li>\n<li>\u6dfb\u52a0\u4e86\u8f93\u5165\u6821\u9a8c&#xff0c;\u9632\u6b62\u7a7a\u63d0\u4ea4&#xff1b;<\/li>\n<li>\u8bf7\u6c42\u8fc7\u7a0b\u4e2d\u663e\u793a\u201c\u6b63\u5728\u601d\u8003\u201d\u63d0\u793a&#xff0c;\u63d0\u5347\u4ea4\u4e92\u611f&#xff1b;<\/li>\n<li>\u6210\u529f\u65f6\u63d0\u53d6 data.choices[0].text \u5e76\u5c55\u793a&#xff1b;<\/li>\n<li>\u5931\u8d25\u65f6\u6355\u83b7\u5f02\u5e38\u5e76\u53cb\u597d\u63d0\u793a&#xff0c;\u540c\u65f6\u8f93\u51fa\u9519\u8bef\u65e5\u5fd7\u4f9b\u8c03\u8bd5\u3002<\/li>\n<\/ul>\n<p>\u5176\u4e2d\u51e0\u4e2a\u5173\u952e\u53c2\u6570\u503c\u5f97\u7279\u522b\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>temperature: 0.8&#xff1a;\u9002\u5f53\u589e\u52a0\u521b\u9020\u6027&#xff0c;\u9002\u5408\u6587\u6848\u751f\u6210&#xff1b;<\/li>\n<li>top_p: 0.9&#xff1a;\u91c7\u7528\u6838\u91c7\u6837&#xff0c;\u4fdd\u8bc1\u591a\u6837\u6027\u540c\u65f6\u63a7\u5236\u79bb\u8c31\u8f93\u51fa&#xff1b;<\/li>\n<li>frequency_penalty: 0.3&#xff1a;\u51cf\u5c11\u91cd\u590d\u7528\u8bcd&#xff0c;\u4f7f\u8bed\u8a00\u66f4\u4e30\u5bcc\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u503c\u90fd\u662f\u7ecf\u8fc7\u5b9e\u6d4b\u8c03\u6574\u7684\u5e73\u8861\u70b9&#xff0c;\u65e2\u4e0d\u4f1a\u592a\u6b7b\u677f&#xff0c;\u4e5f\u4e0d\u4f1a\u592a\u53d1\u6563\u3002<\/p>\n<p>\u5f53\u7136&#xff0c;\u51fa\u4e8e\u5b89\u5168\u8003\u8651&#xff0c;\u5b9e\u9645\u9879\u76ee\u4e2d\u4e0d\u5e94\u5c06API\u5bc6\u94a5\u786c\u7f16\u7801\u5728\u524d\u7aef\u4ee3\u7801\u4e2d&#xff0c;\u5426\u5219\u5bb9\u6613\u88ab\u4ed6\u4eba\u76d7\u7528\u3002\u4f46\u5728\u505a\u5185\u90e8\u6f14\u793a\u65f6&#xff0c;\u4e3a\u4e86\u5feb\u901f\u9a8c\u8bc1&#xff0c;\u8fd9\u79cd\u65b9\u5f0f\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002\u540e\u7eed\u6b63\u5f0f\u4e0a\u7ebf\u65f6\u53ef\u901a\u8fc7\u540e\u7aef\u4ee3\u7406\u6216\u7b7e\u540d\u673a\u5236\u6765\u4fdd\u62a4\u5bc6\u94a5\u3002<\/p>\n<h4>3.3 \u5904\u7406\u8de8\u57df\u95ee\u9898&#xff1a;CORS\u4e0e\u4ee3\u7406\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u7ec6\u5fc3\u7684\u670b\u53cb\u53ef\u80fd\u4f1a\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898&#xff1a;\u5f53\u6211\u4eec\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u8fd9\u4e2a\u9875\u9762\u65f6&#xff0c;\u5f88\u53ef\u80fd\u9047\u5230 CORS&#xff08;\u8de8\u6e90\u8d44\u6e90\u5171\u4eab&#xff09;\u9519\u8bef\u3002<\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u6d4f\u89c8\u5668\u7684\u5b89\u5168\u7b56\u7565\u4e0d\u5141\u8bb8\u4efb\u610f\u7f51\u9875\u5411\u5176\u4ed6\u57df\u540d\u53d1\u8d77\u8bf7\u6c42\u3002\u867d\u7136\u6211\u4eec\u7684API\u670d\u52a1\u8fd0\u884c\u5728 https:\/\/abc123.ai.csdn.net&#xff0c;\u4f46\u4f60\u7684HTML\u6587\u4ef6\u53ef\u80fd\u662f\u5728 file:\/\/ \u534f\u8bae\u4e0b\u6253\u5f00&#xff0c;\u6216\u8005\u90e8\u7f72\u5728\u53e6\u4e00\u4e2a\u57df\u540d\u4e0a&#xff0c;\u8fd9\u5c31\u6784\u6210\u4e86\u8de8\u57df\u8bf7\u6c42\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u6709\u51e0\u79cd&#xff1a;<\/p>\n<h5>\u65b9\u6848\u4e00&#xff1a;\u4f7f\u7528\u672c\u5730\u5f00\u53d1\u670d\u52a1\u5668<\/h5>\n<p>\u6700\u7b80\u5355\u7684\u89c4\u907f\u65b9\u5f0f\u662f\u907f\u514d file:\/\/ \u534f\u8bae\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Node.js\u7684\u7b80\u6613\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>npx serve -s<\/p>\n<p>\u6216\u8005Python\u4e00\u884c\u547d\u4ee4&#xff1a;<\/p>\n<p>python -m http.server 8000<\/p>\n<p>\u7136\u540e\u901a\u8fc7 http:\/\/localhost:8000 \u8bbf\u95ee\u9875\u9762&#xff0c;\u8fd9\u6837\u5c31\u5c5e\u4e8e\u6807\u51c6\u7684HTTP\u8bf7\u6c42&#xff0c;\u66f4\u5bb9\u6613\u901a\u8fc7CORS\u9a8c\u8bc1\u3002<\/p>\n<h5>\u65b9\u6848\u4e8c&#xff1a;\u5e73\u53f0\u542f\u7528CORS\u652f\u6301<\/h5>\n<p>\u7406\u60f3\u60c5\u51b5\u4e0b&#xff0c;API\u670d\u52a1\u7aef\u5e94\u4e3b\u52a8\u8bbe\u7f6e\u54cd\u5e94\u5934\u5141\u8bb8\u8de8\u57df&#xff1a;<\/p>\n<p>Access-Control-Allow-Origin: *<br \/>\nAccess-Control-Allow-Methods: POST, GET, OPTIONS<br \/>\nAccess-Control-Allow-Headers: Content-Type, Authorization<\/p>\n<p>\u4f60\u53ef\u4ee5\u67e5\u770b\u955c\u50cf\u6587\u6863\u6216\u8054\u7cfb\u5e73\u53f0\u65b9\u786e\u8ba4\u662f\u5426\u5df2\u5f00\u542f\u3002\u90e8\u5206AI\u670d\u52a1\u5e73\u53f0\u9ed8\u8ba4\u5141\u8bb8\u6765\u81ea\u7279\u5b9a\u57df\u7684\u8bf7\u6c42\u3002<\/p>\n<h5>\u65b9\u6848\u4e09&#xff1a;\u5f00\u53d1\u9636\u6bb5\u4f7f\u7528\u4ee3\u7406<\/h5>\n<p>\u5982\u679c\u65e0\u6cd5\u4fee\u6539\u670d\u52a1\u7aef\u914d\u7f6e&#xff0c;\u53ef\u4ee5\u5728\u672c\u5730\u642d\u5efa\u4e00\u4e2a\u8f7b\u91cf\u4ee3\u7406\u3002\u4f8b\u5982\u7528Express\u5199\u4e2a\u4e2d\u95f4\u5c42&#xff1a;<\/p>\n<p>\/\/ server.js<br \/>\nconst express &#061; require(&#039;express&#039;);<br \/>\nconst { request } &#061; require(&#039;http&#039;);<br \/>\nconst app &#061; express();<\/p>\n<p>app.use(express.json());<\/p>\n<p>app.post(&#039;\/api\/generate&#039;, async (req, res) &#061;&gt; {<br \/>\n  const upstream &#061; request({<br \/>\n    hostname: &#039;abc123.ai.csdn.net&#039;,<br \/>\n    path: &#039;\/v1\/completions&#039;,<br \/>\n    method: &#039;POST&#039;,<br \/>\n    headers: {<br \/>\n      &#039;Content-Type&#039;: &#039;application\/json&#039;,<br \/>\n      &#039;Authorization&#039;: &#039;Bearer sk-xxxxxx&#039;<br \/>\n    }<br \/>\n  }, upstreamRes &#061;&gt; {<br \/>\n    upstreamRes.pipe(res);<br \/>\n  });<\/p>\n<p>  req.pipe(upstream);<br \/>\n});<\/p>\n<p>app.listen(3000, () &#061;&gt; {<br \/>\n  console.log(&#039;Proxy server running on port 3000&#039;);<br \/>\n});<\/p>\n<p>\u7136\u540e\u524d\u7aef\u6539\u4e3a\u8c03\u7528 \/api\/generate&#xff0c;\u7531\u672c\u5730\u670d\u52a1\u8f6c\u53d1\u8bf7\u6c42&#xff0c;\u7ed5\u8fc7\u6d4f\u89c8\u5668\u9650\u5236\u3002<\/p>\n<p>\u5bf9\u4e8e\u6f14\u793a\u573a\u666f&#xff0c;\u63a8\u8350\u4f18\u5148\u5c1d\u8bd5\u65b9\u6848\u4e00 &#043; \u786e\u8ba4\u5e73\u53f0CORS\u7b56\u7565\u3002\u5927\u591a\u6570\u73b0\u4ee3AI\u670d\u52a1\u5e73\u53f0\u90fd\u4f1a\u8003\u8651\u5230\u524d\u7aef\u96c6\u6210\u9700\u6c42&#xff0c;\u63d0\u4f9b\u4e00\u5b9a\u7a0b\u5ea6\u7684\u8de8\u57df\u652f\u6301\u3002<\/p>\n<h3>4. \u53c2\u6570\u8c03\u4f18\u4e0e\u5b9e\u6218\u6280\u5de7&#xff1a;\u8ba9\u4f60\u7684AI\u8f93\u51fa\u66f4\u7cbe\u51c6<\/h3>\n<h4>4.1 \u5173\u952e\u53c2\u6570\u8be6\u89e3&#xff1a;\u63a7\u5236AI\u884c\u4e3a\u7684\u201c\u65b9\u5411\u76d8\u201d<\/h4>\n<p>\u8c03\u7528API\u65f6&#xff0c;\u4ec5\u4ec5\u4f20\u4e2aprompt\u662f\u4e0d\u591f\u7684\u3002\u8981\u60f3\u8ba9AI\u8f93\u51fa\u7b26\u5408\u9884\u671f&#xff0c;\u5fc5\u987b\u5b66\u4f1a\u9a7e\u9a6d\u51e0\u4e2a\u6838\u5fc3\u53c2\u6570\u3002\u6211\u628a\u5b83\u4eec\u6bd4\u4f5c\u6c7d\u8f66\u7684\u65b9\u5411\u76d8\u3001\u6cb9\u95e8\u548c\u5239\u8f66\u2014\u2014\u638c\u63e1\u5f97\u597d&#xff0c;\u5c31\u80fd\u5e73\u7a33\u62b5\u8fbe\u76ee\u7684\u5730&#xff1b;\u63a7\u5236\u4e0d\u597d&#xff0c;\u5c31\u5bb9\u6613\u8dd1\u504f\u6216\u649e\u5899\u3002<\/p>\n<h5>temperature&#xff1a;\u63a7\u5236\u521b\u9020\u529b\u7684\u65cb\u94ae<\/h5>\n<p>\u8fd9\u4e2a\u53c2\u6570\u51b3\u5b9aAI\u56de\u7b54\u7684\u201c\u968f\u673a\u6027\u201d\u3002\u6570\u503c\u8303\u56f4\u4e00\u822c\u662f0.0\u52302.0\u3002<\/p>\n<ul>\n<li>\u4f4e\u503c&#xff08;0.1~0.5&#xff09;&#xff1a;AI\u53d8\u5f97\u975e\u5e38\u4fdd\u5b88&#xff0c;\u603b\u662f\u9009\u62e9\u6982\u7387\u6700\u9ad8\u7684\u8bcd&#xff0c;\u8f93\u51fa\u9ad8\u5ea6\u786e\u5b9a\u3001\u91cd\u590d\u6027\u5f3a\u3002\u9002\u5408\u9700\u8981\u51c6\u786e\u7b54\u6848\u7684\u573a\u666f&#xff0c;\u6bd4\u5982\u6570\u5b66\u8ba1\u7b97\u3001\u4e8b\u5b9e\u67e5\u8be2\u3002<\/li>\n<li>\u4e2d\u503c&#xff08;0.6~0.8&#xff09;&#xff1a;\u5e73\u8861\u521b\u9020\u6027\u548c\u7a33\u5b9a\u6027&#xff0c;\u9002\u5408\u5927\u591a\u6570\u901a\u7528\u4efb\u52a1&#xff0c;\u5982\u6587\u6848\u751f\u6210\u3001\u5bf9\u8bdd\u56de\u590d\u3002<\/li>\n<li>\u9ad8\u503c&#xff08;0.9\u4ee5\u4e0a&#xff09;&#xff1a;AI\u53d8\u5f97\u5929\u9a6c\u884c\u7a7a&#xff0c;\u53ef\u80fd\u51fa\u73b0\u65b0\u9896\u4f46\u4e0d\u9760\u8c31\u7684\u56de\u7b54\u3002\u9002\u5408\u5934\u8111\u98ce\u66b4\u3001\u521b\u610f\u5199\u4f5c\u3002<\/li>\n<\/ul>\n<p>\u5efa\u8bae&#xff1a;\u6f14\u793a\u65f6\u75280.7~0.8&#xff0c;\u65e2\u6709\u4eae\u70b9\u53c8\u4e0d\u81f3\u4e8e\u5931\u63a7\u3002<\/p>\n<h5>max_tokens&#xff1a;\u8bbe\u5b9a\u8f93\u51fa\u957f\u5ea6\u7684\u62a4\u680f<\/h5>\n<p>\u9650\u5236AI\u6700\u591a\u80fd\u8f93\u51fa\u591a\u5c11\u4e2atoken&#xff08;\u5927\u81f4\u76f8\u5f53\u4e8e\u6c49\u5b57\u6570\u91cf&#xff09;\u3002\u592a\u77ed\u8bf4\u4e0d\u5b8c&#xff0c;\u592a\u957f\u6d6a\u8d39\u8d44\u6e90\u3002<\/p>\n<ul>\n<li>\u4e00\u822c\u56de\u590d&#xff1a;100~200<\/li>\n<li>\u8be6\u7ec6\u89e3\u91ca&#xff1a;300~500<\/li>\n<li>\u957f\u6587\u751f\u6210&#xff1a;800&#043;<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e0d\u8981\u8d85\u8fc7\u6a21\u578b\u4e0a\u4e0b\u6587\u7a97\u53e3\u9650\u5236&#xff08;DeepSeek-R1\u652f\u630132K&#xff0c;\u8db3\u591f\u7528&#xff09;\u3002<\/p>\n<h5>top_p&#xff08;\u6838\u91c7\u6837&#xff09;&#xff1a;\u52a8\u6001\u7b5b\u9009\u5019\u9009\u8bcd<\/h5>\n<p>\u4e0etemperature\u914d\u5408\u4f7f\u7528&#xff0c;\u5b83\u4e0d\u662f\u56fa\u5b9a\u6e29\u5ea6&#xff0c;\u800c\u662f\u6309\u7d2f\u79ef\u6982\u7387\u622a\u65ad\u3002\u6bd4\u5982\u8bbe\u4e3a0.9&#xff0c;\u8868\u793a\u53ea\u8003\u8651\u7d2f\u8ba1\u6982\u7387\u524d90%\u7684\u8bcd\u6c47\u3002<\/p>\n<p>\u597d\u5904\u662f\u80fd\u81ea\u52a8\u9002\u5e94\u4e0d\u540c\u60c5\u5883\u4e0b\u7684\u8bcd\u5206\u5e03&#xff0c;\u6bd4\u5355\u7eaf\u8c03temperature\u66f4\u667a\u80fd\u3002<\/p>\n<p>\u5e38\u7528\u503c&#xff1a;0.8~0.95<\/p>\n<h5>frequency_penalty \u548c presence_penalty<\/h5>\n<p>\u8fd9\u4e24\u4e2a\u662f\u7528\u6765\u6291\u5236\u91cd\u590d\u7684&#xff1a;<\/p>\n<ul>\n<li>frequency_penalty&#xff1a;\u60e9\u7f5a\u9ad8\u9891\u8bcd&#xff0c;\u907f\u514d\u5570\u55e6&#xff1b;<\/li>\n<li>presence_penalty&#xff1a;\u9f13\u52b1\u63d0\u53ca\u65b0\u8bdd\u9898\u3002<\/li>\n<\/ul>\n<p>\u5efa\u8bae\u503c&#xff1a;0.1~0.3\u4e4b\u95f4\u5fae\u8c03\u3002<\/p>\n<p>\u628a\u8fd9\u4e9b\u53c2\u6570\u7ec4\u5408\u8d77\u6765&#xff0c;\u4f60\u5c31\u80fd\u7cbe\u7ec6\u8c03\u63a7AI\u7684\u884c\u4e3a\u6a21\u5f0f\u3002\u6bd4\u5982\u8981\u505a\u4e00\u4e2a\u201c\u4e25\u8c28\u7684\u6280\u672f\u6587\u6863\u751f\u6210\u5668\u201d&#xff0c;\u5c31\u53ef\u4ee5\u8fd9\u6837\u8bbe\u7f6e&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;temperature&#034;: 0.3,<br \/>\n  &#034;top_p&#034;: 0.8,<br \/>\n  &#034;max_tokens&#034;: 400,<br \/>\n  &#034;frequency_penalty&#034;: 0.2<br \/>\n}<\/p>\n<p>\u800c\u5982\u679c\u662f\u201c\u521b\u610f\u5e7f\u544a\u8bed\u751f\u6210\u201d&#xff0c;\u5219\u53ef\u4ee5\u66f4\u5f00\u653e&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;temperature&#034;: 0.9,<br \/>\n  &#034;top_p&#034;: 0.95,<br \/>\n  &#034;max_tokens&#034;: 150,<br \/>\n  &#034;presence_penalty&#034;: 0.5<br \/>\n}<\/p>\n<p>\u591a\u8bd5\u8bd5\u4e0d\u540c\u7684\u7ec4\u5408&#xff0c;\u4f60\u4f1a\u53d1\u73b0\u540c\u4e00\u4e2a\u6a21\u578b\u80fd\u5c55\u73b0\u51fa\u622a\u7136\u4e0d\u540c\u7684\u201c\u4eba\u683c\u201d\u3002<\/p>\n<h4>4.2 \u63d0\u793a\u8bcd\u5de5\u7a0b&#xff1a;\u5199\u51fa\u8ba9AI\u542c\u61c2\u7684\u6307\u4ee4<\/h4>\n<p>\u518d\u5f3a\u5927\u7684\u6a21\u578b&#xff0c;\u4e5f\u9700\u8981\u6e05\u6670\u7684\u6307\u4ee4\u624d\u80fd\u53d1\u6325\u5b9e\u529b\u3002\u8fd9\u5c31\u5f15\u51fa\u4e86\u201c\u63d0\u793a\u8bcd\u5de5\u7a0b\u201d&#xff08;Prompt Engineering&#xff09;\u7684\u6982\u5ff5\u2014\u2014\u5982\u4f55\u5199\u51fa\u9ad8\u8d28\u91cf\u7684prompt&#xff0c;\u8ba9AI\u51c6\u786e\u7406\u89e3\u4f60\u7684\u610f\u56fe\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u51e0\u4e2a\u7ecf\u8fc7\u9a8c\u8bc1\u7684\u6709\u6548\u6280\u5de7&#xff1a;<\/p>\n<h5>\u660e\u786e\u89d2\u8272\u8bbe\u5b9a<\/h5>\n<p>\u7ed9AI\u5206\u914d\u4e00\u4e2a\u5177\u4f53\u8eab\u4efd&#xff0c;\u80fd\u663e\u8457\u63d0\u5347\u8f93\u51fa\u8d28\u91cf\u3002\u6bd4\u5982&#xff1a;<\/p>\n<p>\u201c\u4f60\u662f\u4e00\u4f4d\u8d44\u6df1\u4ea7\u54c1\u7ecf\u7406&#xff0c;\u64c5\u957f\u64b0\u5199\u7b80\u6d01\u6709\u529b\u7684\u4ea7\u54c1\u4ecb\u7ecd\u6587\u6848\u3002\u8bf7\u5e2e\u6211\u6da6\u8272\u4ee5\u4e0b\u5185\u5bb9\u2026\u2026\u201d<\/p>\n<p>\u76f8\u6bd4\u76f4\u63a5\u8bf4\u201c\u5e2e\u6211\u6539\u5199\u201d&#xff0c;\u524d\u8005\u80fd\u8ba9AI\u81ea\u52a8\u5207\u6362\u5230\u4e13\u4e1a\u8bed\u5883&#xff0c;\u4f7f\u7528\u66f4\u8d34\u5207\u7684\u672f\u8bed\u548c\u8bed\u6c14\u3002<\/p>\n<h5>\u5206\u6b65\u601d\u8003\u6307\u4ee4<\/h5>\n<p>\u5bf9\u4e8e\u590d\u6742\u4efb\u52a1&#xff0c;\u5f15\u5bfcAI\u201c\u4e00\u6b65\u4e00\u6b65\u6765\u201d&#xff1a;<\/p>\n<p>\u201c\u8bf7\u6309\u4ee5\u4e0b\u6b65\u9aa4\u5904\u7406&#xff1a;1. \u7406\u89e3\u7528\u6237\u9700\u6c42&#xff1b;2. \u63d0\u70bc\u6838\u5fc3\u5356\u70b9&#xff1b;3. \u751f\u6210\u4e09\u6761\u4e0d\u540c\u98ce\u683c\u7684\u5ba3\u4f20\u8bed&#xff1b;4. \u5bf9\u6bcf\u6761\u8fdb\u884c\u7b80\u8981\u8bf4\u660e\u3002\u201d<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u4e86DeepSeek-R1\u5f3a\u5927\u7684\u63a8\u7406\u80fd\u529b&#xff0c;\u8f93\u51fa\u66f4\u6709\u6761\u7406\u3002<\/p>\n<h5>\u8981\u6c42\u7ed3\u6784\u5316\u8f93\u51fa<\/h5>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u7ed3\u679c\u4fbf\u4e8e\u7a0b\u5e8f\u89e3\u6790&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u8981\u6c42JSON\u683c\u5f0f&#xff1a;<\/p>\n<p>\u201c\u8bf7\u4ee5JSON\u683c\u5f0f\u8fd4\u56de&#xff0c;\u5305\u542b\u5b57\u6bb5&#xff1a;slogan&#xff08;\u6807\u8bed&#xff09;\u3001tone&#xff08;\u8bed\u6c14\u98ce\u683c&#xff09;\u3001explanation&#xff08;\u8bf4\u660e&#xff09;\u201d<\/p>\n<p>\u5b9e\u6d4bDeepSeek-R1\u5bf9JSON\u751f\u6210\u652f\u6301\u5f88\u597d&#xff0c;\u51e0\u4e4e\u4e0d\u4f1a\u51fa\u9519\u3002<\/p>\n<h5>\u793a\u4f8b\u5f15\u5bfc&#xff08;Few-shot Prompting&#xff09;<\/h5>\n<p>\u63d0\u4f9b\u4e00\u4e24\u4e2a\u4f8b\u5b50&#xff0c;\u8ba9AI\u6a21\u4eff\u683c\u5f0f&#xff1a;<\/p>\n<p>\u201c\u793a\u4f8b1&#xff1a;\u539f\u59cb\u5185\u5bb9\u2018\u597d\u559d\u7684\u5976\u8336\u2019 \u2192 \u751f\u6210\u2018\u4e00\u53e3\u4e1d\u6ed1&#xff0c;\u56de\u5473\u65e0\u7a77\u2019 \u8bf7\u6309\u6b64\u98ce\u683c\u5904\u7406&#xff1a;\u2018\u8010\u7528\u7684\u80cc\u5305\u2019\u201d<\/p>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u7279\u522b\u9002\u5408\u4fdd\u6301\u7edf\u4e00\u6587\u98ce\u3002<\/p>\n<p>\u628a\u8fd9\u4e9b\u6280\u5de7\u878d\u5165\u4f60\u7684\u524d\u7aef\u8f93\u5165\u6846\u63d0\u793a\u8bed\u4e2d&#xff0c;\u6bd4\u5982placeholder\u5199\u6210&#xff1a;<\/p>\n<p>\u201c\u63cf\u8ff0\u4f60\u8981\u751f\u6210\u7684\u5185\u5bb9&#xff0c;\u53ef\u6307\u5b9a\u98ce\u683c&#xff0c;\u5982&#xff1a;\u2018\u5199\u4e00\u6bb5\u79d1\u6280\u611f\u5341\u8db3\u7684\u667a\u80fd\u624b\u8868\u5e7f\u544a\u8bed\u2019\u201d<\/p>\n<p>\u7528\u6237\u7684\u8f93\u5165\u8d28\u91cf\u63d0\u5347\u4e86&#xff0c;AI\u7684\u8868\u73b0\u81ea\u7136\u66f4\u597d\u3002<\/p>\n<h4>4.3 \u5e38\u89c1\u95ee\u9898\u6392\u67e5&#xff1a;\u90a3\u4e9b\u4f60\u4e00\u5b9a\u4f1a\u9047\u5230\u7684\u5751<\/h4>\n<p>\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d&#xff0c;\u603b\u4f1a\u9047\u5230\u5404\u79cd\u610f\u5916\u60c5\u51b5\u3002\u63d0\u524d\u4e86\u89e3\u8fd9\u4e9b\u95ee\u9898&#xff0c;\u80fd\u8ba9\u4f60\u5728\u6f14\u793a\u73b0\u573a\u4ece\u5bb9\u5e94\u5bf9\u3002<\/p>\n<h5>\u95ee\u98981&#xff1a;\u8bf7\u6c42\u8d85\u65f6\u6216\u65e0\u54cd\u5e94<\/h5>\n<p>\u53ef\u80fd\u539f\u56e0&#xff1a;<\/p>\n<ul>\n<li>\u7f51\u7edc\u4e0d\u7a33\u5b9a&#xff1b;<\/li>\n<li>\u6a21\u578b\u6b63\u5728\u5904\u7406\u957f\u6587\u672c&#xff0c;\u8017\u65f6\u8f83\u957f&#xff1b;<\/li>\n<li>\u5b9e\u4f8b\u8d44\u6e90\u4e0d\u8db3\u88ab\u9650\u6d41\u3002<\/li>\n<\/ul>\n<p>\u5bf9\u7b56&#xff1a;<\/p>\n<ul>\n<li>\u524d\u7aef\u6dfb\u52a0\u8d85\u65f6\u673a\u5236&#xff08;signal: AbortController&#xff09;&#xff1b;<\/li>\n<li>\u51cf\u5c11max_tokens\u964d\u4f4e\u8d1f\u8f7d&#xff1b;<\/li>\n<li>\u68c0\u67e5\u5b9e\u4f8b\u72b6\u6001&#xff0c;\u5fc5\u8981\u65f6\u91cd\u542f\u3002<\/li>\n<\/ul>\n<h5>\u95ee\u98982&#xff1a;\u8f93\u51fa\u5185\u5bb9\u4e0d\u76f8\u5173\u6216\u80e1\u8a00\u4e71\u8bed<\/h5>\n<p>\u5178\u578b\u8868\u73b0\u4e3a\u7b54\u975e\u6240\u95ee\u3001\u903b\u8f91\u6df7\u4e71\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<ul>\n<li>prompt\u8868\u8ff0\u4e0d\u6e05&#xff1b;<\/li>\n<li>temperature\u8fc7\u9ad8&#xff1b;<\/li>\n<li>\u4e0a\u4e0b\u6587\u8fc7\u957f\u5bfc\u81f4\u6ce8\u610f\u529b\u5206\u6563\u3002<\/li>\n<\/ul>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<ul>\n<li>\u7cbe\u7b80prompt&#xff0c;\u7a81\u51fa\u91cd\u70b9&#xff1b;<\/li>\n<li>\u964d\u4f4etemperature\u81f30.5\u4ee5\u4e0b&#xff1b;<\/li>\n<li>\u5206\u6bb5\u5904\u7406\u957f\u8f93\u5165\u3002<\/li>\n<\/ul>\n<h5>\u95ee\u98983&#xff1a;\u9891\u7e41\u51fa\u73b0\u91cd\u590d\u53e5\u5b50<\/h5>\n<p>\u867d\u7136\u8bbe\u7f6e\u4e86penalty&#xff0c;\u4f46\u4ecd\u53ef\u80fd\u91cd\u590d\u3002<\/p>\n<p>\u6539\u8fdb\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u63d0\u9ad8frequency_penalty\u81f30.5&#xff1b;<\/li>\n<li>\u5728prompt\u4e2d\u660e\u786e\u8981\u6c42&#xff1a;\u201c\u8bf7\u907f\u514d\u91cd\u590d\u8868\u8fbe\u201d&#xff1b;<\/li>\n<li>\u540e\u5904\u7406\u9636\u6bb5\u7528\u7b97\u6cd5\u53bb\u91cd\u3002<\/li>\n<\/ul>\n<h5>\u95ee\u98984&#xff1a;API\u5bc6\u94a5\u6cc4\u9732\u98ce\u9669<\/h5>\n<p>\u524d\u7aef\u786c\u7f16\u7801\u5bc6\u94a5\u786e\u5b9e\u5b58\u5728\u5b89\u5168\u9690\u60a3\u3002<\/p>\n<p>\u7f13\u89e3\u63aa\u65bd&#xff1a;<\/p>\n<ul>\n<li>\u6f14\u793a\u4e13\u7528\u5bc6\u94a5&#xff0c;\u8bbe\u7f6e\u8c03\u7528\u9891\u7387\u9650\u5236&#xff1b;<\/li>\n<li>\u6f14\u793a\u7ed3\u675f\u540e\u7acb\u5373\u505c\u7528&#xff1b;<\/li>\n<li>\u6b63\u5f0f\u73af\u5883\u6539\u7528\u540e\u7aef\u4ee3\u7406\u3002<\/li>\n<\/ul>\n<h5>\u95ee\u98985&#xff1a;\u8d39\u7528\u4e0d\u53ef\u63a7<\/h5>\n<p>\u867d\u7136\u5f88\u591a\u5e73\u53f0\u6709\u514d\u8d39\u989d\u5ea6&#xff0c;\u4f46\u6ee5\u7528\u53ef\u80fd\u5bfc\u81f4\u8d85\u989d\u3002<\/p>\n<p>\u5efa\u8bae&#xff1a;<\/p>\n<ul>\n<li>\u76d1\u63a7\u8c03\u7528\u91cf&#xff1b;<\/li>\n<li>\u8bbe\u7f6e\u6bcf\u65e5\u9650\u989d&#xff1b;<\/li>\n<li>\u4f7f\u7528\u8f7b\u91cf\u6a21\u578b\u505a\u521d\u6b65\u6d4b\u8bd5&#xff08;\u59821.5B\u7248\u672c&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u8bb0\u4f4f&#xff0c;\u6bcf\u4e2a\u95ee\u9898\u90fd\u6709\u89e3\u6cd5\u3002\u5173\u952e\u662f\u63d0\u524d\u51c6\u5907\u9884\u6848&#xff0c;\u505a\u5230\u5fc3\u4e2d\u6709\u6570\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<ul>\n<li>DeepSeek-R1\u662f\u4e00\u6b3e\u5177\u5907\u6df1\u5ea6\u601d\u8003\u80fd\u529b\u7684\u5f00\u6e90\u63a8\u7406\u6a21\u578b&#xff0c;\u7279\u522b\u9002\u5408\u5904\u7406\u6570\u5b66\u3001\u7f16\u7a0b\u548c\u590d\u6742\u903b\u8f91\u4efb\u52a1&#xff0c;\u4e14\u5bf9\u4e2d\u6587\u652f\u6301\u4f18\u79c0&#xff0c;\u662f\u524d\u7aef\u505aAI\u6f14\u793a\u7684\u7406\u60f3\u9009\u62e9\u3002<\/li>\n<li>\u901a\u8fc7CSDN\u661f\u56fe\u5e73\u53f0\u7684\u4e00\u952e\u90e8\u7f72\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u5feb\u901f\u83b7\u5f97\u4e00\u4e2a\u53ef\u8c03\u7528\u7684API\u670d\u52a1\u7aef\u70b9&#xff0c;\u65e0\u9700\u81ea\u884c\u642d\u5efa\u670d\u52a1\u5668\u6216\u914d\u7f6eGPU\u73af\u5883&#xff0c;\u771f\u6b63\u5b9e\u73b0\u201c\u514d\u540e\u7aef\u4f9d\u8d56\u201d\u7684\u5feb\u901f\u9a8c\u8bc1\u3002<\/li>\n<li>\u524d\u7aef\u96c6\u6210\u53ea\u9700\u51e0\u4e2a\u7b80\u5355\u6b65\u9aa4&#xff1a;\u6784\u5efa\u9875\u9762 \u2192 \u7f16\u5199fetch\u8bf7\u6c42 \u2192 \u5904\u7406\u54cd\u5e94 \u2192 \u4f18\u5316\u4ea4\u4e92&#xff0c;\u5168\u7a0b\u53ef\u57281\u5c0f\u65f6\u5185\u5b8c\u6210&#xff0c;\u6781\u5927\u63d0\u5347\u539f\u578b\u5f00\u53d1\u6548\u7387\u3002<\/li>\n<li>\u638c\u63e1\u5173\u952e\u53c2\u6570&#xff08;\u5982temperature\u3001max_tokens&#xff09;\u548c\u63d0\u793a\u8bcd\u6280\u5de7&#xff0c;\u80fd\u663e\u8457\u63d0\u5347AI\u8f93\u51fa\u8d28\u91cf\u548c\u7a33\u5b9a\u6027&#xff0c;\u8ba9\u4f60\u7684\u6f14\u793a\u66f4\u5177\u4e13\u4e1a\u6027\u548c\u8bf4\u670d\u529b\u3002<\/li>\n<li>\u73b0\u5728\u5c31\u53ef\u4ee5\u52a8\u624b\u8bd5\u8bd5&#xff01;\u54ea\u6015\u53ea\u662f\u505a\u4e2a\u7b80\u5355\u7684\u95ee\u7b54demo&#xff0c;\u4e5f\u80fd\u8ba9\u4f60\u5728\u56e2\u961f\u4e2d\u8131\u9896\u800c\u51fa&#xff0c;\u6210\u4e3a\u90a3\u4e2a\u201c\u603b\u80fd\u627e\u5230\u89e3\u51b3\u65b9\u6848\u7684\u4eba\u201d\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DeepSeek-R1 API\u901f\u6210&#xff1a;\u514d\u670d\u52a1\u5668&#xff0c;\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a<br \/>\n\u4f60\u662f\u4e0d\u662f\u4e5f\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5&#xff1f;\u4f5c\u4e3a\u524d\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u624b\u5934\u6709\u4e2aAI\u529f\u80fd\u539f\u578b\u8981\u5c55\u793a\u7ed9\u4ea7\u54c1\u7ecf\u7406\u6216\u5ba2\u6237\u770b&#xff0c;\u4f46\u540e\u7aef\u540c\u4e8b\u6392\u671f\u7d27\u5f20&#xff0c;\u81f3\u5c11\u5f97\u7b49\u4e24\u5468\u624d\u80fd\u63d0\u4f9b\u63a5\u53e3\u3002\u65f6\u95f4\u4e0d\u7b49\u4eba&#xff0c;\u6f14\u793a\u8feb\u5728\u7709\u776b&#xff0c;\u96be\u9053\u53ea\u80fd\u5e72\u7b49\u7740&#xff1f;<br \/>\n\u522b\u6025&#xff01;\u4eca\u5929\u6211\u8981\u5206\u4eab\u4e00\u4e2a\u771f\u6b63\u80fd\u201c\u6551\u573a\u201d\u7684\u65b9\u6848\u2014\u2014\u4f7f\u7528 DeepSeek-R1 \u7684\u516c\u5f00API\u80fd\u529b<\/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":[],"topic":[],"class_list":["post-84425","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \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\/84425.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"DeepSeek-R1 API\u901f\u6210&#xff1a;\u514d\u670d\u52a1\u5668&#xff0c;\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a \u4f60\u662f\u4e0d\u662f\u4e5f\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5&#xff1f;\u4f5c\u4e3a\u524d\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u624b\u5934\u6709\u4e2aAI\u529f\u80fd\u539f\u578b\u8981\u5c55\u793a\u7ed9\u4ea7\u54c1\u7ecf\u7406\u6216\u5ba2\u6237\u770b&#xff0c;\u4f46\u540e\u7aef\u540c\u4e8b\u6392\u671f\u7d27\u5f20&#xff0c;\u81f3\u5c11\u5f97\u7b49\u4e24\u5468\u624d\u80fd\u63d0\u4f9b\u63a5\u53e3\u3002\u65f6\u95f4\u4e0d\u7b49\u4eba&#xff0c;\u6f14\u793a\u8feb\u5728\u7709\u776b&#xff0c;\u96be\u9053\u53ea\u80fd\u5e72\u7b49\u7740&#xff1f; \u522b\u6025&#xff01;\u4eca\u5929\u6211\u8981\u5206\u4eab\u4e00\u4e2a\u771f\u6b63\u80fd\u201c\u6551\u573a\u201d\u7684\u65b9\u6848\u2014\u2014\u4f7f\u7528 DeepSeek-R1 \u7684\u516c\u5f00API\u80fd\u529b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/84425.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-26T04:51:00+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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/84425.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/84425.html\",\"name\":\"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-26T04:51:00+00:00\",\"dateModified\":\"2026-07-26T04:51:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/84425.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/84425.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/84425.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a\"}]},{\"@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":"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \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\/84425.html","og_locale":"zh_CN","og_type":"article","og_title":"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"DeepSeek-R1 API\u901f\u6210&#xff1a;\u514d\u670d\u52a1\u5668&#xff0c;\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a \u4f60\u662f\u4e0d\u662f\u4e5f\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5&#xff1f;\u4f5c\u4e3a\u524d\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u624b\u5934\u6709\u4e2aAI\u529f\u80fd\u539f\u578b\u8981\u5c55\u793a\u7ed9\u4ea7\u54c1\u7ecf\u7406\u6216\u5ba2\u6237\u770b&#xff0c;\u4f46\u540e\u7aef\u540c\u4e8b\u6392\u671f\u7d27\u5f20&#xff0c;\u81f3\u5c11\u5f97\u7b49\u4e24\u5468\u624d\u80fd\u63d0\u4f9b\u63a5\u53e3\u3002\u65f6\u95f4\u4e0d\u7b49\u4eba&#xff0c;\u6f14\u793a\u8feb\u5728\u7709\u776b&#xff0c;\u96be\u9053\u53ea\u80fd\u5e72\u7b49\u7740&#xff1f; \u522b\u6025&#xff01;\u4eca\u5929\u6211\u8981\u5206\u4eab\u4e00\u4e2a\u771f\u6b63\u80fd\u201c\u6551\u573a\u201d\u7684\u65b9\u6848\u2014\u2014\u4f7f\u7528 DeepSeek-R1 \u7684\u516c\u5f00API\u80fd\u529b","og_url":"https:\/\/www.wsisp.com\/helps\/84425.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-26T04:51:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/84425.html","url":"https:\/\/www.wsisp.com\/helps\/84425.html","name":"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-26T04:51:00+00:00","dateModified":"2026-07-26T04:51:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/84425.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/84425.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/84425.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"DeepSeek-R1 API\u901f\u6210\uff1a\u514d\u670d\u52a1\u5668\uff0c\u76f4\u63a5\u4e91\u7aef\u8c03\u7528\u6f14\u793a"}]},{"@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\/84425","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=84425"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/84425\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=84425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=84425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=84425"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=84425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}