Skip to main content
Deliberate AcademyProfessional AI Education
~14 min left
Lesson 9 of 10
14 min read10 XP

Build vs. Buy and AI Platform Strategy for Engineers

Deliberate Academy Editorial Team

Reviewed for accuracy and professional relevance

You're 9 lessons in — don't lose your progress.

Sign up free
What you'll learn
  • Apply the build vs. buy decision framework to an AI feature, distinguishing between API call, self-hosted, fine-tuned, and built-from-scratch options
  • Design an AI system architecture that can swap model providers without a full rebuild
  • Estimate the total cost of an AI feature beyond API costs, including inference, labelling, maintenance, and evaluation
  • Assess organizational AI platform maturity against the requirements of a proposed AI feature
  • Describe the engineer's role in translating technical AI knowledge into strategic input at the product and architecture level

Engineering teams in 2026 face AI build vs. buy decisions at multiple layers simultaneously: at the model layer (which provider, which tier, self-hosted or API?), at the tooling layer (which orchestration framework, which vector database, which evaluation platform?), and at the feature layer (is this a use case we build custom or a use case served by an existing AI product?). Making these decisions poorly is expensive in engineering time, in direct costs, and in the difficulty of undoing them later.

The Build vs. Buy Decision at the AI Layer

The build vs. buy decision in AI has more options than in conventional software. The spectrum runs from "call an existing AI API" to "build and train a custom model."

Call an API. Use OpenAI, Anthropic, Google, or a hosting platform like AWS Bedrock. You get access to frontier models, you pay per token, you inherit the provider's rate limits and pricing, and you accept that your data leaves your infrastructure. This is the right starting point for almost every AI feature. The decision to go beyond API calls requires a specific, evidence-based reason.

Self-host an open-weights model. Deploy Llama 3.x, Mistral, or another open-weights model on your own infrastructure or a dedicated inference platform. You retain data control, remove per-token API costs for high-volume use cases, and accept lower capability than frontier APIs, higher infrastructure complexity, and the burden of model maintenance. The right choice when data residency requirements prohibit external APIs or when volume economics make it justifiable.

Fine-tune an existing model. Take a base model and continue training it on domain-specific data. Appropriate when prompting and RAG cannot achieve the required output quality or style, when the task requires pattern recognition that cannot be injected via context, or when consistent response format at high volume requires shorter prompts than the task demands with a generic model. Requires labelled training data, GPU compute for training, evaluation infrastructure, and ongoing maintenance as the base model is updated.

Build a custom model. Train a model from scratch for a specific task. Only appropriate for large organizations with ML research capacity, very specific domain requirements not addressable by fine-tuning, and access to the proprietary data and compute needed for competitive custom model training. This is not an option for the vast majority of engineering teams.

AI implementation approach comparison

ApproachCapabilityCost modelData controlComplexityBest for
Hosted API (OpenAI, Anthropic)Frontier models, highest capabilityPer-token, predictable at low volume, expensive at scaleData leaves orgLow: API call integrationMost AI features at standard data sensitivity
Hosting platform (Bedrock, Vertex)Frontier + third-party modelsPer-token plus platform feesData in cloud provider environmentLow-medium: cloud setup requiredEnterprise compliance requirements, existing cloud contracts
Self-hosted open weightsLower than frontier, improving rapidlyInfrastructure cost, no per-token feeFull data controlHigh: infra, maintenance, updatesRegulated data, high-volume economics justify infra cost
Fine-tuned modelTask-specific, can outperform general models on narrow taskTraining cost + hosting costDepends on base model and hosting choiceHigh: training data, training runs, evaluationStyle/format consistency, task-specific quality requirements

Designing for Model Provider Portability

One of the most common expensive mistakes in AI engineering is tightly coupling application logic to a single model provider's API. Provider-specific prompt syntax, function calling formats, response structures, and SDK patterns get embedded throughout the codebase. When the provider changes pricing, deprecates a model, or degrades in quality relative to a competitor, switching becomes a multi-week engineering project rather than a configuration change.

The solution is a thin abstraction layer between your application logic and the provider API. Define your own request and response types. Write a provider adapter for each model provider you use or might use. All application logic talks to your interface; only the adapter knows about the provider-specific API details.

This is not over-engineering. It is the same separation of concerns applied to any external dependency. You would not let database-specific SQL syntax leak into your business logic layer. The same principle applies to model-specific API details.

Tip

Design for model provider portability from day one. Define a thin adapter interface that abstracts the model call: your application sends a request (system prompt, messages, output schema, temperature) to your adapter, and the adapter translates it to the provider-specific API format. When you switch providers or model versions, you update the adapter, not the application. The upfront cost is 2 to 4 hours. The cost of retrofitting portability into a tightly coupled implementation six months into production is 2 to 4 weeks.

The Total Cost of AI Features

AI feature cost estimates that only account for API costs are systematically wrong. The full cost picture includes several components that product teams and finance typically do not budget for.

API or inference costs. The per-token cost of model API calls, or the infrastructure cost of self-hosted inference. This is the number most teams estimate. It is also the number most likely to surprise at scale.

Labelling and evaluation costs. Building and maintaining eval sets requires human labelling. Even a modest eval set of 100 examples, refreshed quarterly, may require 8 to 16 hours of subject matter expert time per refresh cycle. Automated LLM-as-judge evaluation has its own API cost. Neither is zero.

Maintenance costs. AI features require ongoing maintenance that conventional features do not. Model provider changes require re-evaluation. Prompt drift (the gradual accumulation of edge cases the prompt does not handle well) requires prompt iteration. New data distributions require eval set expansion. Budget for this as a recurring engineering cost, not a one-time build cost.

