Back to Blog

Owning your AI?

8 min read·Posted underTech Talks
Cover Image for Owning your AI?

The Underlying Question

Businesses integrating AI into operations face a structural decision that is often made implicitly: whether to consume AI capabilities through external managed APIs or to deploy and operate models within their own infrastructure. The choice is rarely framed this way at the outset – teams reach for an API key because it is the fastest path to a working prototype – but by the time AI is embedded in production workflows, the architectural decision has already been made.

This post examines what that decision actually entails across three dimensions: data control, behavioral predictability, and cost structure.

Part I: The Managed API Model

How It Works

API-based AI products – OpenAI, Anthropic, Google, and similar – expose inference endpoints over HTTPS. The client sends a prompt, the vendor runs the model, and the response is returned. The model, the infrastructure, and the operational overhead all belong to the vendor.

Advantages

Time to deployment: Integration requires only HTTP client code and credential management. No infrastructure provisioning, no GPU procurement, no MLOps pipeline.

Access to frontier models: Vendors continuously update their hosted models. Users get capability improvements without migration work.

Elastic scaling: Capacity scales with demand without pre-provisioning. Traffic spikes are absorbed by the vendor’s infrastructure.

No model maintenance: Safety updates, fine-tuning improvements, and infrastructure patches are invisible to the consumer.

Structural Constraints

Data egress: All inference requests leave the client’s network. Data handling is governed by the vendor’s privacy policies and contracts, not the client’s security controls.

Behavioral coupling: Model outputs are coupled to the specific model version and deployment configuration the vendor runs. Vendors can update, deprecate, or remove model versions on their own schedule.

Opaque cost scaling: Pricing is per-token or per-request. As usage grows, costs grow proportionally with no ability to amortize fixed investment.

No infrastructure access: Clients cannot inspect the inference pipeline, modify serving parameters, or integrate at a level below the API surface.

Part II: The Self-Hosted Model

How It Works

Open-weight models – Llama, Mistral, Falcon, Qwen, and their fine-tuned derivatives – can be deployed on cloud VMs, on-premise servers, or hybrid environments. The operator controls the full stack: hardware, serving framework, model weights, and inference configuration.

Advantages

Data residency: Inference happens within the operator’s environment. No data leaves the network boundary. Audit trails, access controls, and data handling are entirely under the operator’s governance.

Behavioral stability: The model version does not change unless the operator decides to update it. Prompt engineering and output validation are stable across time.

Cost structure: At sufficient scale, self-hosted inference is significantly cheaper than per-token API pricing. Hardware costs are fixed or predictable; there is no per-query billing.

Customization depth: Operators can fine-tune on proprietary data, modify system prompts at the serving layer, adjust inference parameters, and integrate monitoring at any level of the stack.

Structural Constraints

Infrastructure overhead: Requires GPU capacity (either owned or reserved cloud), model serving software (vLLM, TGI, Ollama, or similar), and operational expertise to maintain uptime and manage updates.

Capability gap: Open-weight models currently trail frontier proprietary models on general benchmarks, particularly for complex reasoning tasks. The gap has narrowed substantially but has not closed.

Update responsibility: Security patches, alignment improvements, and capability updates require the operator to manage the full update cycle.

Fixed capacity risk: Pre-provisioned infrastructure may be under-utilized during low-traffic periods or under-capacity during traffic spikes.

Part III: The Three Structural Tradeoffs

1. Data Control vs. Operational Convenience

Managed APIs require data to transit the vendor’s infrastructure. For applications handling regulated data – financial records, health information, legal documents, PII – this creates compliance exposure that cannot be fully resolved through contract terms alone. Data handling promises are contractual assurances; the technical reality is that the data reaches the vendor’s servers.

Self-hosted inference keeps all data within the operator’s environment. This is not primarily a security argument; it is a governance argument. The operator defines what happens to data at every step, can demonstrate compliance to auditors with technical evidence, and is not exposed to the vendor’s breach surface.

2. Behavioral Predictability vs. Continuous Improvement

API models update on the vendor’s schedule. Major version transitions – GPT-3.5 to GPT-4 to GPT-5, Claude 2 to Claude 3 to Claude 4, and subsequent releases – have introduced measurable behavioral changes: different refusal patterns, different output formatting defaults, different reasoning approaches. For production systems where output consistency matters, these updates represent unscheduled changes to a core dependency.

Self-hosted models are pinned. The operator controls when and whether to update. This sacrifices access to automatic improvements but provides stability that is difficult to achieve with external APIs.

3. Cost Scaling vs. Infrastructure Investment

Per-token pricing scales linearly with usage. For low-volume applications, this is the economically efficient choice. For applications processing millions of queries, the math shifts: the recurring per-query cost eventually exceeds the amortized cost of self-hosted infrastructure.

The crossover point depends on workload characteristics, model size, and hardware costs. There is no universal threshold, but organizations where AI inference is a core operational function – not an occasional feature – generally find that the crossover arrives earlier than anticipated.

