<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s]]></title><description><![CDATA[<p dir="auto">4080s 32G推出以来，一直广受关注。全新显卡的价格也从8500一路上涨到目前的1.1w，也多次被老特在视频中推荐。相比较两万多的5090，4080s的价格非常亲民，32G显存也刚好处在小模型的甜点。<br />
虽然关注度很高，但是论坛里一直没有相关的帖子。经过一段时间的折腾，目前总算跑到了一个性能，速度都还满意的配置。下面简单介绍一下我的配置，以及为什么需要这样配，给网友们提供一些思路和避坑指南。<br />
再说说我的工作环境与需求：题主主要用AI来做本地知识库的整理以及辅助完成工作中的编程任务，主要工具是claude code。众所周知，claude对上下文长度要求很高，用deepseek v4 flash，几轮对话之后，上下文长度经常在400k以上，因此，上下文长度对于题主来说是刚需，128k以下长度可能无法坚持一轮对话。生成速度方面，ollama默认配置下，27b模型在4080s上速度大概33tokens/s，虽然还算可观，但是对于长编程而言还是有点慢了，50tokens/s以上属于可以接受的范畴。部署工具方面，ollama，lamma.cpp，vllm等工具对比下来，在长上下文场景下，无疑vllm是最优秀的，稳定性也是这几个工具中最好的，通过细致的参数，可以最大化的利用显卡性能。<br />
因此，考虑到隐私性需求，综合考虑上下文长度，速度等方面因素，最终选择了量化版本的Qwen27b模型。经过几轮调优，单用户在4080s下最终达到了60tokens/s的峰值速度，256k上下文对于小型项目而言基本足够。<br />
最终模型选取了cyankiwi/Qwen3.6-27B-AWQ-INT4，这是一个很热门的Q4量化的版本，AWQ格式对于vllm来说性能也更优。</p>
<h2>搭建流程如下：</h2>
<ol>
<li>
<p dir="auto">vLLM安装</p>
<pre><code>uv venv 
source .venv/bin/activate 
uv pip install -U vllm --torch-backend=auto
</code></pre>
</li>
<li>
<p dir="auto">huggingface下载模型</p>
<pre><code>source .venv/bin/activate 
hf download cyankiwi/Qwen3.6-27B-AWQ-INT4 --local-dir ./qwen3.6-27b-awq-agent
</code></pre>
</li>
<li>
<p dir="auto">启动模型</p>
<pre><code>#!/bin/bash
# ============================================================
#  vLLM 启动脚本 — Qwen3.6 27B AWQ Int4 【满血均衡版】
#  核心策略: 显式 AWQ 量化 + 256K上下文 + 极速 CUDA 计算图 + MTP加速
# ============================================================

# ---- 底层防碎片化，为 CUDA Graphs 预留纯净空间 ----
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

exec /your/path/vllm-venv/.venv/bin/python3 -m vllm.entrypoints.openai.api_server \
--model /your/path/qwen3.6-27b-awq-int4 \
--served-model-name qwen3-27b \
--host 0.0.0.0 \
--port 11435 \
\
`# ---- 1. 空间折叠与防 OOM 护城河 ----` \
--kv-cache-dtype fp8 \
--gpu-memory-utilization 0.97 \
--max-model-len 262144 \
--max-num-seqs 1 \
\
`# ---- 2. 前端防超时调度 (解决 Timeout 痛点) ----` \
--enable-chunked-prefill \
--max-num-batched-tokens 3072 \
--scheduling-policy priority \
\
`# ---- 3. Agent 解析器与缓存外挂 ----` \
--language-model-only \
--enable-auto-tool-choice \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder \
--enable-prefix-caching \
\
`# ---- 4. 引擎加速 (不再受限于 Eager 模式) ----` \
--max-cudagraph-capture-size 128 \
--no-enable-log-requests \
--speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}'
</code></pre>
</li>
<li>
<p dir="auto">添加守护进程<br />
创建守护进程脚本:  <code>sudo nano /etc/systemd/system/vllm.service</code><br />
粘贴下面的内容:</p>
<pre><code> [Unit]
 Description=vLLM Qwen3.6 27B API Server (FP8 256K Version)
 After=network.target
 
 [Service]
 User=youruser
 Group=yourgroup
 WorkingDirectory=/your/path
 Restart=always
 RestartSec=10
 # 使用 -lc 参数（Login Command），让系统先加载你的终端环境变量，再去执行脚本！
 ExecStart=/bin/bash -lc '/your/path/vllm-start.sh'
</code></pre>
<p dir="auto">创建守护进程实现开机自启:</p>
<pre><code>sudo systemctl daemon-reload
sudo systemctl enable vllm
sudo systemctl start vllm
</code></pre>
<p dir="auto">启动后查看vllm日志:</p>
<pre><code>journalctl -u vllm.service -f
</code></pre>
</li>
</ol>
]]></description><link>https://lcz.me/topic/584/claude-code方案-4080s-32g-vllm-qwen27b-256k-mtp部署-60tokens-s</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 12:08:33 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/584.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Jun 2026 14:07:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Sun, 21 Jun 2026 14:55:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/demo" aria-label="Profile: demo">@<bdi>demo</bdi></a> 直接用我的参数，vllm用最新版本，AWQ-INT4量化模型，kv-cache开fp8，MTP也开启，256K上下文毫无问题。60tps是单线程的速度。但是用了几天后，相比较fp8量化模型，AWQ-INT4感觉还是有些轻微的降智，今天切换到llama+Q6_K了，上下文稍微少一些，只能开到240k，总体上也够用了。单线程速度50tps，coding效果还没测试，理论上应该比INT4好一点</p>
]]></description><link>https://lcz.me/post/7710</link><guid isPermaLink="true">https://lcz.me/post/7710</guid><dc:creator><![CDATA[aspro]]></dc:creator><pubDate>Sun, 21 Jun 2026 14:55:26 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Thu, 18 Jun 2026 19:04:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/demo" aria-label="Profile: demo">@<bdi>demo</bdi></a> 关于128K上下文突破不了的问题，我看了你的启动参数，有几个建议：</p>
<ol>
<li>
<p dir="auto"><strong><code>gpu-memory-utilization 0.93</code> 对于 GPTQ Int4 + 128K context 可能不够。</strong> 4080S 32G 跑 Qwen3.6-27B GPTQ Int4（约16-18G）加上 128K 的 KV cache（fp8_e4m3 约 4-5G），总共需要 20-23G。0.93 利用率实际可用约 29.8G，按理说够。但关键问题是：</p>
</li>
<li>
<p dir="auto"><strong><code>kv-cache-dtype fp8</code> 对 4080S (Ada Lovelace) 来说，fp8 不是原生支持最快的格式。</strong> Ada 架构的 fp8 支持比 Hopper (4090/5090) 差。建议试下 <code>--kv-cache-dtype fp8_e4m3</code> 显式指定格式，或者干脆用 <code>--kv-cache-dtype auto</code> 让 vLLM 自己选。</p>
</li>
<li>
<p dir="auto"><strong>真正的瓶颈应该是 <code>max-model-len 131072</code> + MTP 同时开启。</strong> MTP（Multi-Token Prediction）模型在做 speculative decoding 时需要同时加载 draft model 的 KV cache，会让显存占用突然暴涨。试下先用 <code>--speculative-model None</code> 关掉 MTP 确认能不能跑 128K，如果能跑再逐步加 MTP 参数。</p>
</li>
<li>
<p dir="auto"><strong>检查 tensor_parallel 设置。</strong> 单卡 4080S 不需要 TP，确保没开 <code>--tensor-parallel-size</code>。</p>
</li>
<li>
<p dir="auto">你说的 60t/s 是单线程（streaming）速度，并发下因为 KV cache 共享会有明显下降。那个数字是单用户单请求的峰值。</p>
</li>
</ol>
<p dir="auto">建议先试：<code>--kv-cache-dtype auto --speculative-model None --max-model-len 131072 --gpu-memory-utilization 0.95</code></p>
]]></description><link>https://lcz.me/post/7376</link><guid isPermaLink="true">https://lcz.me/post/7376</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Thu, 18 Jun 2026 19:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Thu, 18 Jun 2026 02:03:28 GMT]]></title><description><![CDATA[<p dir="auto">我也是4080S32G用户，但我是小白，在hermes中让deepseek flash调试了很久，其中不断把启动参数发给豆包和gemini三方博弈，还是突破不了128K上下文。兄弟你测试的60tokens/s的峰值速度是单线程还是并发的数据呢？<br />
我也列一下我的启动参数和测试数据<br />
#!/bin/bash<br />
# 启动 vLLM 服务 - Qwen3.6-27B GPTQ Int4 @ 128K context + MTP + Prefix Caching<br />
# 端口 8000</p>
<pre><code> source ~/vllm-workspace/venv/bin/activate
 
 MODEL_DIR=/home/demo/Qwen3.6-27B-uncensored-heretic-v2-Native-MTP-Preserved-GPTQ-Int4
 CHAT_TEMPLATE=~/vllm-workspace/buun_chat_template.jinja
 
 export VLLM_USE_FLASHINFER_SAMPLER=1
 export CUDA_HOME=/usr/local/cuda-13.0
 export PATH=$CUDA_HOME/bin:$PATH
 export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
 
 exec vllm serve "$MODEL_DIR" \
     --port 8000 \
     --host 127.0.0.1 \
     --max-model-len 131072 \
     --dtype auto \
     --gpu-memory-utilization 0.93 \
     --kv-cache-dtype fp8 \
     --compilation-config '{"cudagraph_capture_sizes": [1, 2, 4], "cudagraph_mode": "PIECEWISE"}' \
     --enable-chunked-prefill \
     --max-num-batched-tokens 3072 \
     --chat-template "$CHAT_TEMPLATE" \
     --trust-remote-code \
     --enable-auto-tool-choice \
     --tool-call-parser hermes \
     --limit-mm-per-prompt '{"image":1}' \
     --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}' \
     --enable-prefix-caching \
     --served-model-name Qwen3.6-27B-GPTQ-Int4
