Managing AI Coding Costs at Scale
https://www.databricks.com/blog/managing-ai-coding-costs-scale📌 【Databricks 技術分享】AI 程式碼編寫成本爆炸?解析大規模部署時的成本管理策略
TL;DR:大規模部署 AI 程式碼工具會導致成本呈指數級增長,企業需在「推動 AI 轉型」與「控制總成本」之間取得平衡。
在 Databricks 的實踐中,代理式編寫(agentic coding)已顯著提升了所有追蹤的開發速度指標,部分團隊甚至達到了數量級(order-of-magnitude)的產出增長。然而,幾乎所有大規模部署 AI 工具的公司都撞牆了:成本正呈指數級增長,若不加管控,這筆開銷最終將蠶食企業利潤。
🤔 企業面臨的矛盾:效率增長 vs. 成本爆炸
企業正陷入一個悖論:一方面渴望最大限度推動 AI 轉型,將強大工具交給員工;另一方面,總體成本的激增正威脅著 AI 所帶來的效率增益。
為了達成「既能提供廣泛的工具使用權,又能將人均總成本控制在固定範圍內」的雙重目標,數位原生企業(如 Stripe、Coinbase、Uber、Ramp)已發展出一套成熟的應對方案。
🧩 核心策略:追逐「效率前緣」而非僅是「智能前緣」
在 AI 領域,存在兩種不同的前緣(frontier):
- 智能前緣 (Intelligence Frontier):追求最高智能,例如解決複雜數學或網路安全問題。
- 效率前緣 (Efficiency Frontier):在給定的智能水準下,擁有最佳價格效益的模型。
對於日常的程式碼編寫工作,並不需要頂尖的數學證明能力,因此「效率前緣」的進展速度遠快於「智能前緣」。新模型幾乎每週都在釋出,提供更好的「單位成本智能比」。
💡 如何快速切換至更高效的模型?
快速採用新模型是成本控制最大的槓桿。但這涉及兩個挑戰:
- 評估挑戰:公開基準測試(benchmarks)難以反映真實開發場景。因此,企業通常會建立自動化評估系統來模擬內部開發組合。例如 Databricks 發現 GLM 模型在特定基準下具有極高的性價比,進而推廣至內部使用。
- 工具鎖定 (Lock-in) 挑戰:不同的模型與開發工具(harnesses,如 Claude Code、Cursor)可能存在相容性問題。
為了保持模型的靈活性,企業有兩種做法:
- 要求使用者手動切換:使用者根據需求在不同工具間切換,但開發者的切換成本(switching costs)可能過高,導致工具本身變成模型家族的鎖定工具。
- 使用「元工具」(Meta-harness):這是一種日益流行的做法。透過一個統一的用戶介面來處理請求,並根據需求將請求派發(dispatch)給底層不同的工具或模型。Databricks 的 Omnigent 即採用此模式。
⚠️ 為什麼「硬性預算限制」並非最佳解?
雖然「給予使用者每月固定預算」看似簡單,但企業通常將「硬性預算切斷」(當達到金額上限就停止服務)視為最後手段。原因有二:
- 破壞生產力:一旦達到上限就停止服務,會嚴重阻礙開發者工作。
- 高價值用戶矛盾:那些花錢最多的用戶,往往是利用 AI 創造最大效率增益的人,限制他們等於自毀長城。
🎯 實務上的成本管控建議
根據對數位原生企業的調查,有效的管控應著重於「透明度」與「漸進式摩擦」:
- 提供即時視覺化 (Visibility):為開發者提供即時的支出回饋與儀表板,讓他們知道目前的成本狀況,並提供如何切換到低成本模型的建議。
- 減少上下文膨脹 (Context Bloat):當使用者下達簡單指令時,Agent 會收集大量背景資訊(context),這些非使用者直接提供的資訊往往佔據了大部分的推理成本。目前業界正探索透過技術減少這些冗餘資訊,並利用 Prompt Caching(提示詞快取)來提升效能與降低成本。
🔗 來源
- 標題:Managing AI Coding Costs at Scale
- 作者/機構:moonikakiss @ Hacker News (Databricks)
- 連結:databricks.com/blog/managing-ai-coding-costs-scale
#AI #SoftwareEngineering #Databricks #LLM #AITools #CostManagement #DeveloperProductivity #MachineLearning #AIInfrastructure #TechStrategy
原始資料 Hacker News · 收集於 2026-08-08
摘要原文
AI coding tools deliver immense value: at Databricks, agentic coding has measurably improved every velocity metric we track and, in some teams, driven an order-of-magnitude gains in output. But nearly every company deploying AI tools at scale has hit the same wall: exponentially growing costs . That curve is unsustainable - left unchecked it will eventually overtake revenue. The spend explosion has left enterprises in a paradoxical situation: on the one hand, desiring to maximally push AI transformation and put powerful tools in the hands of employees, and on the other hand, having to reconcile with an aggregate cost profile that threatens to undermine or even reverse the very efficiency gains AI provides. Fortunately, several of the earliest large-scale adopters have converged on a set of approaches that solve this puzzle, achieving a “dual mandate”: (a) providing broad access to AI tooling, with minimal friction, and (b) keeping aggregate costs inside of a roughly fixed envelope per user. This post outlines proven cost management techniques, based on our experience at Databricks and conversations with several other digital-native companies, including Stripe, Coinbase, Uber, and Ramp. The table below summarizes current techniques and associated savings; the numbers are directional, based on an informal survey of development teams: Some of these techniques can be easily implemented with software many companies already use. Others require new infrastructure, particularly techniques that modify end-user clients or shift traffic across models. At Databricks, we’ve open sourced or made freely available our key infrastructure components: an end user meta-harness ( Omnigent ) and our AI Gateway ( Unity AI Gateway ). For completeness, this post also covers software used by other companies we spoke with. The single greatest cost lever in moving coding spend to more efficient models as they are released. This point bears some discussion, as the simple explanation of "cheaper models” in fact hides a nuanced relationship between model cost and quality. Colloquially, the term frontier model means “the highest intelligence model,” and frontier labs largely focus on advancing peak intelligence. Frontier models can now solve novel problems in math or cybersecurity. But when AI is deployed at scale, a different type of frontier matters more: the efficiency frontier . The efficiency frontier is defined by the set of models that have the best price point for a given level of intelligence . Most day-to-day coding doesn't require mathematical proofs or novel security insights, so what matters in aggregate is the cost of models that meet the quality bar for typical software engineering work. This "efficiency frontier” is advancing far faster than the intelligence frontier, with new models being released almost weekly that present better intelligence-per-unit-price than prior models. Rapidly adopting newer, more efficient models delivers the largest cost wins of any technique. But to capture those gains, a company first needs to know which models actually beat its incumbents. This can be difficult because public benchmarks do a poor job of indicating real-world performance on coding tasks. To size up new models, many companies have built automated evaluations that they believe are more representative of their internal development mix. Databricks recently published an example of such a benchmark , in which we observed highly competitive price/performance for GLM models. That benchmark led us to roll GLM out to developers internally. Often, new models do not advance the efficiency frontier,and evaluations frequently produce negative results: Stripe found that Opus 4.7 did not meaningfully improve quality over Opus 4.6, while increasing cost. They therefore declined to make Opus 4.7 available internally. Databricks saw similar cost regressions when comparing Opus 5.0 to 4.8. Since the biggest wins come from switching to new models, adopting end user tooling that allows for model flexibility is becoming a critical component of keeping costs down. The tool most commonly used in concern with a particular model is called harness . Proprietary frontier models are increasingly co-designed to work well with specific harnesses, meaning certain harnesses “work better” with certain models. If a company wants to preserve model independence there are roughly two approaches: Ask users to switch harnesses. One approach is to provide developers with a set of harnesses (Claude Code, Codex, or Cursor) and then ask them to switch between harnesses when a company wants to migrate spend to lower cost models. This lets users work in their preferred harness when possible, but the downside of this approach is that switching costs for an individual developer can be high. If switching costs become too high, the harness itself becomes a de facto lock-in to a model family, limiting the ability to move spend to more competitive models. Use a meta-harness. A new and increasingly popular approach is to use a meta-harness that surfaces a common user experience to developers while dispatching requests to underlying harnesses (both proprietary and open source). This approach allows both model/harness independence while also reducing developer switching costs. At Databricks, this is the default mode for developers who leverage Omnigent . Some companies we talked to have built custom internal meta-harnesses that integrate with their development toolchain. Instead of asking users to choose task-appropriate models themselves, a growing body of research suggests that automatic model and tool selection may further squeeze efficiency out of agentic coding workflows. Routing approaches roughly fall into three categories: It may be surprising that this entire article did not start and end with “Give users a monthly budget and be done with it.” Hard budgets , where usage is entirely cut off at a specific spend threshold, are often used only as a last resort option in every company we spoke with. There are two reasons that hard token budgets are not particularly effective for AI spend management: First, if a developer hits their budget ceiling, cutting off further access to AI tools would be debilitating to productivity. Neither the company or employee actually wants that outcome. Second, at least some of the “high spending” users are in fact those who have achieved monumental efficiency gains with AI and are producing immense output. Discouraging those users is self-defeating. Instead of a hard user spending cap, most companies are adopting a more nuanced and progressive approach that focuses on visibility for end users and increased degrees of friction as spend increases. Visibility: Every company we spoke with had a mechanism to provide near-instantaneous feedback to users on their ongoing spend, with many also offering specific tips or insights on how to reduce spend by using less expensive models. It is important that users be able to see their spend across all tools, since they may want to influence their choice of tool where they get the highest ROI. A developer dashboard at Databricks showing active spend When a user types a relatively simple request into an AI coding agent (such as “Please investigate and fix this bug.”), that agent subsequently gathers massive amounts of relevant context, invokes a large number of tools, searches through the codebase, and integrates skills or system information provided by the company. By the time costly LLM inference occurs, the user's initial statement accounts for only a negligible fraction of the data fed into the AI system, meaning costs are dominated by context the user did not explicitly include. Techniques in reducing context bloat are still new, but several promising approaches are being explored, such as: When contexts get large, prompt caching also plays a meaningful role in overall performance. (210 points, 193 comments on Hacker News)
由 tencent/hy3:free 自動生成