arXiv:2607.13080cs.SEcs.AI2026-07被引 1

对比云与本地部署大模型在企业编码中的成本与质量表现

Inference Economics of Enterprise Coding Agents: A Case Study of Cloud vs. On-Premise LLMs

  • 用真实项目数据对比云端API模型与本地量化模型的推理成本
  • 本地部署虽缺陷修复率更高,但整体总拥有成本低40.1%
  • 提示词缓存使云模型实际成本低于共享本地部署,但影响开发者体验

自主编码代理迫使工程组织在高成本的API前沿模型与本地部署的量化开源模型间做选择。我们通过一个开发者的纵向案例研究,在连续两个28天周期内对比了Claude Opus 4.7/4.8(API)与基于NVIDIA Blackwell硬件的GLM-5.1/5.2(本地,NVFP4量化)。分析日志与Git历史发现,提示词缓存率达99.3%,使实际API成本降低88.6%至每百万token 0.57美元,低于共享本地资源的2.83美元均摊成本。在代码变更量相近时,本地配置修复提交比率达74.9%,远高于云端的45.9%,且每个难度层级下修复概率高出2.6至4.9倍(合并奥尔值=3.61)。在台湾市场参数与对称人力模型下,共享本地部署总拥有成本节省40.1%,而专用资源则贵出43.8%。真正的代价并非金钱,而是开发者体验下降:调试循环更长、提交节奏变慢;离线回放显示混合路由在成本与质量间权衡,而非全面优于纯云端方案。

原文摘要 · Abstract (English)

Autonomous coding agents force engineering organizations to choose between API-based frontier models -- strong reasoning at high token cost -- and on-premise quantized open-weights models, which promise low-marginal-cost scaling and data sovereignty at some loss of reasoning fidelity. We study this trade-off through a single-developer, non-randomized longitudinal case study over two contiguous 28-day periods on a production monorepo: an API-based Claude Opus 4.7/4.8 configuration using Claude Code versus an on-premise GLM-5.1/5.2 configuration using Opencode, quantized to NVFP4, on NVIDIA Blackwell hardware. Analyzing LLM telemetry and Git history, we find that prompt caching (99.3% hit rate) cuts realized API cost by 88.6% to an effective \$0.57 per million tokens -- below even the \$2.83 amortized unit cost of the shared on-premise slice (a utilization-dependent inversion; total realized spend and total cost of ownership (TCO) are the robust quantities). At comparable gross code churn, the local configuration was associated with a far higher defect-repair burden: a Fix Commit Ratio (FCR) of 74.9% versus 45.9%, with the odds of a commit being a repair 2.6 to 4.9 times higher within every difficulty tier (Mantel-Haenszel OR = 3.61). Under Taiwan-market parameters and a symmetric labor model, on-premise deployment nonetheless saves 40.1% of true TCO under shared GPU allocation, whereas dedicated reservation costs 43.8% more than the cached API. Under shared allocation, the genuine penalty is not monetary but a measurable developer-experience burden -- timestamp indicators show more work trapped in debugging spirals and a slower commit cadence -- and an offline replay shows hybrid routing gateways trade defect rate for infrastructure savings along a cost-quality frontier rather than dominate the pure-API baseline.

大模型推理成本分析本地部署编码代理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。