</code></pre>
<p dir="auto">让deepseek做的压力测试脚本数据：<br />
压测结果：Qwen3.6-27B-GPTQ-Int4</p>
<pre><code>    单线程
    | 轮次 | tokens | 耗时   | tok/s |
    |------|--------|--------|-------|
    | #1   | 1024   | 22.65s | 45.2  |
    | #2   | 1024   | 23.26s | 44.0  |
    | #3   | 1024   | 23.10s | 44.3  |
    | 平均 | 1024   | 23.00s | 44.5  |
    
    并发压测
    | 并发数 | 墙钟耗时 | 总产出   | 吞吐量(tok/s) | 单请求平均 |
    |--------|----------|----------|---------------|------------|
    | 2路    | 37.56s   | 2048 tok | 54.5          | 27.5 tok/s |
    | 4路    | 49.74s   | 4096 tok | 82.4          | 20.9 tok/s |
    | 8路    | 41.86s   | 8192 tok | 195.7 🚀      | 25.1 tok/s |
    
    关键结论
    
    1. 单线程 44.5 tok/s — 稳定，MTP + FlashInfer 效果不错
    2. 并发吞吐线性增长 — 2路 54.5 → 4路 82.4 → 8路 195.7 tok/s
    3. 8路反而比4路快 — 41.86s vs 49.74s 🤔 可能因为 batch 大了，MTP speculative decoding 的 acceptance rate 更高，vLLM 调度器在更大 batch 下更高效
    4. 单请求延迟 — 并发下每请求约 20-27 tok/s，比单线程慢一半，但总吞吐翻了 4 倍
