Build vs Buy

You can rent intelligence, you can’t rent accountability: build, adopt, buy or partner, per component, with the arithmetic

  11 minute read  

Overview

This course built a gatekeeper, guardrails, memory governance, hallucination checks and an evaluation harness. Should a production team build all of that? Mostly not. Some of it, absolutely. These notes give the tools to tell which: a per-component framing with four options (build, adopt, buy, partner), the arithmetic of ROI, payback, NPV, total cost of ownership and break-even volume, and the non-financial factors that often decide the matter.

By the end of these notes you should be able to:

  • frame build-versus-buy per component rather than per agent;
  • compute ROI, payback, NPV and a break-even volume, and interpret them;
  • explain why the falling price of model capability changes what is worth building;
  • recommend what to build, adopt and buy for an agent, and justify it.
Point of View
This course built a Gatekeeper, guardrails, memory governance, hallucination checks, an eval harness. Should you build all of that? Mostly, no. Some of it, absolutely. These notes are about telling which, with numbers.
Four Options, Per Component

“Should we build or buy an AI agent?” is the wrong grain. An agent is a dozen components, and the right answer differs per component. And there are four options, not two:

OptionMeansThe catch
BuildWrite and own itYou own every upgrade and every on-call page
AdoptOpen sourceFree to license, not free to own: integration, upgrades, maintenance
BuyA vendor’s product or APIYou pay for someone else’s scale and roadmap
PartnerA vendor builds with you, on your dataShared control

Our own stack, by source:

