Should We Build or Buy AI? A Layer-by-Layer Build, Buy or Partner Framework

Ask whether to build or buy AI once, at portfolio level, and you will almost certainly get it wrong: too much in-house engineering on commodity plumbing, too little investment in the logic and data that set you apart. The fix is to decide per layer of the stack, against weighted criteria and hard data-residency gates, with the exit priced before you sign. This guide gives CTOs and technical founders in the UAE the framework, the weights, a worked example with the arithmetic, and the contract terms that make the partner route safe.

Why "build or buy" is the wrong question

Most AI build-or-buy discussions go wrong at the framing. A steering committee asks "should we build or buy AI?", hears two numbers and picks one answer for the whole organisation. Two failure modes follow.

The first is over-building. Teams spend a year or more assembling a model gateway, retrieval pipeline, evaluation harness and agent runtime that vendors already sell as products, and finish with no edge over anyone else. The second is under-investing: the same "just buy it" logic gets applied to the workflows and proprietary data that actually differentiate the business, so every competitor running the same platform ends up with the same AI. The TechTarget CIO decision matrix makes the point plainly: build-versus-buy is too often treated as a purely technology decision, when the outcome actually turns on strategic alignment, complexity, resourcing, total cost and lock-in.

For CTOs and technical founders in the UAE the pressure is sharper than average. Vendor pitches arrive with AI embedded in everything you already licence, the pool of engineers who have run LLM systems in production is thin, and data rules constrain where inference can run. The question is not "build or buy". It is a portfolio of decisions, one per layer of the stack, each with three verdicts: build, buy or partner. Each verdict needs an exit price attached before you commit.

The stack, layer by layer

Gartner's "AI technology sandwich" is the right map of what you are actually deciding between. In its 10 questions to ask about your AI build vs buy decisions, AI reaches an organisation from three directions: embedded AI in software you already licence (SAP, ServiceNow, Salesforce), bring-your-own AI that departments buy for themselves, and built or blended AI your central teams own. Trust, risk and security management (TRiSM) wraps all three, while data management, budget and the vendor ecosystem sit underneath.

For a build-or-buy decision, cut that sandwich into four layers. Each has its own default.

LayerWhat sits in itUsual defaultBuild whenBuy when
Foundation modelsLLMs, embedding, reranking, speech and vision modelsAdopt, do not trainEvaluation shows prompting and retrieval fall short and you hold labelled data for fine-tuningAlmost always; approve two or more models per data class so you can switch
Platform and orchestrationModel gateway, agent runtime, identity and permissions, logging, evaluation tooling, Kubernetes, GPU capacityBuy a platform or adopt open source with a support planThe platform is your product, or no product meets a hard constraint such as in-country-only inferenceYou need governed production on a predictable budget
Applications and agentsPrompts, tool definitions, workflow steps, approval points, interfacesBuild or configure on the platformThe workflow is how you compete, or depends on your own systems and rulesThe task is the same in every company, such as meeting notes or general drafting
Data and retrievalConnectors, chunking, permission mapping, vector stores, evaluation setsOwn the knowledge, buy the plumbingSources, permissions or document types are unusualPackaged retrieval covers your sources and respects your access rules

Two practical notes for Gulf organisations. First, count the embedded AI you already pay for before approving anything new: features arriving inside your ERP, CRM and service desk renewals are usually the largest and fastest-growing source of AI capability, and stacking separate tools on top creates overlap and technical debt. Second, the platform layer is where residency requirements bite hardest. If processing and logs must stay in the UAE, the gateway and runtime decision is a hard constraint, not a preference, and it shapes every layer above it.

Seven criteria and two hard gates

Apply the gates before any scoring.

Gate 1: data classification and residency. Classify the data each system will touch as public, internal, confidential or regulated. The UAE's Personal Data Protection Law (Federal Decree-Law No. 45 of 2021, in force from 2 January 2022) sets conditions on cross-border transfer in Articles 22 and 23 rather than a blanket localisation rule, but sector rules are stricter: bank master systems of record must stay in the UAE under the Central Bank's outsourcing regulation, health data may not leave the country without a permit under Federal Law No. 2 of 2019, and DIFC and ADGM entities run their own transfer regimes. If an option cannot keep processing, prompts and logs where policy requires, it is out whatever its score.