</code></pre>
]]></description><link>https://lcz.me/post/7250</link><guid isPermaLink="true">https://lcz.me/post/7250</guid><dc:creator><![CDATA[demo]]></dc:creator><pubDate>Thu, 18 Jun 2026 02:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Thu, 18 Jun 2026 01:24:57 GMT]]></title><description><![CDATA[<p dir="auto">今天又用上这个模型了:qwen3.6-27b-gguf/Qwen3.6-27B-MTP-IMAT-IQ4_XS-Q8nextn.gguf<br />
确实是省内存的啊,现在测试用高一档的 kv cache<br />
--cache-type-k kvarn5 <br />
--cache-type-v kvarn5 <br />
又跑了一下文学测试,它还是选红楼梦第三回, 感觉有可能这个模型能记得的最详细的就是这一回.<br />
<img src="https://upload.lcz.me/uploads/860709ad-0b28-4702-88e7-632ae2ebcb78.jpeg" alt="19417a40-1c5c-4a3d-adaa-3bf647451784-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/7241</link><guid isPermaLink="true">https://lcz.me/post/7241</guid><dc:creator><![CDATA[stxpnet]]></dc:creator><pubDate>Thu, 18 Jun 2026 01:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Wed, 17 Jun 2026 03:30:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kop-wang" aria-label="Profile: kop-wang">@<bdi>kop-wang</bdi></a></p>
<p dir="auto">Q4KM跟IQ4XS是甜蜜點</p>
<p dir="auto">而且最近好像也有MoQ (Mixture of Quantization)的模型了</p>
]]></description><link>https://lcz.me/post/7162</link><guid isPermaLink="true">https://lcz.me/post/7162</guid><dc:creator><![CDATA[566656661]]></dc:creator><pubDate>Wed, 17 Jun 2026 03:30:20 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Wed, 17 Jun 2026 03:10:30 GMT]]></title><description><![CDATA[<p dir="auto">对于量化的“困惑度”，其实unsloth的这张图我觉得更直观（y轴是对数坐标系）。<br />
<img src="https://upload.lcz.me/uploads/38bd1322-a063-4cac-9f8e-192c8a54f02c.jpeg" alt="8b5ffe4b-f6e7-4c99-bfe7-190ee716a794-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/7160</link><guid isPermaLink="true">https://lcz.me/post/7160</guid><dc:creator><![CDATA[kop wang]]></dc:creator><pubDate>Wed, 17 Jun 2026 03:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Tue, 16 Jun 2026 17:13:13 GMT]]></title><description><![CDATA[<p dir="auto">你能买到没坏的卡，就是幸运了，这玩意中招的人不少，能用它就是神卡。</p>
]]></description><link>https://lcz.me/post/7115</link><guid isPermaLink="true">https://lcz.me/post/7115</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 16 Jun 2026 17:13:13 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Tue, 16 Jun 2026 14:59:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/aspro" aria-label="Profile: aspro">@<bdi>aspro</bdi></a></p>
<p dir="auto"><a href="https://vllm.ai/blog/2026-05-11-turboquant" rel="nofollow ugc">vllm官方自己有測試過</a>, tq 4bitnc以下算是斷崖式下降吧, 喜歡折騰就可以試試看</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/164f6c9c-1980-408a-bd96-aef500b5a336.jpeg" alt="428f06dc-0dc5-4fac-be2a-61eca63f4da6-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/7090</link><guid isPermaLink="true">https://lcz.me/post/7090</guid><dc:creator><![CDATA[566656661]]></dc:creator><pubDate>Tue, 16 Jun 2026 14:59:23 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Tue, 16 Jun 2026 14:54:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/566656661" aria-label="Profile: 566656661">@<bdi>566656661</bdi></a>  TurboQuant 4-bit KV Cache会不会影响模型的智力呢？尝试配置过，启动报错就放弃了</p>
]]></description><link>https://lcz.me/post/7089</link><guid isPermaLink="true">https://lcz.me/post/7089</guid><dc:creator><![CDATA[aspro]]></dc:creator><pubDate>Tue, 16 Jun 2026 14:54:41 GMT</pubDate></item><item><title><![CDATA[Reply to Claude Code方案：4080s 32G + vLLM + Qwen27b 256K MTP部署 60tokens&#x2F;s on Tue, 16 Jun 2026 14:37:38 GMT]]></title><description><![CDATA[<p dir="auto">辛苦了, up這個配置也很接近我目前工作正在用的配置了</p>
<p dir="auto">如果想再更進一步可以考慮試試Autoround + TurboQuant 4-bit KV Cache, kv cache會比FP8再少一半</p>
]]></description><link>https://lcz.me/post/7086</link><guid isPermaLink="true">https://lcz.me/post/7086</guid><dc:creator><![CDATA[566656661]]></dc:creator><pubDate>Tue, 16 Jun 2026 14:37:38 GMT</pubDate></item></channel></rss>