SourceComponents
BuiltGatekeeper and business rules · loop governor · guardrail orchestration · grounding checks · context pipeline · memory governance · analytics contract · eval oracle + golden set
AdoptedLangGraph · MCP SDK · DuckDB · Presidio · NLI and intent models · DeepEval · Promptfoo · Rill · Pydantic · sqlglot
BoughtHosted foundation models · hosted safety classifiers · a tracing UI (optional)
Key ideaDecide per component, never per “agent”. We built the control plane and the data; we adopted or bought the runtime.
What the Data Says (and Doesn't)

One data point the industry argues about: MIT NANDA’s The GenAI Divide: State of AI in Business 2025.

  • ~95% of companies’ generative-AI pilots in its dataset showed little or no measurable P&L impact.
  • Purchases from specialised vendors and partnerships succeeded about 67% of the time; internal builds about a third as often.
  • More than half of budgets went to sales and marketing tools, while the biggest ROI was in back-office automation.

It is survey- and interview-based, and its definition of “success” has been debated. But the direction matches practice.

Key ideaBuilding should be a deliberate choice, not the default.
ROI, Payback, NPV

The three numbers a CFO will ask for, over a stated horizon (e.g. 3 years):

\[\text{ROI} = \frac{\text{benefit} - \text{cost}}{\text{cost}} \qquad \text{Payback} = \frac{\text{one-off cost}}{\text{monthly net benefit}} \qquad \text{NPV} = \sum_t \frac{\text{benefit}_t - \text{cost}_t}{(1 + r)^t}\]
  • ROI: how much you get back per dollar spent.
  • Payback: months until it has paid for itself.
  • NPV: money later is worth less than money now; discounting at rate \(r\) says by how much.

Where an agent’s benefit comes from:

  • ‍Labour: deflected tickets, shorter handle time.
  • ⏩ Cycle time: faster refunds, faster research.
  • Revenue: conversion, retention.
  • Risk avoided: losses prevented.
Key ideaRisk avoided is real money, and the benefit most often left out.
Total Cost of Ownership

TCO is everything something costs over its life, not the sticker price:

BuildBuy
Up frontEngineers × monthsIntegration · onboarding
RunningInfrastructure · on-call · upgradesSeats or usage, growing with volume
HiddenEvals, red-teaming, model regressionsWorkarounds for gaps · data egress · price rises
LeavingNothing to leaveExit cost: data, rewrites
AlwaysOpportunity cost: what those engineers didn’t buildVendor risk

Costs specific to agents, each an instance of an earlier chapter:

CostWhy it recurs
Model churnEvery model change can regress behaviour, so you need evals to change models safely
Guardrail upkeepAttack phrasing evolves (Agent Security)
Policy driftRules and golden labels must follow policy changes
Trace volumePer-trace fees grow with traffic (Observability)
Human reviewEscalations need people (Levels of Automation)
Key ideaAn agent shifts work to review and maintenance; it rarely deletes it.
Break-Even Volume

The one formula that settles most cost arguments. Build has a high fixed cost (a team) and a low variable cost (tokens); buy has a low fixed cost and a high variable cost (a per-resolution fee):

\[C_{\text{build}} = F_b + v_b Q \qquad C_{\text{buy}} = F_v + v_v Q \qquad\Rightarrow\qquad Q^* = \frac{F_b - F_v}{v_v - v_b}\]

Below \(Q^*\), buy is cheaper; above it, build is.

Example
Illustrative: build at $48k/month fixed + $0.125 per resolution; buy at $15k/month + $1.00 per resolution:
\[Q^* = \frac{48{,}000 - 15{,}000}{1.00 - 0.125} \approx 37{,}700 \text{ resolutions/month} \approx 94\text{k tickets at a 40\% resolution rate}\]
Key ideaKnow your Q, now and in two years.

Plan for the price curve. The cost of a given level of model capability has been falling roughly 10× per year (a16z, LLMflation, 2024):

  • Don’t build what the curve will commoditise, e.g. a custom-trained or fine-tuned model to save tokens: it competes with a price that falls 10× a year.
  • Do build what the curve doesn’t touch: rules, data, evals, authority. Their value rises as tokens get cheaper, because cheaper tokens mean more agent traffic to govern.
  • Keep switching cheap: models and judges behind configuration, so you can ride the curve.
Eight Factors Beyond Price
FactorThe question to ask
DifferentiationDoes it make us better than competitors, or is it plumbing?
Liability · controlIf it’s wrong, who pays, and can we explain the decision to a regulator?
Data sensitivityMay this data leave our boundary at all?
Time-to-valueWhat does a six-month build cost in delayed benefit?
‍TalentCan we hire and keep the people to run it?
VolumeWhere are we relative to \(Q^*\), now and later?
Rate of changeIs the field moving faster than we can keep up?
Exit costIf the vendor triples its price, what does leaving cost?

Differentiation × maturity sorts most components:

Low differentiation for usHigh differentiation for us
Mature marketBuy / adopt (a database, a BI tool, a safety classifier)Buy the core, build the edge (a bought model; your prompts, skills, evals around it)
Immature marketAdopt open source, stay thin, and wait for the marketBuild (your authority rules, your grounding rules)
Key ideaBuild only where you’re different and nobody sells it well.
What to Build: The Control Plane and the Data

1 · The authority layer (Gatekeeper, business rules, mandates, limits). The liability is yours, and no vendor knows your refund policy, limits or escalation paths. The economics:

\[\text{expected loss} = P(\text{wrong action}) \times \text{cost per wrong action} \times \text{volume}\]
Example
Illustrative: 0.1% × $80 × 1,000,000 refunds/year ≈ $80,000/year in direct loss, before chargebacks, regulators or the press. A deterministic Gatekeeper is a few engineer-weeks to build and near-zero marginal cost per call.
Key ideaYou can rent intelligence. You can’t rent accountability.

2 · Your evaluation data. Adopt the frameworks (DeepEval, Promptfoo); build the data: golden cases labelled from your policy, oracle rules, attacks against your tools. Nobody can sell you that. A core eval run costs minutes and a few dollars; one bad model upgrade that refunds the wrong order for a day can cost more than a year of runs.

Key ideaWithout evals you can’t switch to the cheaper model safely.

3 · Domain checks.

CheckGeneric APIOurs
Refund-state claimsDoesn’t know the state machineDirect record check · ~0 per call
Prose groundingA hosted call per replyLocal NLI · ~0 per call
Jailbreak · safetyA maintained classifierBought
Key ideaBuild checks that need your knowledge; buy ones that need a dataset.

4 · Facts and adapters. The analytics contract is cheap to build, near-free to run and vendor-neutral (sample the vendor’s trace view; keep the full record yourself). Thin adapters around every bought service (model chain, judge client, guard chain) make switching a configuration change, not a rewrite.

Key ideaAn adapter buys you a cheap exit: it keeps every “buy” reversible.
What to Buy or Adopt

Models and inference: buy capability. Training a frontier model is orders of magnitude beyond an agent team’s budget, and prices keep falling. Self-hosting open weights has its own break-even:

\[\text{self-host pays when}\quad \frac{\text{GPU \$/hour}}{\text{tokens served/hour}} < \text{API \$/token}\quad \text{at real, sustained utilisation}\]

An idle GPU still bills. Self-host only for utilisation, data residency, or a missing feature (e.g. constrained decoding). Small local models (intent classifiers, NLI, summarisers) are the exception worth running yourself: tiny, CPU-only, zero marginal cost, called every turn.

Adopt open-source plumbing: a graph runtime with checkpoints, a protocol SDK, an analytics engine, NER, validation, a SQL parser, eval runners. Zero licence cost; you pay in integration and upgrades. Wrap it where it touches the domain (a durability runner around the checkpointer, a governed source around the MCP SDK), so an upgrade or swap stays local.

Buy specialised classifiers and trace UIs: a safety classifier’s value is an adversarial dataset that keeps up with new attacks; building that means labelling and retraining forever. Keep deterministic rules underneath and fail closed. A trace UI pays when debugging hours are real; sample it.

Key ideaBuy what needs a dataset you’d have to maintain forever.

When buying pays:

TriggerBecause
\(Q < Q^*\)At low volume, their variable cost beats your fixed cost
Time-to-valueLive in weeks vs quarters to build
Non-differentiatingCustomers never see plumbing
Their scaleShared R&D: datasets, training
CertificationsSOC 2, ISO 27001, HIPAA: costly to earn alone
Talent gapYou can’t staff it well

Whatever you buy, negotiate the exit: data export, price caps, an adapter on your side.

Read more about Supervised Fine-Tuning (SFT)
Read more about Parameter-Efficient Fine-Tuning (PEFT)
Read more about Large Language Models

A Worked Example: A Support Agent

Every number is illustrative; the method is the point. Plug in your own.

Inputs: 50,000 tickets/month; the agent fully resolves 40% → 20,000 resolutions; each saves $5 of human handling → $100,000/month benefit.

BuildBuy
One-off$360k (4 engineers × 6 months × $15k)$60k (2 engineers × 2 months)
Team · infra$48k/month (3 engineers + infra)$15k/month (1 engineer)
Per resolution$0.125 (tokens, guards)$1.00 (vendor fee)
Monthly cost @ 50k tickets48k + 0.125 × 20k = $50.5k15k + 1.00 × 20k = $35k
Payback360 ÷ (100 − 50.5) ≈ 7.3 months60 ÷ (100 − 35) ≈ < 1 month
3-year ROI(3.6M − 2.18M) ÷ 2.18M ≈ 65%(3.6M − 1.32M) ÷ 1.32M ≈ 173%

At this volume, buy wins on money. Now change one input, volume:

Tickets/monthBuildBuyWinner
50k$50.5k$35kBuy
100k$53k$55kRoughly even
200k$58k$95kBuild, by $37k every month

The crossover is the break-even from earlier, about 94k tickets a month.

Key ideaThe money answer moves with volume; the control answer doesn’t. The authority rules, the evals and the facts are yours to build either way, even when you buy the agent.
The Recommendation

This course built most things because it is a teaching platform: you can’t explain a Gatekeeper you didn’t write. That’s a legitimate reason here, and not one a product team has. For a production team:

BuildThe control plane and the data: authority, domain checks, the analytics contract, golden sets, attacks, policies
AdoptOpen-source plumbing, wrapped at the domain edge
BuyModels, safety classifiers, trace UIs, behind adapters, with the exit negotiated
RevisitAt every order-of-magnitude change in volume or price
Key ideaBuild what makes you accountable and different; rent the rest.
Question
A team wants to fine-tune its own model to save inference cost on a support agent handling 30k tickets a month. What would you ask before agreeing?
Answer
  • Where are they relative to \(Q^*\)? At 30k tickets the fixed cost of a team and GPUs may never pay back.
  • The price curve: a saving that competes with prices falling ~10× a year evaporates fast.
  • Utilisation: will self-hosted GPUs run at sustained high utilisation, or bill while idle?
  • Is it differentiating? Probably not: the model is commodity. The money is better spent on what the curve doesn’t touch (authority rules, domain checks, eval data) and on an adapter that keeps switching to a cheaper hosted model a config change.
Summary
  • Decide per component: build, adopt, buy or partner.
  • Know the arithmetic: ROI, payback, NPV, TCO, and break-even \(Q^*\).
  • Build the control plane and the data: their value rises as tokens get cheaper.
  • Buy the commodity, behind adapters, with the exit negotiated.

You can rent intelligence. You can’t rent accountability.

Further Reading
🎖
Agentic AI — Complete

You've worked through all 16 lessons in this module.

16 lessonsAgentic AI100% Done
Browse Next Course →