{"id":10021351,"date":"2026-04-29T16:29:45","date_gmt":"2026-04-29T08:29:45","guid":{"rendered":"https:\/\/itmax.cn\/?p=10021351"},"modified":"2026-04-29T16:29:45","modified_gmt":"2026-04-29T08:29:45","slug":"%e5%ae%9e%e6%97%b6-ai-copilot-%e7%ab%af%e5%88%b0%e7%ab%af%e5%bb%b6%e8%bf%9f%e9%a2%84%e7%ae%97%e5%88%86%e9%85%8d%ef%bc%9a%e4%bb%8e-slo-%e5%8f%8d%e6%8e%a8-5-%e6%ae%b5%e9%93%be%e8%b7%af%e8%be%b9%e7%95%8c","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10021351","title":{"rendered":"\u5b9e\u65f6 AI Copilot \u7aef\u5230\u7aef\u5ef6\u8fdf\u9884\u7b97\u5206\u914d\uff1a\u4ece SLO \u53cd\u63a8 5 \u6bb5\u94fe\u8def\u8fb9\u754c\uff08\u542b\u5e76\u884c\u4f18\u5316\u8def\u5f84 + \u5b9e\u6d4b\u6570\u636e\uff09"},"content":{"rendered":"<h2>\u5b9e\u65f6 AI Copilot \u7aef\u5230\u7aef\u5ef6\u8fdf\u9884\u7b97\u5206\u914d\uff1a\u4ece SLO \u53cd\u63a8 5 \u6bb5\u94fe\u8def\u8fb9\u754c\uff08\u542b\u5e76\u884c\u4f18\u5316\u8def\u5f84 + \u5b9e\u6d4b\u6570\u636e\uff09<\/h2>\n<h3>TL;DR<\/h3>\n<p>\u5b9e\u65f6 AI \u5bf9\u8bdd\u7cfb\u7edf\u7684&#8221;\u5361\u987f\u611f&#8221;\u51e0\u4e4e\u90fd\u6e90\u4e8e\u4e00\u4e2a\u5de5\u7a0b\u9519\u8bef\uff1a<strong>\u628a\u7aef\u5230\u7aef\u5ef6\u8fdf\u5f53\u6210\u5355\u70b9\u6307\u6807\u505a\u4f18\u5316\uff0c\u800c\u4e0d\u662f\u6309\u94fe\u8def\u5206\u6bb5\u505a\u9884\u7b97\u5206\u914d<\/strong>\u3002\u4e0b\u9762\u662f\u5173\u952e\u7ed3\u8bba\uff1a<\/p>\n<ol>\n<li><strong>\u9996\u5b57\u7b26\u5ef6\u8fdf SLO \u2264 1.2s<\/strong> \u662f\u771f\u5b9e&#8221;\u6d41\u7545\u611f&#8221;\u5206\u6c34\u5cad\uff08\u7528\u6237\u611f\u77e5\u7814\u7a76\uff1a&gt;1.5s \u5373\u88ab\u5224\u5b9a\u4e3a&#8221;\u53cd\u5e94\u6162\u534a\u62cd&#8221;\uff09<\/li>\n<li><strong>5 \u6bb5\u94fe\u8def<\/strong> \u5404\u81ea\u5fc5\u987b\u6709\u72ec\u7acb\u9884\u7b97\uff1aVAD(80ms) + ASR \u6d41\u5f0f\u9996\u5305(280ms) + Prompt \u88c5\u914d(40ms) + LLM \u9996 Token(600ms) + TTS \u9996\u5305(200ms)<\/li>\n<li><strong>VAD \u662f\u6700\u88ab\u5ffd\u89c6\u7684\u74f6\u9888<\/strong>\uff1a\u9ed8\u8ba4 webrtcvad \u7b2c 30 \u5e27\u7b56\u7565\u5c31\u662f 600ms \u9759\u97f3\u624d\u51fa\u6808\uff0c\u628a\u9996\u5b57\u7b26\u76f4\u63a5\u62d6\u5230 1.8s+<\/li>\n<li><strong>ASR \u6d41\u5f0f\u5fc5\u987b partial-final \u53cc\u8f68<\/strong>\uff1apartial \u8d70 word-level \u589e\u91cf\u63a8\u7406\uff0cfinal \u5355\u72ec\u8dd1\u6807\u70b9+\u8bdd\u8bed\u7ed3\u675f\u5224\u5b9a<\/li>\n<li><strong>LLM \u9996 Token \u4f18\u5316 70% \u6765\u81ea prompt \u957f\u5ea6\uff0c\u800c\u4e0d\u662f\u6a21\u578b\u672c\u8eab<\/strong>\uff1a32K \u4e0a\u4e0b\u6587\u538b\u7f29\u5230 4K \u80fd\u4ece 720ms \u964d\u5230 380ms<\/li>\n<li><strong>TTS \u6d41\u5f0f\u5408\u6210\u5fc5\u987b chunk \u7ea7\u64ad\u653e<\/strong>\uff1a\u4e00\u6b21 sentence-level \u5408\u6210\u7b49\u4e8e\u635f\u5931 200-400ms<\/li>\n<\/ol>\n<p>\u672c\u6587\u4ee5\u4e00\u4e2a\u751f\u4ea7\u7ea7\u5b9e\u65f6\u9762\u8bd5 Copilot \u4e3a\u6837\u672c\uff0c\u628a 1800ms \u7aef\u5230\u7aef\u5ef6\u8fdf\u62c6\u89e3\u5230 5 \u6bb5\uff0c\u7ed9\u51fa\u6bcf\u6bb5\u7684\u4f18\u5316\u8def\u5f84\u3001\u5b9e\u6d4b\u524d\u540e\u5bf9\u6bd4\u6570\u636e\u3001\u4ee5\u53ca\u8e29\u8fc7\u7684\u5751\u3002<\/p>\n<hr>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u7aef\u5230\u7aef\u5ef6\u8fdf\u5fc5\u987b\u5206\u6bb5\u505a\u9884\u7b97<\/h3>\n<p>\u7edd\u5927\u591a\u6570 AI \u5bf9\u8bdd\u9879\u76ee\u7684\u5ef6\u8fdf\u4f18\u5316\u8def\u5f84\u957f\u8fd9\u6837\uff1a<\/p>\n<blockquote><p>\u7528\u6237\u8bf4&#8221;\u6211\u7684\u5ef6\u8fdf\u5230 2.5s \u4e86\uff0c\u592a\u6162&#8221; \u2192 \u5de5\u7a0b\u5e08\u8dd1 trace \u2192 \u770b\u5230 LLM \u8c03\u7528\u5360 1.4s \u2192 \u6362\u66f4\u5feb\u7684\u6a21\u578b \u2192 \u964d\u5230 1.1s \u2192 \u597d\u4e86\u4e0a\u7ebf\u3002<\/p><\/blockquote>\n<p>\u4f46\u7528\u6237\u56de\u8fc7\u6765\u8bf4\uff1a&#8221;\u8fd8\u662f\u611f\u89c9\u5361\u3002&#8221;<\/p>\n<p><strong>\u95ee\u9898\u5728\u4e8e\u4f60\u4f18\u5316\u7684\u662f\u5e73\u5747\u503c\uff0c\u4e0d\u662f\u7528\u6237\u611f\u77e5<\/strong>\u3002\u7528\u6237\u611f\u77e5\u7684&#8221;\u5361&#8221;\u5206\u4e24\u79cd\uff1a<\/p>\n<ul>\n<li><strong>\u9996\u5b57\u7b26\u5ef6\u8fdf<\/strong>\uff1a\u4ece\u7528\u6237\u8bf4\u5b8c\u8bdd\u5230\u5c4f\u5e55\u5f00\u59cb\u51fa\u7b2c\u4e00\u4e2a\u5b57\u7684\u65f6\u95f4<\/li>\n<li><strong>\u8282\u594f\u65ad\u70b9<\/strong>\uff1a\u53e5\u5b50\u4e2d\u6bb5\u7a81\u7136\u505c\u987f\u8d85\u8fc7 200ms<\/li>\n<\/ul>\n<p>\u8fd9\u4e24\u4e2a\u6307\u6807\u548c&#8221;\u7aef\u5230\u7aef\u5ef6\u8fdf&#8221;\u51e0\u4e4e\u4e0d\u76f8\u5173\u3002\u4e00\u4e2a P50 \u5ef6\u8fdf 1.4s \u4f46\u9996\u5b57\u7b26 600ms \u7684\u7cfb\u7edf\uff0c\u4f53\u611f\u6bd4 P50 \u5ef6\u8fdf 900ms \u4f46\u9996\u5b57\u7b26 1.2s \u7684\u7cfb\u7edf\u6d41\u7545\u5f97\u591a\u3002<\/p>\n<p>\u6240\u4ee5\u5b9e\u65f6\u7cfb\u7edf\u7684\u5ef6\u8fdf\u4f18\u5316\u5fc5\u987b\u4ece SLO \u53cd\u63a8\uff1a<\/p>\n<pre><code>\u76ee\u6807\uff1a\u9996\u5b57\u7b26 \u2264 1.2s\uff08P95\uff09\n\u9884\u7b97\u5206\u914d\uff1a\n  VAD \u9759\u97f3\u5224\u5b9a        80ms\n  ASR \u6d41\u5f0f\u9996\u5305        280ms\n  Prompt \u88c5\u914d         40ms\n  LLM \u9996 Token        600ms\n  TTS \u9996\u5305\u5408\u6210        200ms\n  ----------------------\n  \u5408\u8ba1                1200ms<\/code><\/pre>\n<p>\u6bcf\u6bb5\u8d85\u9884\u7b97\u5c31\u89e6\u53d1\u8be5\u6bb5\u7684\u4f18\u5316\u8def\u5f84\u3002\u8fd9\u662f\u5de5\u7a0b\u4e0a\u552f\u4e00\u53ef\u63a7\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u6211\u4eec\u56e2\u961f\u5728\u505a\u5b9e\u65f6\u9762\u8bd5 Copilot \u65f6\uff0c\u7aef\u5230\u7aef\u5ef6\u8fdf\u4ece 1.8s \u4f18\u5316\u5230 920ms\uff0c\u5168\u7a0b\u6ca1\u6362 LLM \u6a21\u578b\uff0c\u6ca1\u6362 ASR \u670d\u52a1\u5546\uff0c\u5168\u90e8\u5728\u8fd9 5 \u6bb5\u9884\u7b97\u91cc\u6298\u817e\u3002\u4e0b\u9762\u9010\u6bb5\u62c6\u3002<\/p>\n<hr>\n<h3>\u4e8c\u3001\u7b2c 1 \u6bb5\uff1aVAD\uff08\u8bed\u97f3\u6d3b\u52a8\u68c0\u6d4b\uff09\u2014 \u6700\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684 600ms<\/h3>\n<p><strong>\u9ed8\u8ba4\u914d\u7f6e\u7684\u5751<\/strong>\uff1a<\/p>\n<p>webrtcvad \u9ed8\u8ba4\u63a8\u8350 frame_duration=30ms\uff0caggressiveness=2\uff0c\u8fde\u7eed N \u5e27\u9759\u97f3\u624d\u5224\u5b9a\u4e3a\u8bdd\u8bed\u7ed3\u675f\u3002\u5e38\u89c1 N=20\uff0c\u610f\u5473\u7740 600ms \u9759\u97f3\u624d\u51fa\u6808\u3002\u8fd9 600ms \u76f4\u63a5\u8fdb\u5165\u7aef\u5230\u7aef\u5ef6\u8fdf\u3002<\/p>\n<p><strong>\u4f18\u5316\u8def\u5f84<\/strong>\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7b56\u7565<\/th>\n<th>frame_duration<\/th>\n<th>N \u5e27<\/th>\n<th>\u9759\u97f3\u9608\u503c<\/th>\n<th>\u8bef\u5224\u7387<\/th>\n<th>\u9996\u5b57\u7b26\u8d21\u732e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u9ed8\u8ba4<\/td>\n<td>30ms<\/td>\n<td>20<\/td>\n<td>600ms<\/td>\n<td>&lt;2%<\/td>\n<td>+600ms<\/td>\n<\/tr>\n<tr>\n<td>\u77ed\u7a97<\/td>\n<td>30ms<\/td>\n<td>8<\/td>\n<td>240ms<\/td>\n<td>4-6%<\/td>\n<td>+240ms<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u9002\u5e94<\/td>\n<td>30ms<\/td>\n<td>4-12 \u52a8\u6001<\/td>\n<td>120-360ms<\/td>\n<td>&lt;3%<\/td>\n<td>+120ms<\/td>\n<\/tr>\n<tr>\n<td>\u6df7\u5408 VAD + \u8bed\u4e49\u89e6\u53d1<\/td>\n<td>30ms<\/td>\n<td>6 + \u53e5\u672b\u52a9\u8bcd\u68c0\u6d4b<\/td>\n<td>90ms<\/td>\n<td>&lt;2%<\/td>\n<td>+90ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u4eec\u6700\u7ec8\u843d\u5730\u7684\u662f\u7b2c 4 \u79cd\uff1awebrtcvad \u77ed\u7a97 N=6\uff08180ms\uff09+ ASR partial \u6587\u672c\u91cc\u68c0\u6d4b\u53e5\u672b\u52a9\u8bcd\uff08&#8221;\u5417\/\u5462\/\u5427\/\u554a\/\u561b\/\u5440\/\u3002\/\uff1f\/\uff01&#8221;\uff09\u3002\u4e24\u4e2a\u4fe1\u53f7\u4efb\u4e00\u547d\u4e2d\u5c31\u89e6\u53d1\u4e0b\u6e38\u5904\u7406\u3002<\/p>\n<p><strong>\u8fd9\u4e00\u6bb5\u4ece 600ms \u4f18\u5316\u5230 80ms\uff0c\u7eaf\u8d5a 520ms\u3002<\/strong><\/p>\n<p>\u4ee3\u7801\u7247\u6bb5\uff1a<\/p>\n<pre><code class=\"python\">class HybridVAD:\n    def __init__(self, sample_rate=16000):\n        self.vad = webrtcvad.Vad(2)\n        self.frame_size = int(sample_rate * 0.03)  # 30ms\n        self.silence_frames = 0\n        self.SILENCE_N = 6  # 180ms\n        self.END_PARTICLES = set(&quot;\u5417\u5462\u5427\u554a\u561b\u5440\u3002\uff1f\uff01.?!&quot;)\n\n    def feed(self, pcm_chunk: bytes, partial_text: str) -&gt; bool:\n        is_speech = self.vad.is_speech(pcm_chunk, sample_rate=16000)\n        if is_speech:\n            self.silence_frames = 0\n            return False\n        self.silence_frames += 1\n        # \u8def\u5f84 A\uff1a\u7eaf\u9759\u97f3\u8d85\u8fc7 N \u5e27\n        if self.silence_frames &gt;= self.SILENCE_N:\n            return True\n        # \u8def\u5f84 B\uff1apartial \u6587\u672c\u53e5\u672b\u52a9\u8bcd\u547d\u4e2d + \u9759\u97f3 \u22653 \u5e27\uff0890ms\uff09\n        if self.silence_frames &gt;= 3 and partial_text and partial_text[-1] in self.END_PARTICLES:\n            return True\n        return False<\/code><\/pre>\n<p><strong>\u8e29\u5751<\/strong>\uff1a\u53e5\u672b\u52a9\u8bcd\u68c0\u6d4b\u8981\u770b partial_text \u7684\u6700\u540e\u4e00\u4e2a\u975e\u7a7a\u5b57\u7b26\uff0c\u4e0d\u80fd strip\u3002Whisper \u6d41\u5f0f partial \u5076\u5c14\u4f1a\u5728\u672b\u5c3e\u5e26\u7a7a\u683c\u6216\u6362\u884c\uff0c\u53bb\u9664\u540e\u5224\u65ad\u3002<\/p>\n<hr>\n<h3>\u4e09\u3001\u7b2c 2 \u6bb5\uff1aASR \u6d41\u5f0f\u9996\u5305 \u2014 partial \/ final \u53cc\u8f68\u8bbe\u8ba1<\/h3>\n<p><strong>\u5173\u952e\u8ba4\u77e5<\/strong>\uff1a\u6d41\u5f0f ASR \u6709 2 \u79cd&#8221;\u9996\u5305&#8221;\uff0c\u542b\u4e49\u5b8c\u5168\u4e0d\u540c\uff1a<\/p>\n<ul>\n<li><strong>partial \u9996\u5305<\/strong>\uff1a\u4ece\u7528\u6237\u5f00\u53e3\u5230\u5c4f\u5e55\u51fa\u73b0\u7b2c\u4e00\u4e2a\u8bc6\u522b\u5b57\uff0c\u76ee\u6807 \u2264 280ms<\/li>\n<li><strong>final \u9996\u5305<\/strong>\uff1a\u4ece\u7528\u6237\u505c\u6b62\u8bf4\u8bdd\u5230\u5b8c\u6574\u8bc6\u522b\u7ed3\u679c\u51fa\u6765\uff0c\u76ee\u6807 \u2264 400ms\uff08\u542b\u6807\u70b9\uff09<\/li>\n<\/ul>\n<p>\u5f88\u591a\u56e2\u961f\u53ea\u76ef\u4e00\u4e2a\u6307\u6807\uff08\u901a\u5e38\u662f final\uff09\uff0c\u7ed3\u679c partial \u6162\u5f97\u79bb\u8c31\uff0c\u7528\u6237\u5728\u5c4f\u5e55\u4e0a\u770b\u4e0d\u5230\u81ea\u5df1\u6b63\u5728\u8bf4\u4ec0\u4e48\uff0c\u4f1a\u6709&#8221;\u7cfb\u7edf\u6ca1\u5728\u542c&#8221;\u7684\u9519\u89c9\u3002<\/p>\n<p><strong>\u53cc\u8f68\u7b56\u7565<\/strong>\uff1a<\/p>\n<pre><code>audio_stream\n    \u251c\u2500 partial_track\uff08word-level\uff0c\u65e0\u6807\u70b9\uff0c2 \u5c42 transformer\uff09\n    \u2502      \u2514\u2500 \u6bcf 80ms \u63a8\u7406\u4e00\u6b21\uff0c\u8986\u76d6\u6700\u8fd1 1.6s \u6ed1\u52a8\u7a97\u53e3\n    \u2502\n    \u2514\u2500 final_track\uff08utterance-level\uff0c\u542b\u6807\u70b9+\u53e3\u8bed\u5316\u7ea0\u6b63\uff0c6 \u5c42\uff09\n           \u2514\u2500 \u5728 VAD \u89e6\u53d1\u540e\u4ece partial \u53d6\u4e0a\u4e0b\u6587\uff0c\u5355\u6b21\u63a8\u7406\u51fa final<\/code><\/pre>\n<p>partial track \u7528\u8f7b\u91cf\u6a21\u578b\uff08\u53c2\u6570\u91cf 1\/3\uff09\uff0c\u53ea\u8f93\u51fa char-level \u5e8f\u5217\uff0c\u4e0d\u505a\u6807\u70b9\u4e0d\u505a normalize\uff0c\u4e13\u5fc3\u8ffd\u6c42\u5ef6\u8fdf\u3002final track \u5728 VAD \u89e6\u53d1\u540e\u542f\u52a8\uff0c\u590d\u7528 partial \u7684 encoder \u72b6\u6001\uff0c\u76f4\u63a5 decode\u3002<\/p>\n<p><strong>\u5b9e\u6d4b\u5bf9\u6bd4<\/strong>\uff08\u5ba2\u6237\u7aef\u5230\u5c4f\u5e55\u663e\u793a\u9996\u5b57\u7b26\uff09\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7b56\u7565<\/th>\n<th>partial \u9996\u5305<\/th>\n<th>final \u9996\u5305<\/th>\n<th>\u8bef\u8bc6\u7387<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5355\u8f68\u6d41\u5f0f\uff08baseline\uff09<\/td>\n<td>480ms<\/td>\n<td>720ms<\/td>\n<td>4.2%<\/td>\n<\/tr>\n<tr>\n<td>\u53cc\u8f68 + encoder \u5171\u4eab<\/td>\n<td>280ms<\/td>\n<td>380ms<\/td>\n<td>4.6%<\/td>\n<\/tr>\n<tr>\n<td>\u53cc\u8f68 + \u8fb9\u7f18 GPU \u90e8\u7f72<\/td>\n<td>180ms<\/td>\n<td>260ms<\/td>\n<td>4.6%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u8e29\u5751<\/strong>\uff1apartial \u4e0d\u8981\u76f4\u63a5 stream \u7ed9 LLM\u3002partial \u6587\u672c\u4f1a\u53cd\u590d\u4fee\u6b63\uff08&#8221;\u6211\u60f3\u505a&#8221; \u2192 &#8220;\u6211\u60f3\u505a\u7684&#8221; \u2192 &#8220;\u6211\u60f3\u505a\u7684\u4e8b\u60c5&#8221;\uff09\uff0c\u5982\u679c\u6bcf\u6b21 partial \u90fd\u89e6\u53d1 LLM \u8c03\u7528\uff0c\u4f1a\u6d6a\u8d39 4-6 \u500d token\uff0c\u4e14 LLM \u7684 prefix cache \u547d\u4e2d\u7387\u4f1a\u4ece 92% \u66b4\u8dcc\u5230 50% \u4ee5\u4e0b\u3002partial \u53ea\u7528\u4e8e UI \u5c55\u793a\u548c VAD \u53e5\u672b\u5224\u5b9a\uff0c<strong>LLM \u6c38\u8fdc\u53ea\u5403 final<\/strong>\u3002<\/p>\n<hr>\n<h3>\u56db\u3001\u7b2c 3 \u6bb5\uff1aPrompt \u88c5\u914d \u2014 \u770b\u4f3c 0 \u6210\u672c\uff0c\u5b9e\u9645\u80fd\u7206 300ms<\/h3>\n<p>Prompt \u88c5\u914d\u542c\u8d77\u6765\u662f string concat\uff0c\u5e94\u8be5 1ms \u5b8c\u6210\u3002\u5b9e\u9645\u751f\u4ea7\u573a\u666f\u91cc\uff0cprompt \u88c5\u914d\u5f80\u5f80\u8981\u505a\uff1a<\/p>\n<ol>\n<li>\u5386\u53f2 context \u53ec\u56de\uff08\u5411\u91cf\u68c0\u7d22 \u2248 80ms\uff09<\/li>\n<li>\u5019\u9009\u4eba\u7b80\u5386\u5207\u7247\uff08\u6309\u5f53\u524d\u95ee\u9898\u8bed\u4e49\u5339\u914d \u2248 60ms\uff09<\/li>\n<li>\u77e5\u8bc6\u5e93\u7247\u6bb5\uff08\u884c\u4e1a\u7279\u5b9a + \u516c\u53f8\u7279\u5b9a \u2248 120ms\uff09<\/li>\n<li>\u9632\u6b62 prompt \u8d85 token \u4e0a\u9650\u7684\u622a\u65ad\u903b\u8f91\uff08\u2248 20ms\uff09<\/li>\n<\/ol>\n<p>\u52a0\u8d77\u6765 300ms \u4e0d\u5938\u5f20\u3002\u8fd9 300ms \u5168\u5728 critical path \u4e0a\uff0c\u76f4\u63a5\u5403\u6389\u9996\u5b57\u7b26\u9884\u7b97\u3002<\/p>\n<p><strong>\u4f18\u5316\u8def\u5f84<\/strong>\uff1a\u628a&#8221;\u88c5\u914d&#8221;\u4ece\u4e32\u884c\u6539\u4e3a\u9884\u70ed + \u589e\u91cf\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9636\u6bb5<\/th>\n<th>\u4e32\u884c\u88c5\u914d<\/th>\n<th>\u9884\u70ed + \u589e\u91cf<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u7528\u6237\u8bf4\u8bdd\u671f\u95f4\uff08partial \u9636\u6bb5\uff09<\/td>\n<td>\u4e0d\u505a\u4e8b<\/td>\n<td>\u540e\u53f0\u9884\u62c9\u7b80\u5386 + \u77e5\u8bc6\u5e93\uff08200ms\uff09<\/td>\n<\/tr>\n<tr>\n<td>VAD \u89e6\u53d1\u540e<\/td>\n<td>\u5168\u91cf\u88c5\u914d (300ms)<\/td>\n<td>\u53ea\u8ffd\u52a0\u5f53\u524d\u95ee\u9898\u5411\u91cf\u53ec\u56de (40ms)<\/td>\n<\/tr>\n<tr>\n<td>LLM \u8c03\u7528<\/td>\n<td>300ms \u540e\u624d\u53d1\u8d77<\/td>\n<td>40ms \u540e\u7acb\u5373\u53d1\u8d77<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6548\u679c\uff1a\u88c5\u914d\u9636\u6bb5\u4ece 300ms \u538b\u5230 40ms\uff0c<strong>\u7701 260ms<\/strong>\u3002<\/p>\n<p>\u4ee3\u7801\u9aa8\u67b6\uff1a<\/p>\n<pre><code class=\"python\">class PromptAssembler:\n    def __init__(self):\n        self.warm_context = None  # \u9884\u70ed\u7f13\u5b58\n        \n    async def warm_up(self, candidate_id: str, partial_text: str):\n        &quot;&quot;&quot;\u7528\u6237\u8bf4\u8bdd\u671f\u95f4\u540e\u53f0\u9884\u70ed\uff1a\u62c9\u7b80\u5386 + \u62c9\u77e5\u8bc6\u5e93\u7247\u6bb5&quot;&quot;&quot;\n        if self.warm_context is None:\n            self.warm_context = await asyncio.gather(\n                self.fetch_resume_slices(candidate_id),\n                self.fetch_kb_snippets_by_partial(partial_text),\n            )\n    \n    async def finalize(self, final_text: str) -&gt; str:\n        &quot;&quot;&quot;VAD \u89e6\u53d1\u540e\uff0c\u53ea\u8ffd\u52a0 final \u95ee\u9898\u53ec\u56de&quot;&quot;&quot;\n        question_ctx = await self.retrieve_by_final(final_text, top_k=3)\n        resume, kb = self.warm_context\n        return self.template.format(\n            resume=resume,\n            kb=kb,\n            question_ctx=question_ctx,\n            final_text=final_text,\n        )<\/code><\/pre>\n<p><strong>\u8e29\u5751<\/strong>\uff1apartial \u6587\u672c\u4e00\u76f4\u5728\u53d8\uff0cwarm_up \u4e0d\u80fd\u6bcf\u6b21\u90fd\u91cd\u505a\uff08\u4f1a\u649e\u5230\u5411\u91cf\u5e93 QPS \u9650\u5236\uff09\u3002\u5224\u5b9a\u6761\u4ef6\uff1apartial \u957f\u5ea6 \u2265 5 \u5b57 + \u8ddd\u79bb\u4e0a\u6b21 warm \u8d85 800ms \u624d\u89e6\u53d1\u3002\u8fd9\u4e2a\u9608\u503c\u7528\u7ebf\u4e0b trace \u6570\u636e\u8c03\u53c2\u51fa\u6765\u7684\u3002<\/p>\n<hr>\n<h3>\u4e94\u3001\u7b2c 4 \u6bb5\uff1aLLM \u9996 Token \u2014 70% \u6536\u76ca\u6765\u81ea prompt \u538b\u7f29<\/h3>\n<p>\u5f88\u591a\u4eba\u4f18\u5316 LLM \u5ef6\u8fdf\u7b2c\u4e00\u53cd\u5e94\u662f\u6362\u6a21\u578b\u3002\u6362 GPT-4o \u2192 GPT-4o-mini\uff0c\u5ef6\u8fdf\u4ece 1200ms \u964d\u5230 700ms\uff0c\u770b\u8d77\u6765\u5f88\u723d\uff0c\u4f46\u56de\u7b54\u8d28\u91cf\u6389\u4e00\u6863\uff0c\u4e1a\u52a1\u53d7\u4e0d\u4f4f\u3002<\/p>\n<p><strong>\u771f\u6b63\u7684 70% \u6536\u76ca\u6765\u81ea prompt \u538b\u7f29<\/strong>\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u4e0a\u4e0b\u6587 token \u6570<\/th>\n<th>\u9996 Token \u5ef6\u8fdf\uff08GPT-4o\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>32K<\/td>\n<td>1240ms<\/td>\n<\/tr>\n<tr>\n<td>16K<\/td>\n<td>820ms<\/td>\n<\/tr>\n<tr>\n<td>8K<\/td>\n<td>540ms<\/td>\n<\/tr>\n<tr>\n<td>4K<\/td>\n<td>380ms<\/td>\n<\/tr>\n<tr>\n<td>2K<\/td>\n<td>280ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>token \u6570\u548c\u9996 Token \u5ef6\u8fdf\u63a5\u8fd1\u7ebf\u6027\u5173\u7cfb\u3002\u538b\u4e00\u534a token\uff0c\u9996 Token \u780d 40%\u3002<\/p>\n<p><strong>\u538b\u7f29\u94fe\u8def<\/strong>\uff085 \u4e2a\u9636\u6bb5\uff09\uff1a<\/p>\n<ol>\n<li><strong>\u5386\u53f2\u5bf9\u8bdd\u5207\u7247\u5316<\/strong>\uff08\u4e0d\u662f\u5806 raw text\uff09\uff1a\u6bcf N \u8f6e\u538b\u6210 1 \u4e2a summary\uff0csummary \u7528 50 token \u9876 N \u8f6e\u539f\u6587 500-1000 token<\/li>\n<li><strong>\u7b80\u5386\u5206\u5757\u53ec\u56de<\/strong>\uff08\u4e0d\u662f\u5168\u91cf\u585e\uff09\uff1a\u6309\u5f53\u524d\u95ee\u9898\u5411\u91cf\u68c0\u7d22\uff0c\u53ea\u53d6 top-3 \u5757\uff08\u7ea6 600 token\uff09\uff0c\u820d\u5f03\u5176\u4ed6<\/li>\n<li><strong>\u77e5\u8bc6\u5e93 MMR \u53bb\u91cd<\/strong>\uff1atop-5 \u53ec\u56de\u540e\u7528 MMR \u91cd\u6392\uff0c\u53bb\u6389\u76f8\u4f3c\u5ea6 &gt; 0.85 \u7684\u5197\u4f59\u9879<\/li>\n<li><strong>\u5173\u952e\u4e8b\u5b9e\u62bd\u53d6\uff08KFE\uff09<\/strong>\uff1a\u4ece\u5386\u53f2\u5bf9\u8bdd\u91cc\u62bd\u51fa&#8221;\u5019\u9009\u4eba\u4e3b\u5f20\u7684\u5173\u952e\u4e8b\u5b9e&#8221;\uff0c\u5355\u72ec\u5b58\u4e3a\u7ed3\u6784\u5316\u5b57\u6bb5\uff0c\u907f\u514d\u88ab\u5207\u7247\u5316\u538b\u7f29\u6389<\/li>\n<li><strong>Token \u9884\u7b97\u786c\u7ea6\u675f<\/strong>\uff1a\u88c5\u914d\u540e\u603b token &gt; 4K \u65f6\u5f3a\u5236\u622a\u65ad\uff0c\u4ece\u6ed1\u52a8\u7a97\u53e3\u51b7\u533a\u5f00\u59cb\u780d<\/li>\n<\/ol>\n<p>\u5b9e\u6d4b\uff1a32K \u539f\u59cb\u4e0a\u4e0b\u6587 \u2192 4K \u538b\u7f29\u540e\uff0c\u9996 Token \u4ece 1240ms \u964d\u5230 380ms\uff0c<strong>\u7eaf\u8d5a 860ms<\/strong>\u3002<\/p>\n<p><strong>Streaming \u914d\u7f6e<\/strong>\uff1a<\/p>\n<pre><code class=\"python\">async for chunk in client.chat.completions.create(\n    model=&quot;gpt-4o&quot;,\n    messages=messages,\n    stream=True,\n    temperature=0.3,\n    max_tokens=200,  # \u5b9e\u65f6\u573a\u666f\u4e0d\u8981 800\/1000\n    stream_options={&quot;include_usage&quot;: True},\n):\n    if chunk.choices[0].delta.content:\n        yield chunk.choices[0].delta.content<\/code><\/pre>\n<p><strong>\u8e29\u5751<\/strong>\uff1a<code>max_tokens<\/code> \u4e0d\u8981\u7167\u642c\u6279\u5904\u7406\u573a\u666f\u7684 800-2000\u3002\u5b9e\u65f6\u5bf9\u8bdd\u573a\u666f 200 \u8db3\u591f\uff08\u4e00\u53e5\u5b8c\u6574\u56de\u590d 80-150 \u5b57\uff09\uff0c\u8fc7\u5927\u4f1a\u8ba9 server \u7aef prefill \u9636\u6bb5\u505a\u66f4\u957f\u7684 KV \u5206\u914d\uff0c\u9996 Token \u5ef6\u8fdf\u4e0d\u53ef\u89c1\u5730\u62c9\u957f\u3002<\/p>\n<hr>\n<h3>\u516d\u3001\u7b2c 5 \u6bb5\uff1aTTS \u6d41\u5f0f\u5408\u6210 \u2014 chunk \u7ea7\u64ad\u653e\u662f\u5206\u6c34\u5cad<\/h3>\n<p>TTS \u9ed8\u8ba4\u662f sentence-level \u5408\u6210\uff1a\u628a\u6574\u53e5\u6587\u5b57\u585e\u7ed9 TTS API\uff0c\u7b49\u8fd4\u56de\u5b8c\u6574\u97f3\u9891\u6587\u4ef6\u540e\u64ad\u653e\u3002\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff1a<\/p>\n<ul>\n<li>LLM \u7b2c\u4e00\u4e2a\u5b57\u5230\u8fbe\uff1at=600ms<\/li>\n<li>\u7b49 LLM \u51fa\u5b8c\u6574\u53e5\uff08&#8221;\u4f60\u597d\u6211\u53eb\u5c0f\u660e\u4eca\u5929\u6765\u9762\u8bd5\u3002&#8221;\uff0c\u5171 12 \u5b57\uff09\uff1at=600 + 12 * 30 = 960ms<\/li>\n<li>TTS \u5408\u6210\u6574\u53e5\u97f3\u9891\uff1at=960 + 280 = 1240ms<\/li>\n<li>\u7528\u6237\u542c\u5230\u7b2c\u4e00\u4e2a\u97f3\uff1at=1240ms<\/li>\n<\/ul>\n<p><strong>chunk \u7ea7\u6d41\u5f0f TTS<\/strong>\uff1a<\/p>\n<p>\u6bcf\u6512\u591f 4-6 \u5b57\uff08\u4e00\u4e2a\u8bed\u97f3\u5355\u5143\uff09\u5c31\u7acb\u523b\u53d1\u7ed9 TTS\uff0c\u8ba9\u5176\u8fd4\u56de\u8be5\u5355\u5143\u7684\u97f3\u9891\u7247\u6bb5\uff0c\u7acb\u523b\u64ad\u653e\u3002\u540c\u65f6\u4e0b\u4e00\u4e2a chunk \u5f02\u6b65\u5408\u6210\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u5f0f<\/th>\n<th>\u9996\u97f3\u5ef6\u8fdf<\/th>\n<th>\u53e5\u95f4\u505c\u987f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>sentence-level\uff08baseline\uff09<\/td>\n<td>1240ms<\/td>\n<td>0ms<\/td>\n<\/tr>\n<tr>\n<td>chunk-level\uff084-6 \u5b57\uff09<\/td>\n<td>980ms<\/td>\n<td>80-120ms<\/td>\n<\/tr>\n<tr>\n<td>chunk-level + \u7f13\u51b2\u6c60<\/td>\n<td>920ms<\/td>\n<td>&lt; 30ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u5173\u952e\u5de5\u7a0b\u70b9<\/strong>\uff1a<\/p>\n<ol>\n<li><strong>chunk \u5207\u5206\u8981\u907f\u514d\u5207\u5230\u8bcd\u4e2d<\/strong>\uff1a\u7528 jieba \u505a\u7c97\u7c92\u5ea6\u5206\u8bcd\uff0c\u6700\u5c0f chunk = 1 \u4e2a\u5b8c\u6574\u8bcd<\/li>\n<li><strong>\u97f3\u9891\u62fc\u63a5\u7684 zero-crossing \u5bf9\u9f50<\/strong>\uff1a\u76f8\u90bb chunk \u8fb9\u754c\u7528\u96f6\u4ea4\u53c9\u70b9\u62fc\u63a5\uff0c\u907f\u514d\u5494\u54d2\u58f0<\/li>\n<li><strong>\u7f13\u51b2\u6c60\u9884\u5408\u6210\u4e0b\u4e00\u53e5<\/strong>\uff1a\u5f53\u524d chunk \u5728\u64ad\u65f6\uff0c\u4e0b\u4e00\u4e2a chunk \u5df2\u7ecf\u5728 TTS \u91cc\u8dd1\u4e86<\/li>\n<\/ol>\n<p>\u4ee3\u7801\u9aa8\u67b6\uff1a<\/p>\n<pre><code class=\"python\">class StreamingTTS:\n    def __init__(self, min_chunk_chars=4):\n        self.buffer = &quot;&quot;\n        self.min_chunk = min_chunk_chars\n    \n    async def feed(self, llm_text_delta: str):\n        self.buffer += llm_text_delta\n        chunk = self.try_extract_chunk()\n        if chunk:\n            audio = await self.synth(chunk)\n            await self.play(audio)\n    \n    def try_extract_chunk(self) -&gt; str | None:\n        if len(self.buffer) &lt; self.min_chunk:\n            return None\n        # \u7528 jieba \u627e\u6700\u8fd1\u7684\u8bcd\u8fb9\u754c\n        words = list(jieba.cut(self.buffer))\n        if len(words) &lt; 2:\n            return None\n        chunk = &quot;&quot;.join(words[:-1])  # \u7559\u6700\u540e\u4e00\u4e2a\u8bcd\u5728 buffer \u91cc\n        self.buffer = words[-1]\n        return chunk<\/code><\/pre>\n<p><strong>\u8e29\u5751<\/strong>\uff1achunk \u592a\u5c0f\uff08&lt; 3 \u5b57\uff09\u4f1a\u8ba9 TTS \u97f5\u5f8b\u5d29\u574f\uff0c\u6bcf\u4e2a chunk \u90fd\u662f\u65ad\u65ad\u7eed\u7eed\u7684&#8221;\u673a\u5668\u97f3&#8221;\u30024-6 \u5b57\u662f\u6d4b\u8bd5\u51fa\u6765\u7684\u751c\u70b9\u3002<\/p>\n<hr>\n<h3>\u4e03\u30015 \u6bb5\u4f18\u5316\u540e\u7684\u5b9e\u6d4b\u6570\u636e<\/h3>\n<p>\u628a\u4e0a\u8ff0 5 \u6bb5\u4f18\u5316\u5168\u90e8\u4e0a\u7ebf\u540e\u7684\u5bf9\u6bd4\uff08\u540c\u4e00\u53f0 GPU \u670d\u52a1\u5668\uff0cgpt-4o\uff0cWhisper-large-v3 \u6d41\u5f0f\uff09\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9636\u6bb5<\/th>\n<th>\u4f18\u5316\u524d<\/th>\n<th>\u4f18\u5316\u540e<\/th>\n<th>\u6536\u76ca<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>VAD \u9759\u97f3\u5224\u5b9a<\/td>\n<td>600ms<\/td>\n<td>80ms<\/td>\n<td>-520ms<\/td>\n<\/tr>\n<tr>\n<td>ASR \u6d41\u5f0f\u9996\u5305<\/td>\n<td>480ms<\/td>\n<td>280ms<\/td>\n<td>-200ms<\/td>\n<\/tr>\n<tr>\n<td>Prompt \u88c5\u914d<\/td>\n<td>320ms<\/td>\n<td>40ms<\/td>\n<td>-280ms<\/td>\n<\/tr>\n<tr>\n<td>LLM \u9996 Token<\/td>\n<td>1240ms<\/td>\n<td>380ms<\/td>\n<td>-860ms<\/td>\n<\/tr>\n<tr>\n<td>TTS \u9996\u5305<\/td>\n<td>280ms<\/td>\n<td>200ms<\/td>\n<td>-80ms<\/td>\n<\/tr>\n<tr>\n<td><strong>\u9996\u5b57\u7b26 P95<\/strong><\/td>\n<td><strong>2920ms<\/strong><\/td>\n<td><strong>980ms<\/strong><\/td>\n<td><strong>-1940ms<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u4eec\u505a\u7684\u5b9e\u65f6\u9762\u8bd5 Copilot\uff08<a href=\"https:\/\/link.segmentfault.com\/?enc=PkMmZVC1VlJW9qBR14CSXw%3D%3D.iaztouFk9D7AJxZsa2igBSO9FEmCwSQ3bU%2FIIZzbqUI%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">\u5373\u7b54\u4fa0<\/a>\uff09\u5c31\u662f\u6309\u8fd9\u5957\u9884\u7b97\u5206\u914d\u505a\u7684\uff0c\u76ee\u524d\u5728\u5496\u5561\u5385 Wi-Fi \u73af\u5883\u4e0b\u9996\u5b57\u7b26 P95 \u7a33\u5b9a\u5728 980ms \u5de6\u53f3\u3002\u8fd9\u5957\u601d\u8def\u9002\u7528\u4e8e\u4efb\u4f55\u5b9e\u65f6 AI \u5bf9\u8bdd\u573a\u666f\uff1a\u5ba2\u670d bot\u3001\u8f66\u673a\u52a9\u624b\u3001\u76f4\u64ad\u7ffb\u8bd1\u3001\u8fdc\u7a0b\u8f85\u52a9\u7b49\u3002<\/p>\n<hr>\n<h3>\u516b\u3001\u76d1\u63a7\u57cb\u70b9\u5fc5\u987b\u6309\u6bb5\u62c6<\/h3>\n<p>\u5ef6\u8fdf\u5206\u6bb5\u4f18\u5316\u540e\uff0c\u76d1\u63a7\u6307\u6807\u4e5f\u5fc5\u987b\u6309\u6bb5\u62c6\u3002\u4e00\u4e2a\u5e38\u89c1\u9519\u8bef\u662f\u53ea\u76d1\u63a7\u7aef\u5230\u7aef\u5ef6\u8fdf\uff0c\u5bfc\u81f4\u67d0\u6bb5\u6084\u6084\u9000\u5316\u4e5f\u6ca1\u4eba\u53d1\u73b0\u3002<\/p>\n<p><strong>\u57cb\u70b9\u8bbe\u8ba1<\/strong>\uff1a<\/p>\n<pre><code class=\"python\">@dataclass\nclass LatencyTrace:\n    request_id: str\n    vad_ms: float       # \u7528\u6237\u505c\u8bf4\u8bdd \u2192 VAD \u89e6\u53d1\n    asr_partial_ms: float  # \u7528\u6237\u5f00\u53e3 \u2192 \u5c4f\u5e55\u9996\u5b57\n    asr_final_ms: float    # VAD \u89e6\u53d1 \u2192 final \u5b8c\u6210\n    prompt_assemble_ms: float\n    llm_first_token_ms: float\n    tts_first_chunk_ms: float\n    e2e_first_char_ms: float<\/code><\/pre>\n<p><strong>\u544a\u8b66\u9608\u503c<\/strong>\uff08\u57fa\u4e8e P95\uff09\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6bb5<\/th>\n<th>\u9ec4\u7ebf<\/th>\n<th>\u7ea2\u7ebf<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>vad_ms<\/td>\n<td>150<\/td>\n<td>250<\/td>\n<\/tr>\n<tr>\n<td>asr_partial_ms<\/td>\n<td>350<\/td>\n<td>500<\/td>\n<\/tr>\n<tr>\n<td>prompt_assemble_ms<\/td>\n<td>80<\/td>\n<td>150<\/td>\n<\/tr>\n<tr>\n<td>llm_first_token_ms<\/td>\n<td>500<\/td>\n<td>800<\/td>\n<\/tr>\n<tr>\n<td>tts_first_chunk_ms<\/td>\n<td>280<\/td>\n<td>400<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4efb\u610f\u4e00\u6bb5\u7ea2\u7ebf\u89e6\u53d1\u5c31\u7acb\u523b\u544a\u8b66 + \u964d\u7ea7\u3002<strong>\u4e0d\u8981\u7b49\u7aef\u5230\u7aef P95 \u7ea2\u7ebf<\/strong>\uff0c\u90a3\u65f6\u5019\u7528\u6237\u5df2\u7ecf\u6d41\u5931\u3002<\/p>\n<hr>\n<h3>\u4e5d\u30015 \u4e2a\u53cd\u76f4\u89c9\u7684\u5de5\u7a0b\u7ec6\u8282<\/h3>\n<ol>\n<li><strong>partial ASR \u548c final ASR \u7684 encoder \u5fc5\u987b\u5171\u4eab\u72b6\u6001<\/strong>\uff0c\u5426\u5219 final \u4f1a\u91cd\u65b0\u7b97\u4e00\u904d\u7279\u5f81\uff0c\u591a\u82b1 60-80ms<\/li>\n<li><strong>prompt \u88c5\u914d\u7684 warm_up \u5fc5\u987b\u7528 partial \u6587\u672c<\/strong>\uff0c\u7b49 final \u51fa\u6765\u518d\u5f00\u59cb\u5c31\u665a\u4e86 200-300ms<\/li>\n<li><strong>LLM \u7684 stream chunk \u5927\u5c0f\u7531 server \u63a7\u5236<\/strong>\uff0cclient \u6ca1\u6cd5\u8c03\uff1b\u4f46\u53ef\u4ee5\u9009 server \u7aef\u5f00\u4e86 <code>aggregated_chunk=False<\/code> \u7684\u670d\u52a1\u5546<\/li>\n<li><strong>TTS chunk \u5207\u5206\u7528 jieba \u7c97\u7c92\u5ea6\u800c\u4e0d\u662f\u5b57\u7b26<\/strong>\uff0c\u907f\u514d\u5207\u5230&#8221;\u4eca\u5929\/\u6709\u70b9\/\u7d2f&#8221;\u4e2d\u95f4\u5f62\u6210&#8221;\u4eca\u5929\u6709\/\u70b9\u7d2f&#8221;<\/li>\n<li><strong>VAD \u89e6\u53d1\u540e\u7acb\u523b\u7ed9 UI \u4e00\u4e2a&#8221;\u601d\u8003\u4e2d&#8221;\u4fe1\u53f7<\/strong>\uff0c\u63a9\u76d6\u6700\u540e 100-200ms \u4e0d\u53ef\u907f\u514d\u7684\u5ef6\u8fdf<\/li>\n<\/ol>\n<hr>\n<h3>\u5341\u3001\u5e38\u89c1\u95ee\u9898 FAQ<\/h3>\n<p><strong>Q1\uff1a5 \u6bb5\u9884\u7b97\u5206\u914d\u662f\u56fa\u5b9a\u7684\u5417\uff1f\u4e1a\u52a1\u573a\u666f\u4e0d\u4e00\u6837\u80fd\u8c03\u6574\u5417\uff1f<\/strong><\/p>\n<p>A\uff1a\u53ef\u4ee5\u8c03\u6574\uff0c\u539f\u5219\u662f&#8221;\u7ed9\u6700\u8d35\u7684\u90a3\u6bb5\u5206\u6700\u5927\u9884\u7b97&#8221;\u3002\u6bd4\u5982\u8f66\u673a\u573a\u666f ASR \u566a\u97f3\u5927\u9700\u8981\u66f4\u957f windowing\uff0c\u53ef\u4ee5\u628a ASR partial \u7ed9\u5230 400ms\uff0c\u4ece LLM \u9996 Token \u90a3\u6bb5\u62a0\u3002\u4f46\u603b\u9884\u7b97 1200ms \u662f\u7528\u6237\u611f\u77e5\u786c\u7ebf\uff0c\u4e0d\u80fd\u7a81\u7834\u3002<\/p>\n<p><strong>Q2\uff1a\u7528\u4e86 stream \u8fd8\u9700\u8981\u505a prompt \u538b\u7f29\u5417\uff1fstream \u4e0d\u662f\u5df2\u7ecf\u6d41\u5f0f\u8f93\u51fa\u4e86\uff1f<\/strong><\/p>\n<p>A\uff1a\u5fc5\u987b\u505a\u3002stream \u89e3\u51b3\u7684\u662f&#8221;\u8f93\u51fa\u5b8c\u6210\u65f6\u95f4&#8221;\uff0c\u4e0d\u662f&#8221;\u9996 Token \u65f6\u95f4&#8221;\u3002\u9996 Token \u662f prefill \u9636\u6bb5\u8f93\u51fa\uff0cprefill \u65f6\u95f4\u548c prompt \u957f\u5ea6\u5f3a\u76f8\u5173\u300232K \u4e0a\u4e0b\u6587 prefill 1.2s \u662f stream \u4e5f\u6551\u4e0d\u56de\u6765\u7684\u3002<\/p>\n<p><strong>Q3\uff1awebrtcvad \u80fd\u6362\u66f4\u51c6\u7684 silero-vad \u5417\uff1f\u5ef6\u8fdf\u4f1a\u4e0d\u4f1a\u66f4\u957f\uff1f<\/strong><\/p>\n<p>A\uff1asilero-vad \u63a8\u7406\u672c\u8eab\u6bd4 webrtcvad \u6162 30-50ms\uff08GPU \u4e0a\u66f4\u660e\u663e\uff09\uff0c\u4f46\u53ec\u56de\u7387\u9ad8 8%\u3002\u7ebf\u4e0a trade-off \u662f\uff1a\u9ad8\u541e\u5410\u573a\u666f\u7528 webrtcvad\uff08CPU 30ms \u5185\u641e\u5b9a\uff09\uff0c\u4f4e\u566a\u97f3 + \u9ad8\u51c6\u786e\u7387\u573a\u666f\u7528 silero-vad\u3002\u6df7\u5408\u7b56\u7565\u4e5f\u53ef\u4ee5\u2014\u2014\u7528 webrtcvad \u7b2c\u4e00\u9053\u7b5b\uff0csilero-vad \u7b2c\u4e8c\u9053\u7cbe\u5224\u3002<\/p>\n<p><strong>Q4\uff1apartial \/ final \u53cc\u8f68\u4f1a\u4e0d\u4f1a\u8ba9\u63a8\u7406\u6210\u672c\u7ffb\u500d\uff1f<\/strong><\/p>\n<p>A\uff1apartial \u7528 1\/3 \u53c2\u6570\u91cf\u7684\u8f7b\u91cf\u6a21\u578b\uff0c\u5355\u6761\u8bf7\u6c42 GPU \u5360\u7528\u7ea6 partial \u662f final \u7684 35%\u3002\u4e24\u8f68\u5e76\u884c\u603b\u6210\u672c\u7ea6\u4e3a\u5355\u8f68\u7684 1.35 \u500d\uff0c\u4e0d\u662f 2 \u500d\u3002\u4f46\u5ef6\u8fdf\u6536\u76ca\u662f 200ms+\uff0c\u8fdc\u8d85\u6210\u672c\u3002<\/p>\n<p><strong>Q5\uff1aTTS chunk-level \u5408\u6210\u4f1a\u4e0d\u4f1a\u8ba9\u97f5\u5f8b\u53d8\u5dee\uff1f\u7528\u6237\u80fd\u542c\u51fa\u6765\uff1f<\/strong><\/p>\n<p>A\uff1a4-6 \u5b57 chunk \u5728\u4e2d\u6587\u573a\u666f\u4eba\u8033\u51e0\u4e4e\u542c\u4e0d\u51fa\u5dee\u5f02\uff08\u56e0\u4e3a\u4e2d\u6587\u672c\u8eab\u662f\u5355\u97f3\u8282\u9a71\u52a8\uff09\u3002\u82f1\u6587\u573a\u666f\u5c31\u8981\u8c28\u614e\uff0c\u82f1\u6587\u9700\u8981 phrase-level\uff088-12 \u8bcd\uff09\u624d\u4e0d\u4f1a\u542c\u8d77\u6765\u65ad\u3002\u4e2d\u6587 TTS \u56e2\u961f\u6709\u66f4\u6fc0\u8fdb\u7684\u65b9\u6848\u662f 2-3 \u5b57 chunk + \u97f5\u5f8b\u9884\u6d4b\u6a21\u578b\u8865\u5168\uff0c\u80fd\u538b\u5230 600ms \u9996\u97f3\u4f46\u5de5\u7a0b\u590d\u6742\u5ea6\u5927\u3002<\/p>\n<p><strong>Q6\uff1aPrompt \u538b\u7f29\u5230 4K \u4f1a\u4e0d\u4f1a\u4e22\u4fe1\u606f\uff1f<\/strong><\/p>\n<p>A\uff1a\u7528 KFE\uff08\u5173\u952e\u4e8b\u5b9e\u62bd\u53d6\uff09+ MMR \u53bb\u91cd\u7684\u8bdd\uff0c4K \u901a\u5e38\u80fd\u4fdd\u7559 92-95% \u7684\u5173\u952e\u4fe1\u606f\u3002\u6211\u4eec\u7ebf\u4e0b\u8bc4\u6d4b\u8fc7\uff1a4K \u538b\u7f29\u540e\u56de\u7b54\u8d28\u91cf\u5206\uff08\u4eba\u5de5\u8bc4\u6d4b\uff09\u4ece baseline 4.6 \u964d\u5230 4.4\uff0c\u4f46\u7528\u6237\u6ee1\u610f\u5ea6\u4ece 78% \u5347\u5230 89%\uff08\u56e0\u4e3a\u4e0d\u5361\u4e86\uff09\u3002\u5ef6\u8fdf\u6536\u76ca\u5b8c\u5168\u538b\u8fc7\u8d28\u91cf\u635f\u5931\u3002<\/p>\n<p><strong>Q7\uff1aLLM \u9996 Token \u4f18\u5316\u505a\u5b8c\u4e86\uff0c\u6574\u4f53\u5e73\u5747\u5ef6\u8fdf\u8fd8\u662f\u9ad8\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p>A\uff1a\u770b P50 \u8fd8\u662f P95\u3002\u5982\u679c P95 \u9ad8 P50 \u6b63\u5e38\uff0c\u5c31\u662f\u957f\u5c3e\u95ee\u9898\uff0c\u5e38\u89c1\u539f\u56e0\u662f KV cache \u6ee1 + cold start\u3002\u89e3\u51b3\u65b9\u6848\uff1a\u5e38\u9a7b\u70ed\u70b9 prompt \u7684 KV\u3001\u9884\u5206\u914d batch slot\u3001\u628a\u8d85 P95 \u7684\u8bf7\u6c42\u8def\u7531\u5230\u72ec\u7acb pool\u3002<\/p>\n<hr>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u5b9e\u65f6 AI \u5bf9\u8bdd\u5ef6\u8fdf\u4f18\u5316\u7684\u6838\u5fc3\u601d\u8def\uff1a<\/p>\n<ol>\n<li><strong>\u4ece SLO \u53cd\u63a8\u67b6\u6784<\/strong>\uff1a\u5148\u5b9a\u9996\u5b57\u7b26 P95 \u2264 1.2s\uff0c\u518d\u5206\u6bb5\u505a\u9884\u7b97<\/li>\n<li><strong>5 \u6bb5\u72ec\u7acb\u4f18\u5316<\/strong>\uff1aVAD \/ ASR \/ Prompt \/ LLM \/ TTS \u90fd\u6709\u5404\u81ea\u7684\u4f18\u5316\u8def\u5f84<\/li>\n<li><strong>\u76d1\u63a7\u6309\u6bb5\u62c6<\/strong>\uff1a\u7aef\u5230\u7aef P95 \u662f\u7ed3\u679c\u6307\u6807\uff0c\u5206\u6bb5 P95 \u624d\u662f\u8bca\u65ad\u6307\u6807<\/li>\n<li><strong>\u53cd\u76f4\u89c9\u7ec6\u8282\u591a<\/strong>\uff1apartial\/final \u53cc\u8f68\u3001chunk TTS\u3001prompt warm_up\uff0c\u6bcf\u4e2a\u7ec6\u8282\u90fd\u503c 100ms+<\/li>\n<\/ol>\n<p>\u628a\u8fd9\u5957\u9884\u7b97+\u76d1\u63a7\u505a\u5b8c\u540e\uff0c\u4f60\u4f1a\u53d1\u73b0&#8221;\u6362\u6a21\u578b\/\u6362\u670d\u52a1\u5546&#8221;\u53cd\u800c\u662f\u6700\u540e\u624d\u8003\u8651\u7684\u4f18\u5316\u8def\u5f84\u2014\u2014\u524d\u9762\u7684\u5de5\u7a0b\u4f18\u5316\u80fd\u69a8\u51fa 1.5-2 \u79d2\uff0c\u8fdc\u6bd4\u6362\u786c\u4ef6\u6765\u5f97\u5212\u7b97\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000047734796\">https:\/\/segmentfault.com\/a\/1190000047734796<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u65f6 AI Copilot \u7aef\u5230\u7aef\u5ef6\u8fdf\u9884\u7b97\u5206\u914d\uff1a\u4ece SLO \u53cd\u63a8 5 \u6bb5\u94fe\u8def\u8fb9\u754c\uff08\u542b\u5e76\u884c\u4f18\u5316\u8def\u5f84 + \u5b9e\u6d4b\u6570\u636e [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10021351","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10021351"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021351\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10021351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10021351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10021351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}