Integration and orchestration infrastructure. Vector databases, embedding pipelines, evaluation platforms, and orchestration frameworks all carry licensing or infrastructure costs and engineering time to maintain.

The cost of errors. In features where AI errors have downstream consequences (incorrect auto-classifications, wrong draft content sent to customers, misrouted support tickets), the cost of the error rate at scale needs to be estimated: customer support load from incorrect outputs, engineering time for incident response, potential reputation cost. This is rarely included in feature cost estimates and should be.

Assessing AI Platform Maturity

Not every organization is ready for every AI feature, regardless of model capability. The gap is usually in data and infrastructure readiness.

Data readiness. Does the data the AI feature needs exist in a usable form? A RAG feature requires a clean, current, well-structured knowledge base. A classification feature requires labelled training and evaluation examples. A personalisation feature requires user behaviour data at sufficient volume. Features built on the assumption that the data will be made available later typically launch late or underperform.

Infrastructure readiness. Can the organization's infrastructure support the AI feature's latency, reliability, and scaling requirements? A user-facing AI feature with a 500ms response time target requires low-latency inference routing that may not be in place if the current stack was not designed for it.

Operational readiness. Does the team have the monitoring, alerting, and incident response capability to operate an AI feature in production? AI features fail in new ways (model regressions, context limit errors, hallucination-triggered downstream failures) that conventional monitoring does not detect.

The Engineer's Role in AI Strategy

Technical knowledge translates directly into strategic input, but only if engineers surface it in the right forums.

The build vs. buy decision is not purely technical. It involves product priorities, compliance requirements, competitive positioning, and cost structures that the engineering team understands better than anyone once they have done the analysis. Engineers who do this analysis and bring it to architecture reviews and product planning sessions are contributing strategic value.

The AI platform maturity assessment identifies the prerequisites for AI features before they are on the roadmap. An engineer who tells the product team in Q1 that a proposed Q3 AI feature requires a data pipeline that does not yet exist is preventing a Q3 delay.

Staying current in AI engineering means filtering signal from noise. New model releases matter when they change the capability or cost profile of your current integrations. New frameworks matter when they solve a specific problem you have. Most announcements are neither. The engineers with the most strategic input are the ones who evaluate new developments against their specific production context rather than chasing every headline.

The cost of not designing for model provider portability

Engineering Teams at Two Different Startups

Context

Two startups each built AI-powered customer support features in 2024, both initially using a single foundation model API. Both features shipped successfully. Six months after launch, the model provider they both used introduced a pricing change that increased their per-token cost by approximately 40%, which pushed the feature from margin-positive to margin-negative at their current scale. Both needed to migrate to a lower-cost model.

Action

Startup A had built its AI integration with a thin adapter layer from the start: a single ChatAdapter interface with one implementation for the original provider. Switching providers required writing a new adapter implementation and testing it against the existing eval set. The migration took one engineer five days. Startup B had no abstraction layer. Provider-specific API calls, response parsing, error handling patterns, and prompt formatting were distributed across 12 files in three different services. The migration required identifying and refactoring every provider dependency, updating tests, re-validating behaviour, and managing a staged rollout across services. It took three engineers three weeks.

Outcome

Both startups migrated successfully. Startup A's migration cost was approximately 40 engineering hours. Startup B's was approximately 360 engineering hours. The difference was entirely attributable to the portability architecture decision made 6 months earlier. Startup A's 4-hour upfront investment in abstraction returned a 320-hour saving at the first migration event.

Knowledge check

An engineering team is planning an AI feature that will use semantic search over a company's internal documentation to answer employee HR questions. The documentation is 50,000 pages, updated monthly, and the organization has a strict data residency requirement that all employee data must stay within the EU. Which infrastructure approach is most appropriate?

Select one answer.

Quick check

Why does this lesson call an AI feature cost estimate built on API spend alone systematically wrong, rather than merely imprecise?

Select one answer.

Exercise

Your Task

A Series A startup is building an AI feature that will analyse sales call transcripts and generate a structured summary including deal stage assessment, next actions, and risk flags. Transcripts contain customer names, company names, and deal values. The feature will process approximately 200 transcripts per day at launch, growing to an estimated 2,000 per day within 12 months. Draft a one-page build vs. buy recommendation covering: which implementation approach is appropriate at launch and at 2,000 transcripts per day, the data sensitivity assessment and which infrastructure choices it constrains, a total cost estimate for the first 12 months covering API costs, evaluation costs, and maintenance, and a model provider portability recommendation with a two-sentence rationale.

Your reflection

Did you complete this exercise? What did you find? (Saved locally in your browser)

Key takeaways
  • The AI build vs. buy decision spans four options: call a hosted API, self-host open weights, fine-tune a base model, or build custom. API calls are the correct starting point for almost all use cases. Moving beyond APIs requires a specific, evidence-based justification.
  • Model provider portability is a day-one architecture decision. A thin adapter interface abstracts the provider-specific API from application logic. The upfront cost is hours; the retrofit cost when providers change pricing or quality is weeks.
  • The total cost of AI features includes API or inference costs, labelling and evaluation costs, maintenance costs, integration infrastructure, and the cost of errors at scale. Features costed on API spend alone will surprise product and finance teams.
  • AI platform maturity assessment identifies data readiness, infrastructure readiness, and operational readiness gaps before a feature is on the roadmap. Surfacing these gaps early prevents late delivery and underperforming launches.
  • Engineers contribute strategic AI value by doing build vs. buy analysis, identifying platform prerequisites, and evaluating new model releases against specific production context rather than general capability claims.