@yibie: 本地模型做主力编码工具:2026 年中的实战报告 Hacker News 上有一个帖子,标题很直接:"有人用本地模型做主力编码工具吗?" 197 条评论,信息密度极高。十几个真实用户在讨论他们每天用的配置、踩过的坑、以及为什么明明知道本地…
摘要
本文总结了Hacker News讨论中关于使用本地模型(主要是Qwen 3.6 35B-A3B)作为主力编码工具的实战经验,包括配置、效果(约为前沿模型的50-75%)、关键技巧(如preserve_thinking)和不同用户的立场。
查看缓存全文
缓存时间: 2026/06/18 14:16
本地模型做主力编码工具:2026 年中的实战报告
Hacker News 上有一个帖子,标题很直接:“有人用本地模型做主力编码工具吗?”
197 条评论,信息密度极高。十几个真实用户在讨论他们每天用的配置、踩过的坑、以及为什么明明知道本地模型不如 Claude,还是选择用它。
我结合了 Vicki Boykis 的本地模型实测文章、llama.cpp 作者 Georgi Gerganov 的 HN 评论,以及这场讨论里最高质量的几条回复,整理成一份 2026 年年中的本地 Agent 编码实战报告。
一、共识配置
如果你现在想搭一套本地 agentic coding 环境,HN 讨论里的压倒性共识是这样的:
模型:Qwen 3.6 35B-A3B。35B 总参数,但 MoE 架构只激活 3B。所有人的评价出奇一致——它是“甜蜜点“(sweet spot)。速度够快(55 tok/s),编码能力够用。
推理引擎:llama.cpp。没有争议。
Agent 框架:Pi(http://pi.dev)。同样没有争议。Gerganov 自己用 pi -nc –offline 的极简配置;其他人在 Docker 容器里跑 Pi,限制文件系统权限。缺点是 Pi 不支持 plan mode、subagent、MCP client——但似乎没人抱怨。
量化:Q8。有人试过更激进的量化(Q4),反馈是“loop 和编辑错误显著增加“。KV cache 的建议是 F16 K + Q8 V。
硬件:Mac Studio 128GB 或 Strix Halo 128GB 统一内存笔记本。或者 RTX 5090。核心约束是显存/统一内存——需要装下模型 + KV cache。
Boykis 的完整配置:Pi + LM Studio(推理服务器)+ Docker 容器 + Gemma-4-26b-a4b 或 gemma-4-12b-qat。她在博客里贴了完整的 models.json、Dockerfile 和 docker-compose.yml。
二、效果到底怎么样?
所有人都是诚实的。没有人说本地模型比 Claude 好。
最清晰的对比如下:
“把 Qwen 3.6 35B 比作一个什么都知道一点的初级工程师,你需要引导他。Claude Opus 是一个能跟你一起想架构的资深工程师。如果 Opus 给你 15 倍加速,本地 Qwen 给你 5 倍加速。考虑到它完全免费,这仍然让我觉得不可思议。”
5 倍加速 vs 15 倍加速。差距真实存在,但 5 倍也不是零。
另一个用户的量化指标:本地模型做 agentic coding 的效果约为前沿模型的 75%。 六个月前这个数字可能不到 30%。
Gerganov 说他过去一个半月几乎每天都在用——处理 llama.cpp 仓库里的小任务,算不上震撼,但“对于一个维护者来说绝对是有用的工具“。他的配置极其克制:pi 剥掉一切 + 一个短 system prompt。
三、关键的坑和修复
- 你需要比用 Claude 时更精确地写 prompt
“你真的需要知道自己在问什么,并且精准。任何留给它自己决定的假设,它都会选最容易的路走到目标——比如把所有 CSS 塞进 HTML 里。它在架构上不会帮你多想。”
- Loop 问题——量化级别是关键
“我发现用更好的量化,比如 Q8,即使运行稍慢,总体上也是省时间的——少了大量无效的重试和编辑错误。”
一个用户提到,27B 版本比 35B 更慢但更准确,loop 更少。“wall clock time 才是我关心的指标,不是 tokens/sec。”
- preserve_thinking:Qwen 3.6 的杀手功能
这是讨论里最有技术深度的一条线索。
本地模型做 agentic coding 时,一个常见的性能问题是每轮对话都要重新处理整个上下文。原因是大多数模型的 Jinja template 在每轮对话结束时丢弃了上一轮的推理过程。Qwen 3.6 是第一个同时训练了“保留推理“和“不保留推理“两种模式的模型——你可以通过设置 preserve_thinking: true 来启用。
chat-template-kwargs = {“preserve_thinking”: true}
这个设置的作用是让 KV cache 在跨轮对话时保持有效,避免每次都从头重算整个上下文。对于长 agentic 工作流,这是巨大的加速。
四、为什么要受这个罪?
讨论里出现了两种立场:
隐私/原则派:一位为欧盟组织工作的开发者说,他的组织还没有明确的 AI 使用指南。他看见同事把源代码直接贴进 Claude,但他坚持不用。“我知道运行在我本地、离线的 Pi 容器沙箱里的任何东西都不可能离开这台机器,因此不可能导致数据泄露。我为了心安这么做。”
成本派:有人算了账。“我可以用 Gemini 3 Flash 跑 8 年,花的钱还不到一台 Mac Studio 128GB。”
有人反驳:“但你买 Mac Studio 不光是跑 LLM。你本来就要升级电脑。而且 Gemini 订阅就是 Gemini 订阅,电脑能做其他事。”
AI 怀疑论者:一个自称“AI 怀疑论者“的用户说他不是不用 AI——他是在测试各种模型的边界,探测它们的强项和弱点。“我不是拒绝工具。我是拒绝失去理解。“这句话和 Karpathy 引用过的那句“你可以外包思考,但不能外包理解“形成了奇妙的对话。
另一位用户把争论总结为一个比喻:
“有人是电饭煲怀疑论者。有人喜欢用电饭煲,有人不喜欢。这不代表谁对谁错。”
五、可操作的起步配置
如果你现在想试,这是 HN 讨论 + Boykis + Gerganov 综合出的最短路径:
硬件:Mac 64GB+ 统一内存(M2/M3/M4 都可以)
软件栈:装 llama.cpp(或用 LM Studio 替代),下载 Qwen 3.6 35B-A3B Q8 模型,配置 Pi agent。Gerganov 的极简方式是 pi -nc –offline,或参考 Boykis 的 Docker Compose 配置。
关键配置:模型配置里加 chat-template-kwargs = {“preserve_thinking”: true};KV cache 用 F16 K + Q8 V;AMD GPU 用户推理后端选 Vulkan 而不是 ROCm。
预期效果:约前沿模型的 50-75% 编码能力,5x 开发加速,完全免费,完全离线。
一句话
2026 年中的本地模型,终于越过了“能用“的门槛。 它不是 Claude 的替代品——它是 Claude 的互补品。当你不信任云端、当你想完全掌控、当你在做不涉密但也不想传出去的工作——有一台 Mac 和一个 Qwen 就够了。
而六个月前,这还不可能。
来源: • HN 讨论:https://news.ycombinator.com/item?id=48542100… • Vicki Boykis:https://vickiboykis.com/2026/06/15/running-local-models-is-good-now/… • Georgi Gerganov HN 评论
#本地模型 #Qwen #agentic-coding #llamacpp
Pi Coding Agent
Source: https://pi.dev/
Why Pi?
Pi is a minimal agent harness. Adapt Pi to your workflows, not the other way around. Customize Pi withextensions,skills,prompt templates, andthemes. Bundle them asPi packagesand share via npm or git.
Pi ships with powerful defaults but skips features like sub-agents and plan mode. Ask Pi to build what you want, or install a package that does it your way.
Four modes: interactive, print/JSON,RPC, and SDK. SeeOpenClawfor a real-world integration.
Change the harness, not your workflow
Pi isn’t a sealed product. If you need a command, tool, provider, workflow, or UI tweak, just ask Pi to build it. It will customize itself on the fly.
Have Pi manipulate itself in place, hit/reload, and keep going. If you think others will find what you built useful, share it!
15+ providers, hundreds of models
Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi For Coding, MiniMax, OpenRouter, Ollama, and more. Authenticate via API keys or OAuth.
Switch models mid-session with/modelorCtrl\+L. Cycle through your favorites withCtrl\+P.
Add custom providers and models viamodels.jsonorextensions.
Tree-structured, shareable history
Sessions are stored as trees. Use/treeto navigate to any previous point and continue from there. All branches live in a single file. Filter by message type, label entries as bookmarks.
Export to HTML with/export, or upload to a GitHub gist with/shareand get a shareable URL that renders it.Example session.
Context engineering
Pi’sminimal system promptand extensibility let you do actual context engineering. Control what goes into the context window and how it’s managed.
**AGENTS.md:**Project instructions loaded at startup from~/\.pi/agent/, parent directories, and the current directory.
**SYSTEM.md:**Replace or append to the default system prompt per-project.
**Compaction:**Auto-summarizes older messages when approaching the context limit. Fully customizable viaextensions: implement topic-based compaction, code-aware summaries, or use different summarization models.
**Skills:**Capability packages with instructions and tools, loaded on-demand. Progressive disclosure without busting the prompt cache. Seeskills.
**Prompt templates:**Reusable prompts as Markdown files. Type/nameto expand. Seeprompt templates.
Dynamic context:Extensionscan inject messages before each turn, filter the message history, implement RAG, or build long-term memory.
Steer or follow up
Submit messages while the agent works.Entersends a steering message (delivered after current tool, interrupts remaining tools).Alt\+Entersends a follow-up (waits until the agent finishes).
Four modes
**Interactive:**The full TUI experience.
Print/JSON:pi \-p "query"for scripts,\-\-mode jsonfor event streams.
**RPC:**JSON protocol over stdin/stdout for non-Node integrations. Seedocs/rpc.md.
**SDK:**Embed Pi in your apps. SeeOpenClawfor a real-world example.
Primitives, not features
Features that other agents bake in, you can build yourself. Extensions are TypeScript modules with access to tools, commands, keyboard shortcuts, events, and the full TUI.
Sub-agents,plan mode,permission gates,path protection,SSH execution,sandboxing, MCP integration, custom editors, status bars, overlays.
Don’t want to build it? Ask Pi to build it for you. Or install apackagethat does it your way. See the50+ examples.
Bundle extensions, skills, prompts, and themes as packages. Install from npm or git:
$ pi install npm:@foo/pi\-tools$ pi install git:github\.com/badlogic/pi\-doom
相似文章
@DDDDDDayu: 想玩转本地模型部署的,关注一下这 10 位实战者: 1、黄小木 @ai_xiaomu :长期折腾本地大模型、数字人和视频工作流。木哥的 DGX Spark 不只拿来对话,而是直接用本地数字人工作流产出讲解视频,还分享过一张显卡就能跑的开源…
推荐了10位本地模型部署实战者,涵盖用二手矿卡、改装RTX 4090、DGX Spark、Mac Studio等设备跑本地大模型、数字人视频、编程Agent与推理引擎SGLang的实操经验。
@zhixianio: 这两天新机器到了之后,我开始了「苦行僧」式的强迫自己使用本地模型来完成常见任务的修行 本以为会非常痛苦,没想到无论是速度还是质量都大大超出我的预期: 模型: Qwen3.6-35B-A3B-oQ6-fp16-mtp 运行:oMLX,开 N…
作者在本地新机器上使用Qwen3.6-35B-A3B模型和oMLX工具进行日常任务,发现速度和效果远超预期,甚至在PA和Coding场景下优于远程LLM,体现了端侧AI能力的显著提升。
@Xudong07452910: Hacker News 上有一篇评论区火了的文章:Qwen 3.6 27B 是本地开发的理想选择。 核心发现是:密集参数模型、原生支持 256k 上下文,在 MacBook Max M5 上跑 Q8_0 量化版能达到 30 tokens/…
Qwen 3.6 27B is a dense 27B model that achieves impressive performance on local hardware with 256k context, running at 30 tokens/s on MacBook Max M5 and 50 tokens/s on RTX 5090, and is considered by some as the first local model with true general intelligence.
@mingzi206: 仅用 956MB 撬动 54GB 庞然大物,还能让大模型写代码难题通过率暴涨近 20 分?! 刚开源的 Qwen3.8-27B 超级适配器彻底颠覆了很多人对微调的认知:不用耗费算力重新训大模型,一套直接通吃 OpenCode、Pi 和 H…
Hugging Face 开源了一套仅 956MB 的 Qwen3.8-27B 超级适配器,将三个框架中各自训练的 Rank 32 LoRA 零重训拼接为 Rank 96 合体包,显著提升 OpenCode、Pi 和 Hermes Agent 的 SWE-bench Pro 通过率并大幅减少多余工具调用。
@NFTCPS: 本地跑大模型这事,一看几百 GB 权重和显存要求,大多数人当场劝退,我以前也是。 colibri 直接换了个玩法,把显存、内存、硬盘当一个整体来调,权重按需从硬盘流式加载,纯 C 写、零依赖,已经 25000+ Star。 几个点说下: …
介绍colibri,一个纯C编写的开源推理引擎,能够将显存、内存和硬盘作为统一层次结构,流式加载大模型权重,支持多种前沿MoE模型在消费级硬件上本地运行,降低大模型使用门槛。