Gate 2: your regulatory role. Building can change your legal position. Under Article 25 of the EU AI Act, a deployer becomes the provider of a high-risk system if it brands one, substantially modifies it, or changes its intended purpose. If your systems or customers reach the EU, check which side of that line each option puts you on.

Then score each remaining option against seven weighted criteria.

CriterionWeightWhat a 5 looks like
Differentiation20Protects or creates an advantage competitors cannot buy
Data sensitivity and residency20Data stays where policy requires, with full control of prompts and logs
Skills and capacity15Your organisation can run and improve it for the next three years
Total cost of ownership15Lowest three-year cost at forecast volume, run costs included
Speed to value10Earliest useful production result
Lock-in and exit10Assets export cleanly and the exit has a known price
Compliance and audit10Evidence for regulators and auditors is complete and in your hands

Score every option from 1 (poor fit) to 5 (strong fit) per criterion, multiply by the weight, add up, and divide by 5 for a score out of 100. Agree the weights before anyone scores. Where two options land within a few points, run a short structured proof of concept on both, on your own data.

Worked example: a customs query agent for a Dubai logistics operator

A Dubai-headquartered logistics group with about 3,800 staff wants an agent that reads shipment files (bills of lading, invoices, prior correspondence) and drafts responses to customs queries and claim correspondence for a 25-person documentation team. Volume assumption: 600 queries per working day. The hard gate is that shipment files, customer data and model logs stay in the UAE, because client contracts and PDPL transfer conditions require it.

Three options are on the table:

Scoring it:

CriterionWeightBuildBuyPartner
Differentiation20524
Data sensitivity and residency20534
Skills and capacity15254
Total cost of ownership15243
Speed to value10253
Lock-in and exit10524
Compliance and audit10334
Score out of 100726775

The arithmetic for the partner option is (20x4 + 20x4 + 15x4 + 15x3 + 10x3 + 10x4 + 10x4) / 5 = 375 / 5 = 75. Build comes to 360 / 5 = 72, buy to 335 / 5 = 67. Here is the calculation as code, so the steering group can rerun it:

WEIGHTS = {
    "differentiation": 20, "data_residency": 20, "skills": 15,
    "tco": 15, "speed": 10, "lock_in": 10, "compliance": 10,
}
scores = {
    "build":   {"differentiation": 5, "data_residency": 5, "skills": 2,
                "tco": 2, "speed": 2, "lock_in": 5, "compliance": 3},
    "buy":     {"differentiation": 2, "data_residency": 3, "skills": 5,
                "tco": 4, "speed": 5, "lock_in": 2, "compliance": 3},
    "partner": {"differentiation": 4, "data_residency": 4, "skills": 4,
                "tco": 3, "speed": 3, "lock_in": 4, "compliance": 4},
}
for option, s in scores.items():
    total = sum(WEIGHTS[c] * s[c] for c in WEIGHTS)
    print(option, total / 5)  # build 72.0, buy 67.0, partner 75.0

Now test the weights, because the matrix's real job is to expose the assumptions the decision rests on. If the group decides the workflow is less differentiating than it first argued (differentiation drops from 20 to 10) and admits it cannot staff an in-house team (skills rises from 15 to 25), build falls to 66, buy rises to 73 and partner stays at 75. The steering group should be arguing about weights, not conclusions.

Run cost deserves its own line. Run-rate cost is not the same as licence cost: it scales with volume, model choice and the number of steps an agent takes. A small, quantised model and a frontier model differ in per-token cost by orders of magnitude, and a multi-step agent run (retrieval, drafting, rule checks, revision) multiplies the per-call cost by the number of steps. Cost the run-rate at real volume and include that multiplier. A "buy" comparison that quotes per-seat licensing without a run-rate is not a comparison at all.

The partner route, and the terms that make it safe

Partnering covers several arrangements: an integrator builds on your platform, a vendor's services team customises its product, or external engineers work inside your teams under a forward-deployed engineering (FDE) model.

RouteTime to first production systemCost over 2 to 3 yearsKnowledge of your businessCode and IP ownership
In-house teamSlowest: hire first, then buildLooks cheapest on paper, with rework riskBuilds up over timeYours
Partner or consultancyFastest: the team existsHigher upfront, designed for lower run costMust be learned per projectOnly if the contract says so
Hybrid, partner then handoverFast start, then moves in-houseMiddle, run cost designed inTransferred to your team by contractYours