Part IV: The Hybrid Approach

Most production AI deployments at scale use a combination of both models, with routing determined by the characteristics of each workload.

Criteria Favors Managed API Favors Self-Hosted
Data sensitivity Low (no PII, no proprietary data) High (regulated, confidential, or sensitive)
Query volume Low to moderate High
Task complexity Requires frontier model capability Achievable with smaller fine-tuned model
Output consistency requirement Tolerant of behavioral variation Strict version pinning required
Team infrastructure capability Limited MLOps resources Existing infrastructure operations
Time to production Weeks Months

Common patterns:

Sensitivity-based routing: External APIs for public-facing or low-sensitivity tasks; self-hosted models for anything touching internal or regulated data.

Fine-tuned specialists: A smaller self-hosted model fine-tuned on domain-specific data often outperforms a general-purpose frontier model on a narrow task, at a fraction of the inference cost.

Fallback architecture: Self-hosted as primary; managed API as fallback for complex queries outside the local model’s capability range.

Part V: Open-Weight Model Landscape

The gap between managed and self-hosted capability has narrowed significantly since 2023. Several open-weight models now compete credibly with proprietary alternatives on domain-specific benchmarks:

Meta Llama 3: 8B and 70B parameter variants; strong general-purpose performance; permissive license for commercial use.

Mistral and Mixtral: Efficient architecture; strong reasoning per parameter; MoE variants for higher effective capacity.

Qwen: Strong multilingual performance; competitive on code and reasoning tasks.

Phi-3 and Phi-4: Small model series from Microsoft; competitive performance at 3.8B-14B scale; viable for edge or constrained environments.

Fine-tuning frameworks – LoRA, QLoRA, and full fine-tuning pipelines via Axolotl or LLaMA-Factory – allow these base models to be adapted to specific domains with modest compute requirements.


The tension between managed convenience and infrastructure sovereignty is not new to this industry. Blockchain development confronted an identical question a decade ago: whether to build on shared hosted infrastructure – exchanges, custodians, managed node providers – or to run full nodes, hold private keys, and accept the operational overhead that self-sovereignty requires.

The teams that chose convenience found themselves exposed when custodians failed, APIs changed terms, or providers became points of censorship.

The core argument for decentralized infrastructure was never purely ideological; it was a practical response to what happens when critical operations depend on someone else’s uptime, someone else’s rules, and someone else’s continued goodwill. AI deployment is now arriving at the same fork. An organization that routes sensitive workflows through an external model API holds those workflows on terms set by the vendor – terms that can change.

The parallel is direct: just as “not your keys, not your coins” captured the custodial risk of delegating asset control, the same logic
applies to delegating inference. If the model is making consequential decisions inside your operations, the question of who controls that model is not an infrastructure detail. It is a governance question.

Conclusion: An Architecture Decision, Not a Vendor Decision

The managed API vs. self-hosted decision is less about which vendor or which model and more about what kind of dependency an organization is willing to hold.

Managed APIs introduce dependencies on the vendor’s data handling, the vendor’s model update schedule, and the vendor’s pricing structure. Those dependencies are acceptable – even optimal – for many use cases. They become structural liabilities when AI moves into workflows that require data residency, behavioral stability, or cost predictability that external APIs cannot guarantee.

Self-hosted inference introduces a different set of dependencies: infrastructure operations, model update management, and the capability ceiling of available open-weight models. These are manageable with the right engineering resources but represent a non-trivial operational commitment.

Neither model is universally correct. The organizations navigating this most effectively are those that have made the choice explicitly – understanding what they are trading away in each direction – rather than those that defaulted to whichever option was easiest to start with.

Have a project in mind?

Let's talk about what you're building.


Milen
About the author

Milen

Milen Radkov has experience building and delivering successful complex software systems and projects for both big enterprises and small startups. Being actively developing across different blockchain protocols, platforms and projects for the past 10 years, he has gained extensive experience in blockchain development, architectures, consensus algorithms and token economics. Milen is a well-known figure in the blockchain space.


More Stories

Cover Image for Discreet Log Contracts vs. EVM Oracle Networks: Two Visions for Trustless Finance

Discreet Log Contracts vs. EVM Oracle Networks: Two Visions for Trustless Finance

The Oracle Problem: Where Every Blockchain Hits a Wall A blockchain is, by design, a closed system. It can verify its own state with mathematical certainty – whether a transaction was signed correctly, whether a UTXO exists, whether a smart contract condition was met. What it cannot do natively is reach out and verify the […]

Read more
Cover Image for The zkEVM Race: Ethereum’s Most Difficult Engineering Problem

The zkEVM Race: Ethereum’s Most Difficult Engineering Problem

Every blockchain faces the same uncomfortable question eventually: what happens when more people want to use it than it can handle? For Ethereum, that question stopped being theoretical years ago. At peak congestion, a simple token swap can cost more in gas fees than the tokens themselves are worth. The network processes roughly 15 transactions […]

Read more