{"id":102751,"date":"2026-09-09T12:32:54","date_gmt":"2026-09-09T04:32:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102751.html"},"modified":"2026-09-09T12:32:54","modified_gmt":"2026-09-09T04:32:54","slug":"%e5%a4%a7%e6%a8%a1%e5%9e%8b%e6%8e%a8%e7%90%86%e6%88%90%e6%9c%ac%e4%bc%98%e5%8c%96%ef%bc%9asaas-%e5%ae%a2%e6%9c%8d%e5%9c%ba%e6%99%af%e4%b8%8b%e7%9a%84%e9%87%8f%e5%8c%96%e4%b8%8e%e8%92%b8%e9%a6%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102751.html","title":{"rendered":"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218"},"content":{"rendered":"<h3>1. \u80cc\u666f&#xff1a;\u65e5\u5747 200 \u4e07\u6b21\u63a8\u7406&#xff0c;\u8d26\u5355\u6491\u4e0d\u4f4f\u4e86<\/h3>\n<p>\u6211\u4eec\u662f\u4e00\u5bb6\u505a SaaS \u667a\u80fd\u5ba2\u670d\u7684\u521b\u4e1a\u516c\u53f8&#xff0c;\u4ea7\u54c1\u5f62\u6001\u662f\u300c\u5de5\u5355\u81ea\u52a8\u5206\u7c7b &#043; \u610f\u56fe\u8bc6\u522b &#043; \u8bdd\u672f\u63a8\u8350\u300d&#xff0c;\u5e95\u5c42\u4f9d\u8d56\u5927\u6a21\u578b\u505a\u8bed\u4e49\u7406\u89e3\u3002\u4e1a\u52a1\u8dd1\u4e86\u5927\u534a\u5e74&#xff0c;\u65e5\u6d3b\u5ba2\u6237 300&#043;&#xff0c;\u65e5\u5747\u63a8\u7406\u8bf7\u6c42\u91cf\u7a33\u5b9a\u5728 200 \u4e07\u6b21\u5de6\u53f3&#xff0c;\u5176\u4e2d\u7ea6 60% \u662f\u77ed\u6587\u672c\u5206\u7c7b&#xff08;\u5de5\u5355\u6807\u9898 &#043; \u9996\u6761\u6d88\u606f&#xff09;&#xff0c;\u5e73\u5747\u8f93\u5165 token \u7ea6 120&#xff0c;\u8f93\u51fa token \u7ea6 30\u3002<\/p>\n<p>\u6700\u521d\u6211\u4eec\u76f4\u63a5\u8c03\u7528 GPT-4o \u7684 API&#xff0c;\u5355\u6b21\u8bf7\u6c42\u5e73\u5747\u6210\u672c\u7ea6 0.002 \u7f8e\u5143&#xff0c;\u65e5\u5747\u6210\u672c\u7ea6 4000 \u7f8e\u5143&#xff0c;\u4e00\u4e2a\u6708\u5c31\u662f 12 \u4e07\u7f8e\u5143\u3002\u5bf9\u4e00\u5bb6 SaaS \u516c\u53f8\u6765\u8bf4&#xff0c;\u8fd9\u4e2a\u6570\u5b57\u51e0\u4e4e\u4fb5\u8680\u4e86\u6bdb\u5229\u3002\u66f4\u9ebb\u70e6\u7684\u662f&#xff0c;\u5ba2\u6237\u5bf9\u54cd\u5e94\u5ef6\u8fdf\u6709\u786c\u6027\u8981\u6c42\u2014\u2014\u5ba2\u670d\u5750\u5e2d\u7b49\u4e0d\u8d77&#xff0c;P95 \u5ef6\u8fdf\u5fc5\u987b\u63a7\u5236\u5728 800ms \u4ee5\u5185&#xff0c;\u800c GPT-4o \u7684 P95 \u7ecf\u5e38\u98d9\u5230 1.5s \u4ee5\u4e0a\u3002<\/p>\n<p>\u4e8e\u662f\u6211\u4eec\u542f\u52a8\u4e86\u300c\u63a8\u7406\u6210\u672c\u4f18\u5316\u300d\u4e13\u9879&#xff0c;\u76ee\u6807\u5f88\u660e\u786e&#xff1a;\u5728\u4e0d\u660e\u663e\u727a\u7272\u51c6\u786e\u7387\u7684\u524d\u63d0\u4e0b&#xff0c;\u628a\u5355\u6b21\u63a8\u7406\u6210\u672c\u964d\u4e00\u4e2a\u6570\u91cf\u7ea7&#xff0c;\u540c\u65f6\u628a P95 \u5ef6\u8fdf\u538b\u5230 800ms \u4ee5\u4e0b\u3002<\/p>\n<h3>2. \u8e29\u5751\u4e0e\u73b0\u72b6&#xff1a;\u5148\u8e29\u4e86\u4e09\u4e2a\u5751&#xff0c;\u624d\u770b\u6e05\u95ee\u9898<\/h3>\n<h4>2.1 \u5751\u4e00&#xff1a;\u76f4\u63a5\u4e0a\u91cf\u5316&#xff0c;\u8f93\u51fa\u4e71\u7801<\/h4>\n<p>\u6211\u4eec\u6700\u521d\u7684\u60f3\u6cd5\u5f88\u7b80\u5355\u2014\u2014\u65e2\u7136\u6210\u672c\u9ad8&#xff0c;\u90a3\u5c31\u6362\u5f00\u6e90\u6a21\u578b &#043; \u91cf\u5316\u3002\u6211\u4eec\u9009\u4e86 Qwen2.5-7B-Instruct&#xff0c;\u7528 GPTQ \u91cf\u5316\u5230 4bit \u76f4\u63a5\u90e8\u7f72\u3002\u7ed3\u679c\u63a8\u7406\u8f93\u51fa\u51fa\u73b0\u5927\u91cf\u91cd\u590d token&#xff0c;\u6bd4\u5982\u300c\u7f51\u7edc\u6545\u969c\u7f51\u7edc\u6545\u969c\u7f51\u7edc\u6545\u969c\u300d\u3002<\/p>\n<p>\u6392\u67e5\u540e\u53d1\u73b0\u662f\u91cf\u5316\u6821\u51c6\u96c6\u592a\u5c0f\u2014\u2014\u6211\u4eec\u6700\u521d\u53ea\u7528 128 \u6761\u6837\u672c\u505a\u6821\u51c6&#xff0c;\u6fc0\u6d3b\u503c\u5206\u5e03\u4f30\u8ba1\u4e0d\u51c6\u3002\u628a\u6821\u51c6\u96c6\u6269\u5927\u5230 1024 \u6761\u3001\u8986\u76d6\u5168\u90e8 5 \u4e2a\u5206\u7c7b\u540e&#xff0c;\u4e71\u7801\u6d88\u5931\u3002\u6821\u51c6\u96c6\u8d28\u91cf\u76f4\u63a5\u51b3\u5b9a\u91cf\u5316\u6548\u679c&#xff0c;\u8fd9\u662f\u7b2c\u4e00\u4e2a\u6559\u8bad\u3002<\/p>\n<h4>2.2 \u5751\u4e8c&#xff1a;vLLM \u542f\u52a8\u76f4\u63a5\u62a5\u9519<\/h4>\n<p>\u91cf\u5316\u5b8c\u6210\u540e\u90e8\u7f72 vLLM&#xff0c;\u542f\u52a8\u65f6\u76f4\u63a5\u62a5\u9519\u9000\u51fa&#xff1a;<\/p>\n<p>ValueError: The model&#039;s max seq len (32768) is larger than the maximum number of tokens that can be stored in KV cache<\/p>\n<p>\u539f\u56e0\u662f Qwen2.5-7B \u7684\u9ed8\u8ba4 max_position_embeddings \u662f 32768&#xff0c;\u800c\u6211\u4eec\u7684 4090 \u663e\u5b58\u88c5\u4e0d\u4e0b\u8fd9\u4e48\u5927\u7684 KV cache\u3002\u5728\u542f\u52a8\u53c2\u6570\u91cc\u663e\u5f0f\u6307\u5b9a &#8211;max-model-len 2048 \u540e\u89e3\u51b3\u2014\u2014\u6211\u4eec\u5b9e\u9645\u8bf7\u6c42\u6700\u957f\u4e0d\u8d85\u8fc7 500 token&#xff0c;2048 \u5b8c\u5168\u591f\u7528\u3002\u8fd9\u4e2a\u53c2\u6570\u5fc5\u987b\u663e\u5f0f\u8bbe\u7f6e&#xff0c;\u4e0d\u80fd\u4f9d\u8d56\u9ed8\u8ba4\u503c\u3002<\/p>\n<h4>2.3 \u5751\u4e09&#xff1a;\u6a21\u578b\u4e0a\u7ebf\u4e00\u5468&#xff0c;\u51c6\u786e\u7387\u6084\u7136\u56de\u9000<\/h4>\n<p>\u91cf\u5316\u90e8\u7f72\u8dd1\u901a\u540e&#xff0c;\u6a21\u578b\u4e0a\u7ebf\u4e00\u5468&#xff0c;\u51c6\u786e\u7387\u4ece 96.5% \u6389\u5230 93.8%\u3002\u5bf9\u6bd4\u8bad\u7ec3\u96c6\u548c\u7ebf\u4e0a\u5b9e\u65f6\u6570\u636e\u7684\u5206\u5e03&#xff0c;\u53d1\u73b0\u7ebf\u4e0a\u51fa\u73b0\u4e86\u5927\u91cf\u300c\u591a\u8bed\u8a00\u6df7\u5408\u5de5\u5355\u300d&#xff08;\u4e2d\u82f1\u6df7\u6742&#xff09;&#xff0c;\u800c\u8bad\u7ec3\u96c6\u91cc\u8fd9\u7c7b\u6837\u672c\u5360\u6bd4\u4e0d\u8db3 1%\u3002<\/p>\n<p>\u6570\u636e\u6f02\u79fb\u662f\u5e38\u6001&#xff0c;\u4e0d\u662f\u5076\u53d1\u3002\u8fd9\u8ba9\u6211\u4eec\u610f\u8bc6\u5230&#xff0c;\u5149\u9760\u4e00\u6b21\u84b8\u998f &#043; \u91cf\u5316\u662f\u4e0d\u591f\u7684&#xff0c;\u5fc5\u987b\u5efa\u7acb\u6301\u7eed\u8fed\u4ee3\u673a\u5236\u3002<\/p>\n<h4>2.4 \u73b0\u72b6\u590d\u76d8&#xff1a;\u94b1\u82b1\u5728\u4e86\u54ea\u91cc&#xff0c;\u6162\u5728\u54ea\u91cc<\/h4>\n<p>\u8e29\u5b8c\u4e09\u4e2a\u5751&#xff0c;\u6211\u4eec\u628a\u6210\u672c\u62c6\u5f00\u770b\u3002\u901a\u8fc7\u65e5\u5fd7\u7edf\u8ba1&#xff0c;200 \u4e07\u6b21\u8bf7\u6c42\u91cc&#xff0c;\u771f\u6b63\u9700\u8981\u300c\u590d\u6742\u63a8\u7406\u300d\u7684\u53ea\u6709\u4e24\u7c7b&#xff1a;\u591a\u8f6e\u5bf9\u8bdd\u603b\u7ed3&#xff08;\u7ea6 15%&#xff09;\u548c\u5f00\u653e\u57df\u8bdd\u672f\u751f\u6210&#xff08;\u7ea6 10%&#xff09;\u3002\u5269\u4e0b 75% \u7684\u8bf7\u6c42\u90fd\u662f\u77ed\u6587\u672c\u5206\u7c7b\u2014\u2014\u5de5\u5355\u6253\u6807\u3001\u610f\u56fe\u8bc6\u522b\u3001\u60c5\u7eea\u5224\u65ad&#xff0c;\u8fd9\u4e9b\u4efb\u52a1\u672c\u8d28\u4e0a\u662f\u5224\u522b\u5f0f\u4efb\u52a1&#xff0c;\u6839\u672c\u4e0d\u9700\u8981\u4e00\u4e2a 1750 \u4ebf\u53c2\u6570\u7684\u751f\u6210\u6a21\u578b\u6765\u8dd1\u3002<\/p>\n<p>\u6839\u56e0\u6709\u4e09\u6761&#xff1a;<\/p>\n<li>\u6a21\u578b\u9009\u578b\u8fc7\u5ea6&#xff1a;\u7528 GPT-4o \u5904\u7406\u77ed\u6587\u672c\u5206\u7c7b&#xff0c;\u5c5e\u4e8e\u300c\u6740\u9e21\u7528\u725b\u5200\u300d\u3002\u8fd9\u7c7b\u4efb\u52a1\u7528 7B \u751a\u81f3 3B \u7684\u5f00\u6e90\u6a21\u578b\u5c31\u80fd\u8fbe\u5230\u540c\u7b49\u6548\u679c\u3002<\/li>\n<li>\u63a8\u7406\u67b6\u6784\u672a\u5206\u5c42&#xff1a;\u6240\u6709\u8bf7\u6c42\u90fd\u8d70\u540c\u4e00\u4e2a\u5927\u6a21\u578b API&#xff0c;\u6ca1\u6709\u6309\u4efb\u52a1\u96be\u5ea6\u5206\u6d41&#xff0c;\u5bfc\u81f4\u9ad8\u6210\u672c\u6a21\u578b\u627f\u62c5\u4e86\u5927\u91cf\u4f4e\u4ef7\u503c\u8bf7\u6c42\u3002<\/li>\n<li>\u90e8\u7f72\u5f62\u6001\u843d\u540e&#xff1a;\u81ea\u5efa GPU \u96c6\u7fa4\u540e&#xff0c;\u6211\u4eec\u6700\u521d\u7528 FP16 \u90e8\u7f72&#xff0c;\u663e\u5b58\u5360\u7528\u9ad8\u3001\u541e\u5410\u4f4e&#xff0c;\u5355\u5361 QPS \u53ea\u6709 8&#xff0c;\u8fdc\u672a\u5145\u5206\u53d1\u6325\u786c\u4ef6\u6027\u80fd\u3002<\/li>\n<p>\u660e\u786e\u4e86\u6839\u56e0&#xff0c;\u65b9\u6848\u5c31\u6e05\u6670\u4e86&#xff1a;\u7528\u5f00\u6e90\u5c0f\u6a21\u578b &#043; \u91cf\u5316 &#043; \u84b8\u998f&#xff0c;\u66ff\u6362\u6389 75% \u7684\u7b80\u5355\u4efb\u52a1\u6d41\u91cf\u3002<\/p>\n<h3>3. \u65b9\u6848&#xff1a;\u84b8\u998f &#043; \u91cf\u5316\u7ec4\u5408&#xff0c;\u66ff\u6362 75% \u7b80\u5355\u4efb\u52a1\u6d41\u91cf<\/h3>\n<h4>3.1 \u4e24\u6761\u8def\u7ebf\u5bf9\u6bd4<\/h4>\n<p>\u6211\u4eec\u8bc4\u4f30\u4e86\u4e24\u6761\u4e3b\u6d41\u8def\u7ebf&#xff1a;\u91cf\u5316&#xff08;Quantization&#xff09; \u548c \u84b8\u998f&#xff08;Distillation&#xff09;&#xff0c;\u5e76\u6700\u7ec8\u7ec4\u5408\u4f7f\u7528\u3002<\/p>\n<p>\u65b9\u6848 A&#xff1a;\u7eaf\u91cf\u5316\u8def\u7ebf\u2014\u2014\u628a\u5f00\u6e90\u6a21\u578b&#xff08;\u5982 Qwen2.5-7B-Instruct&#xff09;\u7528 GPTQ \u6216 AWQ \u91cf\u5316\u5230 4bit&#xff0c;\u76f4\u63a5\u90e8\u7f72\u3002\u4f18\u70b9\u662f\u5feb\u3001\u7701\u663e\u5b58&#xff0c;\u7f3a\u70b9\u662f\u91cf\u5316\u53ea\u538b\u7f29\u6a21\u578b\u4f53\u79ef&#xff0c;\u4e0d\u6539\u53d8\u6a21\u578b\u80fd\u529b\u2014\u2014\u5982\u679c\u57fa\u5ea7\u6a21\u578b\u672c\u8eab\u5728\u76ee\u6807\u4efb\u52a1\u4e0a\u51c6\u786e\u7387\u4e0d\u591f&#xff0c;\u91cf\u5316\u540e\u4f9d\u7136\u4e0d\u591f\u3002<\/p>\n<p>\u65b9\u6848 B&#xff1a;\u84b8\u998f &#043; \u91cf\u5316\u7ec4\u5408\u8def\u7ebf\u2014\u2014\u5148\u7528 GPT-4o \u4f5c\u4e3a Teacher \u6a21\u578b&#xff0c;\u5bf9 50 \u4e07\u6761\u5386\u53f2\u5de5\u5355\u6570\u636e\u6253\u6807\u7b7e&#xff0c;\u84b8\u998f\u51fa\u4e00\u4e2a 7B \u7684 Student \u6a21\u578b&#xff1b;\u518d\u5bf9 Student \u505a 4bit \u91cf\u5316\u90e8\u7f72\u3002\u4f18\u70b9\u662f\u5728\u4efb\u52a1\u51c6\u786e\u7387\u4e0a\u66f4\u53ef\u63a7&#xff0c;\u56e0\u4e3a Student \u662f\u4e13\u95e8\u4e3a\u300c\u5de5\u5355\u5206\u7c7b\u300d\u8fd9\u4e2a\u4efb\u52a1\u4f18\u5316\u7684&#xff0c;\u53c2\u6570\u91cf\u5c0f\u4f46\u4efb\u52a1\u7cbe\u5ea6\u9ad8\u3002<\/p>\n<table>\n<tr>\u7ef4\u5ea6\u65b9\u6848 A&#xff08;\u7eaf\u91cf\u5316&#xff09;\u65b9\u6848 B&#xff08;\u84b8\u998f&#043;\u91cf\u5316&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u4efb\u52a1\u51c6\u786e\u7387<\/td>\n<td>\u4f9d\u8d56\u57fa\u5ea7&#xff0c;\u77ed\u6587\u672c\u5206\u7c7b\u7ea6 91%<\/td>\n<td>\u9488\u5bf9\u4efb\u52a1\u4f18\u5316&#xff0c;\u53ef\u8fbe 96.5%<\/td>\n<\/tr>\n<tr>\n<td>\u5355\u5361\u663e\u5b58\u5360\u7528&#xff08;7B 4bit&#xff09;<\/td>\n<td>\u7ea6 5.2GB<\/td>\n<td>\u7ea6 5.2GB<\/td>\n<\/tr>\n<tr>\n<td>\u90e8\u7f72\u590d\u6742\u5ea6<\/td>\n<td>\u4f4e<\/td>\n<td>\u4e2d&#xff08;\u9700\u5148\u8dd1\u84b8\u998f\u8bad\u7ec3&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u901a\u7528\u5bf9\u8bdd\u3001\u4ee3\u7801\u751f\u6210<\/td>\n<td>\u5782\u76f4\u9886\u57df\u5224\u522b\u5f0f\u4efb\u52a1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u4eec\u6700\u7ec8\u9009\u62e9\u65b9\u6848 B&#xff0c;\u7406\u7531\u5f88\u76f4\u63a5&#xff1a;\u6211\u4eec\u7684\u6838\u5fc3\u573a\u666f\u662f\u77ed\u6587\u672c\u5206\u7c7b&#xff0c;\u5c5e\u4e8e\u5178\u578b\u7684\u5224\u522b\u5f0f\u4efb\u52a1&#xff0c;\u84b8\u998f\u5e26\u6765\u7684\u51c6\u786e\u7387\u6536\u76ca\u8fdc\u5927\u4e8e\u91cf\u5316\u3002\u800c\u91cf\u5316\u8d1f\u8d23\u628a\u90e8\u7f72\u6210\u672c\u518d\u538b\u4e00\u6863\u3002<\/p>\n<h4>3.2 \u5b9e\u64cd\u6b65\u9aa4&#xff1a;\u4ece\u84b8\u998f\u5230\u91cf\u5316\u90e8\u7f72<\/h4>\n<p>\u73af\u5883\u4e0e\u7248\u672c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u8bad\u7ec3\u673a&#xff1a;4\u00d7 A100 80G<\/span><br \/>\n<span class=\"token comment\"># \u63a8\u7406\u673a&#xff1a;2\u00d7 RTX 4090 24G<\/span><br \/>\n<span class=\"token comment\"># \u5173\u952e\u4f9d\u8d56\u7248\u672c<\/span><br \/>\n<span class=\"token assign-left variable\">torch<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">2.3<\/span>.1<br \/>\n<span class=\"token assign-left variable\">transformers<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">4.44<\/span>.2<br \/>\n<span class=\"token assign-left variable\">datasets<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">2.20<\/span>.0<br \/>\n<span class=\"token assign-left variable\">peft<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">0.12<\/span>.0<br \/>\nauto-gptq<span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">0.7<\/span>.1<br \/>\n<span class=\"token assign-left variable\">vllm<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token number\">0.6<\/span>.3.post1<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u7528 Teacher \u6a21\u578b\u751f\u6210\u84b8\u998f\u6570\u636e\u96c6\u3002 \u6211\u4eec\u53d6\u4e86\u8fc7\u53bb 6 \u4e2a\u6708\u7684 50 \u4e07\u6761\u8131\u654f\u5de5\u5355&#xff0c;\u8c03\u7528 GPT-4o \u751f\u6210\u300c\u5de5\u5355\u5206\u7c7b\u6807\u7b7e &#043; \u7f6e\u4fe1\u5ea6\u300d&#xff0c;\u53ea\u4fdd\u7559\u7f6e\u4fe1\u5ea6\u5927\u4e8e 0.9 \u7684\u6837\u672c&#xff0c;\u6700\u7ec8\u5f97\u5230 42 \u4e07\u6761\u9ad8\u8d28\u91cf\u8bad\u7ec3\u6570\u636e\u3002<\/p>\n<p><span class=\"token comment\"># distill_data_gen.py<\/span><br \/>\n<span class=\"token keyword\">from<\/span> openai <span class=\"token keyword\">import<\/span> OpenAI<br \/>\n<span class=\"token keyword\">import<\/span> json<\/p>\n<p>client <span class=\"token operator\">&#061;<\/span> OpenAI<span class=\"token punctuation\">(<\/span>base_url<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;https:\/\/api.openai.com\/v1&#034;<\/span><span class=\"token punctuation\">,<\/span> api_key<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;sk-xxx&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>SYSTEM_PROMPT <span class=\"token operator\">&#061;<\/span> <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u4f60\u662f\u5de5\u5355\u5206\u7c7b\u4e13\u5bb6\u3002\u8bf7\u5bf9\u4ee5\u4e0b\u5de5\u5355\u8f93\u51fa JSON&#xff1a;<br \/>\n{&#034;category&#034;: &#034;\u7f51\u7edc\u6545\u969c|\u8d26\u53f7\u95ee\u9898|\u8ba1\u8d39\u95ee\u9898|\u529f\u80fd\u54a8\u8be2|\u5176\u4ed6&#034;, &#034;intent&#034;: &#034;\u6295\u8bc9|\u54a8\u8be2|\u62a5\u969c|\u9000\u6b3e&#034;}&#034;&#034;&#034;<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">gen_label<\/span><span class=\"token punctuation\">(<\/span>ticket_text<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    resp <span class=\"token operator\">&#061;<\/span> client<span class=\"token punctuation\">.<\/span>chat<span class=\"token punctuation\">.<\/span>completions<span class=\"token punctuation\">.<\/span>create<span class=\"token punctuation\">(<\/span><br \/>\n        model<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;gpt-4o&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        messages<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;system&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> SYSTEM_PROMPT<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;role&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;user&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;content&#034;<\/span><span class=\"token punctuation\">:<\/span> ticket_text<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        temperature<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0.0<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        max_tokens<span class=\"token operator\">&#061;<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> json<span class=\"token punctuation\">.<\/span>loads<span class=\"token punctuation\">(<\/span>resp<span class=\"token punctuation\">.<\/span>choices<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>message<span class=\"token punctuation\">.<\/span>content<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u6279\u91cf\u5904\u7406&#xff0c;\u53ea\u4fdd\u7559\u7f6e\u4fe1\u5ea6\u9ad8\u7684\u6837\u672c&#xff08;\u6b64\u5904\u7701\u7565\u5e76\u53d1\u4e0e\u8fc7\u6ee4\u903b\u8f91&#xff09;<\/span><\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;LoRA \u5fae\u8c03 Student \u6a21\u578b\u3002 \u7528 Qwen2.5-7B-Instruct \u4f5c\u4e3a\u57fa\u5ea7&#xff0c;\u505a LoRA \u5fae\u8c03\u3002\u8bad\u7ec3 3 \u4e2a epoch&#xff0c;batch size 128&#xff0c;\u5b66\u4e60\u7387 2e-4\u3002<\/p>\n<p><span class=\"token comment\"># train_lora.py<\/span><br \/>\n<span class=\"token keyword\">from<\/span> transformers <span class=\"token keyword\">import<\/span> AutoModelForCausalLM<span class=\"token punctuation\">,<\/span> AutoTokenizer<span class=\"token punctuation\">,<\/span> TrainingArguments<br \/>\n<span class=\"token keyword\">from<\/span> peft <span class=\"token keyword\">import<\/span> LoraConfig<span class=\"token punctuation\">,<\/span> get_peft_model<br \/>\n<span class=\"token keyword\">from<\/span> datasets <span class=\"token keyword\">import<\/span> load_dataset<\/p>\n<p>model <span class=\"token operator\">&#061;<\/span> AutoModelForCausalLM<span class=\"token punctuation\">.<\/span>from_pretrained<span class=\"token punctuation\">(<\/span><br \/>\n    <span class=\"token string\">&#034;Qwen\/Qwen2.5-7B-Instruct&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    torch_dtype<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;bfloat16&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    device_map<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;auto&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><br \/>\ntokenizer <span class=\"token operator\">&#061;<\/span> AutoTokenizer<span class=\"token punctuation\">.<\/span>from_pretrained<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Qwen\/Qwen2.5-7B-Instruct&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>lora_config <span class=\"token operator\">&#061;<\/span> LoraConfig<span class=\"token punctuation\">(<\/span><br \/>\n    r<span class=\"token operator\">&#061;<\/span><span class=\"token number\">16<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    lora_alpha<span class=\"token operator\">&#061;<\/span><span class=\"token number\">32<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    target_modules<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;q_proj&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;k_proj&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;v_proj&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;o_proj&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    lora_dropout<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0.05<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    bias<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;none&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    task_type<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;CAUSAL_LM&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><br \/>\nmodel <span class=\"token operator\">&#061;<\/span> get_peft_model<span class=\"token punctuation\">(<\/span>model<span class=\"token punctuation\">,<\/span> lora_config<span class=\"token punctuation\">)<\/span><\/p>\n<p>dataset <span class=\"token operator\">&#061;<\/span> load_dataset<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;json&#034;<\/span><span class=\"token punctuation\">,<\/span> data_files<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;train_distill.jsonl&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token comment\"># &#8230; \u7701\u7565 tokenize \u4e0e collator \u903b\u8f91<\/span><\/p>\n<p>training_args <span class=\"token operator\">&#061;<\/span> TrainingArguments<span class=\"token punctuation\">(<\/span><br \/>\n    output_dir<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;.\/qwen25-7b-ticket-lora&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    per_device_train_batch_size<span class=\"token operator\">&#061;<\/span><span class=\"token number\">8<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    gradient_accumulation_steps<span class=\"token operator\">&#061;<\/span><span class=\"token number\">16<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u7b49\u6548 batch 128<\/span><br \/>\n    num_train_epochs<span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    learning_rate<span class=\"token operator\">&#061;<\/span><span class=\"token number\">2e-4<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    logging_steps<span class=\"token operator\">&#061;<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    save_steps<span class=\"token operator\">&#061;<\/span><span class=\"token number\">500<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    fp16<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token comment\"># trainer.train() \u540e merge \u5e76\u4fdd\u5b58<\/span><\/p>\n<p>\u7b2c\u4e09\u6b65&#xff1a;GPTQ 4bit \u91cf\u5316\u3002 \u5fae\u8c03\u5b8c\u6210\u540e&#xff0c;\u7528 auto-gptq \u628a\u5408\u5e76\u540e\u7684\u6a21\u578b\u91cf\u5316\u5230 4bit&#xff1a;<\/p>\n<p><span class=\"token comment\"># quantize.sh<\/span><br \/>\npython <span class=\"token parameter variable\">-m<\/span> auto_gptq.quantize <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;model_name<\/span> .\/qwen25-7b-ticket-lora-merged <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;output_dir<\/span> .\/qwen25-7b-ticket-gptq-4bit <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;bits<\/span> <span class=\"token number\">4<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;group_size<\/span> <span class=\"token number\">128<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;desc_act<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;dataset<\/span> .\/calib_data.jsonl<\/p>\n<p>\u7b2c\u56db\u6b65&#xff1a;vLLM \u90e8\u7f72\u3002<\/p>\n<p><span class=\"token comment\"># deploy.sh<\/span><br \/>\nvllm serve .\/qwen25-7b-ticket-gptq-4bit <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;served-model-name ticket-classifier <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;tensor-parallel-size <span class=\"token number\">1<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;max-model-len <span class=\"token number\">2048<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;gpu-memory-utilization <span class=\"token number\">0.9<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;port<\/span> <span class=\"token number\">8000<\/span><\/p>\n<p>\u9884\u671f\u8fd0\u884c\u7ed3\u679c&#xff1a;\u5355\u5361 4090 \u4e0a&#xff0c;\u6a21\u578b\u52a0\u8f7d\u540e\u663e\u5b58\u5360\u7528\u7ea6 5.2GB&#xff0c;\u5355\u5361 QPS \u4ece FP16 \u7684 8 \u63d0\u5347\u5230 4bit \u7684 42&#xff0c;\u63d0\u5347\u7ea6 5 \u500d\u3002<\/p>\n<h4>3.3 \u5e94\u5bf9\u6570\u636e\u6f02\u79fb&#xff1a;\u5efa\u7acb\u589e\u91cf\u84b8\u998f\u673a\u5236<\/h4>\n<p>\u9488\u5bf9\u5751\u4e09&#xff0c;\u6211\u4eec\u5efa\u7acb\u4e86\u6bcf\u5468\u589e\u91cf\u84b8\u998f\u673a\u5236\u2014\u2014\u6bcf\u5468\u4ece\u7ebf\u4e0a\u91c7\u6837 2 \u4e07\u6761\u65b0\u5de5\u5355&#xff0c;\u7528 Teacher \u91cd\u65b0\u6253\u6807&#xff0c;\u589e\u91cf\u5fae\u8c03 Student \u6a21\u578b\u3002\u540c\u65f6\u52a0\u5165\u6570\u636e\u6f02\u79fb\u76d1\u63a7&#xff0c;\u5f53\u7ebf\u4e0a\u6570\u636e\u4e0e\u8bad\u7ec3\u96c6\u5206\u5e03\u5dee\u5f02\u8d85\u8fc7\u9608\u503c\u65f6\u81ea\u52a8\u544a\u8b66\u3002<\/p>\n<h3>4. \u6743\u8861&#xff1a;\u4ee3\u4ef7\u4e0e\u8fb9\u754c<\/h3>\n<h4>4.1 \u9a8c\u8bc1\u6570\u636e<\/h4>\n<p>\u4e0a\u7ebf\u540e\u6211\u4eec\u505a\u4e86 A\/B \u6d4b\u8bd5&#xff0c;\u5bf9\u6bd4 GPT-4o \u76f4\u8fde\u548c\u300c\u84b8\u998f&#043;\u91cf\u5316\u300d\u65b9\u6848&#xff0c;\u6301\u7eed\u89c2\u5bdf 7 \u5929&#xff1a;<\/p>\n<table>\n<tr>\u6307\u6807GPT-4o \u76f4\u8fde\u84b8\u998f&#043;\u91cf\u5316&#xff08;7B 4bit&#xff09;\u53d8\u5316<\/tr>\n<tbody>\n<tr>\n<td>\u5355\u6b21\u63a8\u7406\u6210\u672c<\/td>\n<td>0.002 \u7f8e\u5143<\/td>\n<td>0.00012 \u7f8e\u5143<\/td>\n<td>\u2193 94%<\/td>\n<\/tr>\n<tr>\n<td>P95 \u5ef6\u8fdf<\/td>\n<td>1.5s<\/td>\n<td>420ms<\/td>\n<td>\u2193 72%<\/td>\n<\/tr>\n<tr>\n<td>\u5de5\u5355\u5206\u7c7b\u51c6\u786e\u7387<\/td>\n<td>97.2%<\/td>\n<td>96.5%<\/td>\n<td>\u2193 0.7%<\/td>\n<\/tr>\n<tr>\n<td>\u5355\u5361 QPS<\/td>\n<td>\u2014<\/td>\n<td>42<\/td>\n<td>\u57fa\u51c6<\/td>\n<\/tr>\n<tr>\n<td>\u65e5\u5747\u63a8\u7406\u6210\u672c<\/td>\n<td>4000 \u7f8e\u5143<\/td>\n<td>240 \u7f8e\u5143<\/td>\n<td>\u2193 94%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u51c6\u786e\u7387\u53ea\u6389\u4e86 0.7 \u4e2a\u767e\u5206\u70b9&#xff0c;\u4f46\u6210\u672c\u964d\u4e86 94%&#xff0c;\u5ef6\u8fdf\u964d\u4e86 72%\u3002\u5bf9\u5ba2\u670d\u573a\u666f\u6765\u8bf4&#xff0c;\u8fd9\u4e2a trade-off \u5b8c\u5168\u53ef\u63a5\u53d7\u2014\u2014\u6211\u4eec\u751a\u81f3\u901a\u8fc7\u8bdd\u672f\u6a21\u677f\u515c\u5e95&#xff0c;\u628a 0.7% \u7684\u8bef\u5206\u7c7b\u5f71\u54cd\u964d\u5230\u4e86\u63a5\u8fd1\u96f6\u3002<\/p>\n<h4>4.2 \u4ee3\u4ef7\u4e0e\u4e0d\u9002\u7528\u573a\u666f<\/h4>\n<p>\u8fd9\u5957\u65b9\u6848\u4e0d\u662f\u514d\u8d39\u7684&#xff0c;\u4ee3\u4ef7\u8981\u7b97\u6e05\u695a&#xff1a;<\/p>\n<ul>\n<li>\u84b8\u998f\u8bad\u7ec3\u6210\u672c&#xff1a;50 \u4e07\u6761\u6570\u636e\u6253\u6807 &#043; 3 \u4e2a epoch \u7684 LoRA \u5fae\u8c03&#xff0c;\u8bad\u7ec3\u673a 4\u00d7 A100 80G \u8dd1\u4e86\u4e00\u5468&#xff0c;\u7535\u8d39\u548c\u673a\u65f6\u6210\u672c\u7ea6 3000 \u7f8e\u5143\u3002\u5982\u679c\u4e1a\u52a1\u91cf\u4e0d\u591f\u5927&#xff0c;\u8fd9\u7b14\u6295\u5165\u53ef\u80fd\u96be\u4ee5\u56de\u672c\u3002<\/li>\n<li>\u7ef4\u62a4\u6210\u672c&#xff1a;\u6570\u636e\u6f02\u79fb\u662f\u5e38\u6001&#xff0c;\u6bcf\u5468\u589e\u91cf\u84b8\u998f\u9700\u8981\u6301\u7eed\u6295\u5165\u4eba\u529b\u3002\u6211\u4eec\u4e13\u95e8\u5b89\u6392\u4e86\u4e00\u4e2a\u5de5\u7a0b\u5e08\u8d1f\u8d23\u6570\u636e\u91c7\u6837\u3001\u6253\u6807\u3001\u5fae\u8c03\u3001\u4e0a\u7ebf\u7684\u5faa\u73af\u3002<\/li>\n<li>\u51c6\u786e\u7387\u635f\u5931&#xff1a;0.7% \u7684\u51c6\u786e\u7387\u4e0b\u964d&#xff0c;\u5728\u5ba2\u670d\u573a\u666f\u53ef\u4ee5\u63a5\u53d7&#xff0c;\u4f46\u5728\u533b\u7597\u8bca\u65ad\u3001\u91d1\u878d\u98ce\u63a7\u7b49\u573a\u666f\u53ef\u80fd\u4e0d\u53ef\u63a5\u53d7\u3002<\/li>\n<\/ul>\n<p>\u4e0d\u5efa\u8bae\u7167\u642c\u7684\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u5f00\u653e\u57df\u590d\u6742\u63a8\u7406&#xff1a;\u4ee3\u7801\u751f\u6210\u3001\u957f\u6587\u603b\u7ed3\u3001\u591a\u6b65\u63a8\u7406&#xff0c;7B \u6a21\u578b\u80fd\u529b\u5929\u82b1\u677f\u660e\u663e&#xff0c;\u84b8\u998f\u4e5f\u6551\u4e0d\u56de\u6765\u3002<\/li>\n<li>\u4efb\u52a1\u9891\u7e41\u53d8\u5316&#xff1a;\u5982\u679c\u4e1a\u52a1\u5206\u7c7b\u4f53\u7cfb\u6bcf\u6708\u90fd\u5728\u53d8&#xff0c;\u84b8\u998f\u6a21\u578b\u7684\u7ef4\u62a4\u6210\u672c\u4f1a\u5f88\u9ad8&#xff0c;\u4e0d\u5982\u76f4\u63a5\u7528\u5927\u6a21\u578b API\u3002<\/li>\n<li>\u5bf9\u51c6\u786e\u7387\u6781\u5ea6\u654f\u611f&#xff1a;\u533b\u7597\u8bca\u65ad\u3001\u91d1\u878d\u98ce\u63a7\u7b49\u573a\u666f&#xff0c;0.7% \u7684\u51c6\u786e\u7387\u635f\u5931\u53ef\u80fd\u4e0d\u53ef\u63a5\u53d7\u3002<\/li>\n<li>\u4e1a\u52a1\u91cf\u4e0d\u591f\u5927&#xff1a;\u5982\u679c\u65e5\u5747\u63a8\u7406\u8bf7\u6c42\u91cf\u4f4e\u4e8e 10 \u4e07\u6b21&#xff0c;\u84b8\u998f &#043; \u91cf\u5316\u7684\u524d\u671f\u6295\u5165\u53ef\u80fd\u6bd4\u76f4\u63a5\u7528\u5927\u6a21\u578b API \u66f4\u8d35\u3002<\/li>\n<\/ul>\n<h3>5. \u603b\u7ed3&#xff1a;\u9002\u7528\u8fb9\u754c&#xff0c;\u54ea\u4e9b\u4e1a\u52a1\u4e0d\u8981\u7167\u642c<\/h3>\n<h4>5.1 \u9002\u7528\u573a\u666f<\/h4>\n<ul>\n<li>\u5782\u76f4\u9886\u57df\u5224\u522b\u5f0f\u4efb\u52a1&#xff1a;\u77ed\u6587\u672c\u5206\u7c7b\u3001\u610f\u56fe\u8bc6\u522b\u3001\u5b9e\u4f53\u62bd\u53d6\u3001\u60c5\u611f\u5206\u6790\u3002\u8fd9\u7c7b\u4efb\u52a1\u7528 7B \u84b8\u998f\u6a21\u578b\u5b8c\u5168\u591f\u7528\u3002<\/li>\n<li>\u9ad8\u541e\u5410\u3001\u4f4e\u5ef6\u8fdf\u8981\u6c42&#xff1a;\u5ba2\u670d\u3001\u641c\u7d22\u6392\u5e8f\u3001\u5185\u5bb9\u5ba1\u6838\u7b49\u5b9e\u65f6\u6027\u5f3a\u7684\u573a\u666f\u3002<\/li>\n<li>\u6210\u672c\u654f\u611f\u578b SaaS&#xff1a;\u6bdb\u5229\u8584\u3001\u5bf9\u5355\u6b21\u63a8\u7406\u6210\u672c\u6781\u5ea6\u654f\u611f\u7684\u4e1a\u52a1\u3002<\/li>\n<\/ul>\n<h4>5.2 \u8fb9\u754c\u4e0e\u6559\u8bad<\/h4>\n<ul>\n<li>\u91cf\u5316\u4e0d\u662f\u94f6\u5f39&#xff1a;\u5b83\u53ea\u538b\u7f29\u4f53\u79ef&#xff0c;\u4e0d\u63d0\u5347\u80fd\u529b\u3002\u57fa\u5ea7\u9009\u9519&#xff0c;\u91cf\u5316\u540e\u4f9d\u7136\u9519\u3002<\/li>\n<li>\u84b8\u998f\u4f9d\u8d56 Teacher \u8d28\u91cf&#xff1a;Teacher \u7684\u6807\u6ce8\u8d28\u91cf\u76f4\u63a5\u51b3\u5b9a Student \u7684\u4e0a\u9650&#xff0c;\u5fc5\u987b\u505a\u7f6e\u4fe1\u5ea6\u8fc7\u6ee4\u3002<\/li>\n<li>\u6570\u636e\u6f02\u79fb\u662f\u5e38\u6001&#xff1a;\u7ebf\u4e0a\u5206\u5e03\u4f1a\u53d8&#xff0c;\u5fc5\u987b\u5efa\u7acb\u589e\u91cf\u84b8\u998f\u548c\u76d1\u63a7\u673a\u5236&#xff0c;\u5426\u5219\u51c6\u786e\u7387\u4f1a\u6084\u6084\u56de\u9000\u3002<\/li>\n<li>\u5148\u6838\u7b97\u6210\u672c\u518d\u52a8\u624b&#xff1a;\u84b8\u998f &#043; \u91cf\u5316\u7684\u524d\u671f\u6295\u5165\u4e0d\u5c0f&#xff0c;\u4e1a\u52a1\u91cf\u4e0d\u591f\u5927\u65f6\u4e0d\u5982\u76f4\u63a5\u7528\u5927\u6a21\u578b API\u3002<\/li>\n<\/ul>\n<p>\u6700\u7ec8&#xff0c;\u6211\u4eec\u7528\u300c\u84b8\u998f &#043; \u91cf\u5316\u300d\u7684\u7ec4\u5408\u62f3&#xff0c;\u628a\u65e5\u5747\u63a8\u7406\u6210\u672c\u4ece 4000 \u7f8e\u5143\u538b\u5230 240 \u7f8e\u5143&#xff0c;P95 \u5ef6\u8fdf\u4ece 1.5s \u964d\u5230 420ms&#xff0c;\u51c6\u786e\u7387\u53ea\u635f\u5931 0.7%\u3002\u8fd9\u6761\u8def\u5bf9 SaaS \u5ba2\u670d\u8fd9\u7c7b\u5782\u76f4\u573a\u666f&#xff0c;\u662f\u5f53\u524d\u6027\u4ef7\u6bd4\u6700\u9ad8\u7684\u89e3\u6cd5\u2014\u2014\u4f46\u524d\u63d0\u662f\u4e1a\u52a1\u91cf\u591f\u5927\u3001\u4efb\u52a1\u8db3\u591f\u5782\u76f4\u3001\u56e2\u961f\u80fd\u6301\u7eed\u7ef4\u62a4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u80cc\u666f&#xff1a;\u65e5\u5747 200 \u4e07\u6b21\u63a8\u7406&#xff0c;\u8d26\u5355\u6491\u4e0d\u4f4f\u4e86<br \/>\n\u6211\u4eec\u662f\u4e00\u5bb6\u505a SaaS \u667a\u80fd\u5ba2\u670d\u7684\u521b\u4e1a\u516c\u53f8&#xff0c;\u4ea7\u54c1\u5f62\u6001\u662f\u300c\u5de5\u5355\u81ea\u52a8\u5206\u7c7b  \u610f\u56fe\u8bc6\u522b  \u8bdd\u672f\u63a8\u8350\u300d&#xff0c;\u5e95\u5c42\u4f9d\u8d56\u5927\u6a21\u578b\u505a\u8bed\u4e49\u7406\u89e3\u3002\u4e1a\u52a1\u8dd1\u4e86\u5927\u534a\u5e74&#xff0c;\u65e5\u6d3b\u5ba2\u6237 300&#xff0c;\u65e5\u5747\u63a8\u7406\u8bf7\u6c42\u91cf\u7a33\u5b9a\u5728 200 \u4e07\u6b21\u5de6\u53f3&#xff0c;\u5176\u4e2d\u7ea6 60% \u662f\u77ed\u6587\u672c\u5206\u7c7b&#xff08;\u5de5\u5355\u6807\u9898  \u9996\u6761\u6d88\u606f&#xff09;&#xff0c;\u5e73\u5747\u8f93\u5165 token \u7ea6 120&amp;#x<\/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":[50,125],"topic":[],"class_list":["post-102751","post","type-post","status-publish","format-standard","hentry","category-server","tag-50","tag-125"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \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\/102751.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u80cc\u666f&#xff1a;\u65e5\u5747 200 \u4e07\u6b21\u63a8\u7406&#xff0c;\u8d26\u5355\u6491\u4e0d\u4f4f\u4e86 \u6211\u4eec\u662f\u4e00\u5bb6\u505a SaaS \u667a\u80fd\u5ba2\u670d\u7684\u521b\u4e1a\u516c\u53f8&#xff0c;\u4ea7\u54c1\u5f62\u6001\u662f\u300c\u5de5\u5355\u81ea\u52a8\u5206\u7c7b \u610f\u56fe\u8bc6\u522b \u8bdd\u672f\u63a8\u8350\u300d&#xff0c;\u5e95\u5c42\u4f9d\u8d56\u5927\u6a21\u578b\u505a\u8bed\u4e49\u7406\u89e3\u3002\u4e1a\u52a1\u8dd1\u4e86\u5927\u534a\u5e74&#xff0c;\u65e5\u6d3b\u5ba2\u6237 300&#xff0c;\u65e5\u5747\u63a8\u7406\u8bf7\u6c42\u91cf\u7a33\u5b9a\u5728 200 \u4e07\u6b21\u5de6\u53f3&#xff0c;\u5176\u4e2d\u7ea6 60% \u662f\u77ed\u6587\u672c\u5206\u7c7b&#xff08;\u5de5\u5355\u6807\u9898 \u9996\u6761\u6d88\u606f&#xff09;&#xff0c;\u5e73\u5747\u8f93\u5165 token \u7ea6 120&amp;#x\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102751.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T04:32:54+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102751.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102751.html\",\"name\":\"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-09T04:32:54+00:00\",\"dateModified\":\"2026-09-09T04:32:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102751.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102751.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102751.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218\"}]},{\"@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":"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \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\/102751.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u80cc\u666f&#xff1a;\u65e5\u5747 200 \u4e07\u6b21\u63a8\u7406&#xff0c;\u8d26\u5355\u6491\u4e0d\u4f4f\u4e86 \u6211\u4eec\u662f\u4e00\u5bb6\u505a SaaS \u667a\u80fd\u5ba2\u670d\u7684\u521b\u4e1a\u516c\u53f8&#xff0c;\u4ea7\u54c1\u5f62\u6001\u662f\u300c\u5de5\u5355\u81ea\u52a8\u5206\u7c7b \u610f\u56fe\u8bc6\u522b \u8bdd\u672f\u63a8\u8350\u300d&#xff0c;\u5e95\u5c42\u4f9d\u8d56\u5927\u6a21\u578b\u505a\u8bed\u4e49\u7406\u89e3\u3002\u4e1a\u52a1\u8dd1\u4e86\u5927\u534a\u5e74&#xff0c;\u65e5\u6d3b\u5ba2\u6237 300&#xff0c;\u65e5\u5747\u63a8\u7406\u8bf7\u6c42\u91cf\u7a33\u5b9a\u5728 200 \u4e07\u6b21\u5de6\u53f3&#xff0c;\u5176\u4e2d\u7ea6 60% \u662f\u77ed\u6587\u672c\u5206\u7c7b&#xff08;\u5de5\u5355\u6807\u9898 \u9996\u6761\u6d88\u606f&#xff09;&#xff0c;\u5e73\u5747\u8f93\u5165 token \u7ea6 120&amp;#x","og_url":"https:\/\/www.wsisp.com\/helps\/102751.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-09T04:32:54+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/102751.html","url":"https:\/\/www.wsisp.com\/helps\/102751.html","name":"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-09T04:32:54+00:00","dateModified":"2026-09-09T04:32:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102751.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102751.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102751.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5927\u6a21\u578b\u63a8\u7406\u6210\u672c\u4f18\u5316\uff1aSaaS \u5ba2\u670d\u573a\u666f\u4e0b\u7684\u91cf\u5316\u4e0e\u84b8\u998f\u5b9e\u6218"}]},{"@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\/102751","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=102751"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102751\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102751"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}