Partner arrangements carry a real dependency risk. If the partner owns the code, prompts and evaluation sets, or if knowledge transfer is deferred to a single training week at the end, you end up renting a capability you cannot maintain and cannot leave. The warning is as much about labelling as technology: "forward deployed" is now applied to ordinary implementation and consulting, sometimes at premium fees and without delivery depth.

Whatever the arrangement, put these terms in the contract before work starts:

Settle governance, IP and exit responsibilities before signing; embed external engineers with your domain experts during delivery; then execute the exit plan rather than extending because the team "is not quite ready". The Supertype build, buy or partner guide reaches the same conclusion from the delivery side: judge partners on total cost over the system's lifetime, and expect run-time cost to outgrow build-time cost.

This is also where our own role sits. Azrty is a UAE company based in Dubai, and our own team does the consulting, the deployment and the support. The partner arrangement we run is deliberate: we design, build and run the platform layer with you (GPU infrastructure, one gateway for every model, Kubernetes and pipelines) under AI infrastructure, and the engagement is structured so the skills stay with your team when we step back.

Price the exit before you commit

Buy decisions age badly when nobody writes down the exit. The switchable assets are the ones that decide what leaving costs: prompts, agent definitions, evaluation sets and conversation logs. Keep them in your control, in formats you own, not buried in a vendor console. Four things make an exit affordable, and all four are cheaper to arrange at the start:

  1. Keep the switchable assets in your control. Prompts, agent definitions, evaluation sets and conversation logs live in formats you own, versioned in your own repositories.
  2. Keep the model layer swappable. One OpenAI-compatible gateway in front of approved models, per data class, gives you a single place to route, budget and swap:
# Illustrative model approvals per data class behind one gateway
data_classes:
  public:
    models: [small-hosted-model, mid-tier-hosted-model]
  confidential_uae:
    models: [self-hosted-open-model]   # processing and logs stay in the UAE
    residency: uae-only
budgets:
  default_monthly_usd: 15000
  alert_at_percent: 80
  1. Write the exit price into the business case: a named fallback model, an estimated re-implementation effort in person-weeks, and a data-export test run once a year, not once at termination.
  2. Negotiate portability clauses: explicit data export terms, price-change notice periods, and what happens if the vendor is acquired or shut down.

What to do next

If you take one process from this article, take this one:

  1. Map your AI landscape into the four layers and mark the embedded AI you already pay for. You will usually find two or three decisions hiding inside one question.
  2. Classify the data each use case touches and set the residency and regulatory-role gates. Anything that fails a gate is removed from the shortlist.
  3. Agree the weights before anyone scores. Score build, buy and partner per layer from 1 to 5, then rerun the arithmetic with the weights reversed to see which assumption the answer rests on.
  4. Cost the run-rate at real volume, including the multi-step agent overhead. Buying at demo volume is how budgets break.
  5. Price the exit as a line item: fallback model, export test, re-implementation estimate.
  6. Write the decision down and set the review triggers:
decision: customs-query-agent
layer: applications-and-data
verdict: partner
gate:
  data_residency: pass   # processing and logs stay in the UAE
scores: {build: 72, buy: 67, partner: 75}
exit:
  handover: code, prompts and evaluation set at milestone 3
  fallback_model: named at design time
review_triggers:
  - model price change above 20%
  - volume exceeds 2x the business case
  - vendor changes terms, pricing or roadmap
owner: head of engineering
review_by: 2027-05-01

Review each layer once a year even without a trigger: model prices and capabilities move faster than contracts, and today's build decision may have a strong alternative within 12 months. If you want a second opinion on where your layers land, this exercise is exactly what our AI strategy and readiness engagement does, and we run it with your team in the UAE rather than at a distance.

AI strategyBuild vs buyAI adoptionEnterprise architectureUAEVendor management
Found this useful? Share it.

Link to this article

Citing this in your own writing? Use the permanent link below.
Permalink
https://www.azrty.com/blog/should-we-build-or-buy-ai-a-layer-by-layer-build-buy-or-partner-framework
HTML
<a href="https://www.azrty.com/blog/should-we-build-or-buy-ai-a-layer-by-layer-build-buy-or-partner-framework">Should We Build or Buy AI? A Layer-by-Layer Build, Buy or Partner Framework</a> (Azrty)
Get a readiness assessmentOne call to find where AI will pay off in your business.
Related
Should We Build or Buy AI? A Layer-by-Layer Build, Buy or Partner Framework | Azrty